Questions tagged as 'php'

2
answers

How to keep the variable with the same value in the database?

I have a question in the code below: <?php include "conexao.php"; $id = $_POST["id"]; $nome = isset((trim(ucwords($_POST["nome"])))) : (trim(ucwords($_POST["nome"]))) : $apelido = trim(ucwords($_POST["apelido"])); $telefone = trim($_POS...
asked by 20.09.2017 / 00:29
2
answers

What index (php or html) loads when both are present?

I would like to know which index file loads in case you have an index.html and an index.php on the site. Let's say that I'm building a PHP site, but I need the server for tests and so on, so I make a simple HTML page and put it there ... So t...
asked by 23.01.2017 / 17:33
1
answer

When should I include "../" in the path to an include or image? [duplicate]

I have this doubt because time is only necessary the path pasta/arquivo.ext and time I have to put ../pasta/arquivo.ext . Is there a rule?     
asked by 17.01.2017 / 15:44
7
answers

Extract content Array for PHP variables

I have a cURL statement that invokes a WS. The response from this WS is stored through: $reference = var_dump(json_decode($exec, true)); return $reference; Given that I have this in one function, in the other file I read as follows: $var...
asked by 18.01.2017 / 16:37
2
answers

PDO security question PHP

I would like to know the difference in security level of the two code snippets below: // TRECHO 1 <?php $calories = 150; $colour = 'red'; $sth = $dbh->prepare('SELECT name, colour, calories FROM fruit WHERE calories < ? AND co...
asked by 13.11.2015 / 15:18
2
answers

Variable control with Javascript for html

I have an HTML code with JavaScript that when clicking on top; If x == 1 , it executes task A and variable arrow javascript x = 0 , otherwise it executes task B and variable arrow javascript x = 1 , however variab...
asked by 07.12.2015 / 13:25
2
answers

How to know key values in Javascript?

I'm developing a basic game in Javascript , and the player has some actions, I've already implemented ActionListener , but I'm having difficulty finding key values to use in ActionListener . I was picking up the values of each...
asked by 22.02.2017 / 12:33
1
answer

How to show the number of MySQL replicates?

I have a bank where names and last names are registered, I can group the results as follows: SELECT DISTINCT * FROM usuarios GROUP BY sobrenome So if you have 80 records repeated for the last name "Jose" for example, obviously it groups...
asked by 19.12.2015 / 15:02
3
answers

Divide a date into two parts

I'm making a calendar using MySQL, html, JS and PHP. This calendar is for reserving the ballroom here in the building. There may be two reservations the same day, morning and afternoon that would be "00:00 to 11:59" and "12:00 to 23:59"....
asked by 29.12.2015 / 18:44
2
answers

How to add everything in MYSQL

How do I add all of a table in MySQL for example .. I have the table tb_comment , so I want to add in each post(id_mark) the amount of rate that will have the total. For example, id_user 20 has the rate of 4 in id_...
asked by 11.12.2015 / 23:15