Questions tagged as 'php'

2
answers

How to decode the following JSON? PHP

{ "data": { "app_id": "0000000", "scopes": [ "public_profile" ], "user_id": "00000000" } } I want to get the USER ID with json_decode. How do I get it?     
asked by 06.07.2016 / 19:07
1
answer

How do I get the value of a select and fill in an input?

<?php$con=mysql_connect("localhost","root","") or die("Failed to connect with database!!!!"); mysql_select_db("bancoteste", $con); $sth = mysql_query("SELECT * FROM pessoa"); ?> <!DOCTYPE html> <html> <hea...
asked by 01.07.2016 / 03:28
1
answer

PHP Logical Exclusion

I'm starting my studies in PHP. I need to make a logical exclusion and although I have already found enough content on the topic, I can not find exactly how to do logical exclusion in PHP. Mine I did so (physical): function remove( $table = nu...
asked by 22.04.2017 / 18:13
1
answer

$ .post return 2 values

I have following code: <script> $.post('http://localhost/app/user.php', {acao: acao}, function(retorna){ $("#demo").html(retorna); if(retorna == "sucesso") {faça x} }); </script> However, in user.php...
asked by 11.06.2016 / 01:52
2
answers

Array losing field after exiting the foreach

I have an array of object I want to add a field in each item I make a foreach for this, but the field some after exiting the loop foreach ($this->questions as $question) { var_dump($question); // aqui é apresentado o array no est...
asked by 24.03.2017 / 14:32
1
answer

Notice: Undefined index in variable $ _FILES (PHP upload) [closed]

I created this code to add products to my database, but an error occurs in the image, says that I did not define it. The code is this: <?php ob_start(); session_start(); require 'ligarDb.php'; $error = false; $nameError =""; $imagem...
asked by 21.03.2017 / 13:06
1
answer

Run PHP without refreshing the entire page

My code is this: <?php $buscarusuario=$pdo->prepare("SELECT * FROM top5 WHERE status = 'ativo' ORDER BY colocacao ASC"); $buscarusuario->execute(); // Exibir com Fetch_Obj $linha=$buscarusuario->fetchAll(PDO::FETCH_OBJ); foreach (...
asked by 02.08.2016 / 19:43
1
answer

Where to put the Model code in php

I have some tables in my db between them are post_has_categoria post categoria In My Models I have the Category.php and the Contest.php where should sql be responsible for post_has_category?     
asked by 20.03.2017 / 05:10
2
answers

JavaScript command does not work inside Buttom

Good morning! I have a problem and I can not resolve the issue. I need a buttom to appear or not according to the PHP condition. Making the buttom appear I'm getting, the point is that inside it has a javascript call that does not work inside PH...
asked by 01.08.2016 / 14:14
4
answers

Doubt with logic: How to find out if a time is in the range of hours (independent of the day)

Regardless of what time it is, I need to find out if a time is in the range of an initial and final time, given the 24-hour format. The logic can be in both PHP and MYSQL, since in any case you should stop a Stored Procedure. Ex: Inicio...
asked by 19.03.2017 / 14:10