Questions tagged as 'php'

1
answer

How does this sentence prepared in PDO in PHP work?

I am reading about PDO and prepared sentences, I got this way of selecting data from the database, I would like someone to explain to me because I do not understand all the functions very well, especially the declared class and the recursiveIter...
asked by 24.05.2017 / 23:26
2
answers

Use special characters in option

I do not know if it's possible but I need to use special characters in a <option> that has accents. The option value is collected in a variable called $genero . The example I am trying is the following: <option name="Acci...
asked by 25.05.2017 / 13:55
3
answers

Concatenate string in php

I want to concatenate a session variable that before its value has a 'and at the end of its value has another', as I do. I leave code $colorHeader = $_SESSION['_colorHeader']; For example: The variable $_SESSION['_colorHeader'] co...
asked by 29.03.2017 / 20:43
3
answers

Problem with the accents in url

Query: Code: Link: example a link: localhost / codeigneter / search / region-of-arica-and-parinacota / aysen     
asked by 30.03.2017 / 14:22
2
answers

change PHP date format [duplicate]

When I make an INSERT in the bdd using a form one of the columns automatically generates the date in which it was made, the case is that it is stored with this format 2017-03-29 17:12:16 What I am trying to solve is to change the format t...
asked by 29.03.2017 / 15:36
2
answers

enter SQL query in an input with PHP

I am trying to query a BDD with php to show the results through an HTML input. To show the result I do the following: while($fila=mysqli_fetch_array($resultados, MYSQLI_ASSOC)){ $emp = $fila['Emp_Nom']; { And I show it through t...
asked by 02.04.2017 / 00:35
4
answers

Print HTML content from PHP to Javascript variable

As it says in the title, I can not do the following: <html> ...... <script> var texto = " <?php echo $html; ?> "; </script> </body> </html> I do not know how to make the html content that is i...
asked by 04.04.2017 / 03:17
1
answer

SQL injection in PHP with a CodeIgniter midleware

I'm with a question with a function to prevent SQL injection: public function f_LIMPIARINPUT($a_variable) { $valor = $a_variable; $valor = str_ireplace("SELECT", "", $valor); $valor = str_ireplace("FROM", "", $valor); $valor =...
asked by 15.03.2018 / 15:43
1
answer

How to pass a javascript variable to a php variable?

What I want is for my php variable to get the value of my javascript variable So I get my javascript value:      (function() { var variable="contenido"; alert(variable); })(); </script> So I want to pass it to my php variable...
asked by 22.03.2018 / 00:21
2
answers

I can not search by name in mysql

I have a table called debtors with 2 fields, name and amount, where name is a% co_of% of 20 and I value a% co_of% of 13, the key field is name and is% co_of%, I can not run a simple query as: echo implode("",mysql_fetch_row(mysql_query("SELECT...
asked by 06.04.2017 / 17:54