Questions tagged as 'php'

3
answers

How to correctly do this condition?

I made this condition so that if the person searches for the name andrey will execute a require, otherwise it will not display, so any name that I put in the search field is bringing the require, so here's my code: if ($resultados->num_rows...
asked by 09.10.2017 / 19:54
1
answer

Error executing fields checklist

I have the following code: $funcionario_materiais = array(); foreach($_POST AS $key=>$val){ $tmp = explode("_",$key); if($tmp[0]=="materiais"){ $funcionario_materiais[$tmp[1]]=$val; unset($_POST[$key]); } } $fun...
asked by 14.06.2015 / 06:20
1
answer

How can I make a Javascript roulette [closed]

Well my question is this: I have an HTML form, which when loading on submit it gives me a random number of 1 to 5 in PHP. What I wanted to know was, how could I do that by clicking on the button PHP would select one of the numbers 1 to 5 rand...
asked by 17.06.2015 / 05:01
0
answers

FTP upload with PHP, is not sending the image [closed]

Based on the code below I'm trying to send an image through the FTP protocol, but the file is not being sent, something tells me it's in the path of the file, <?php $arquivo = $_FILES["fileToUpload"]["name"]; $servidor = 'servidor'; $target...
asked by 12.06.2015 / 22:54
3
answers

How to present the result of a form on the same page?

I have a form that gives me the result on another page, but I would like the result to appear on the same page. <form name="calc" method="get" enctype="multipart/form-data" action="resultado.php"> <input type="text" id="Peso" name=...
asked by 08.12.2015 / 17:42
1
answer

What is the best way to organize a directory for a web project? [closed]

What is the best way to organize directories for a PHP web development project?     
asked by 10.06.2015 / 00:24
4
answers

Fill fields in a multidimensional array with null

I have this code that returns this array and if you notice, you can see that there are empty fields. What can I increment in this code so that where the index is empty receive the value null ? This works, but for my multidimensional...
asked by 07.09.2014 / 02:45
4
answers

Variable Reference

I'm studying PHP and I came across a question of variables by reference and I did not quite understand how it behaves. function foo(&$var) { $var++; } $a=5; foo($a); echo $a; // Retorna 6 When I saw this function I thought, "Yeah,...
asked by 14.01.2016 / 13:21
4
answers

PHP Check mobile device

I need via PHP, some function that tells me if the user's device is mobile or not, or, at least tell me the resolution of it. Anyone have any tips?     
asked by 02.04.2016 / 13:31
4
answers

XML returned by web service with encoding error

Hello, I have an XML that returns from a webservice with encoding errors, in the encoding of XML is as UTF-8 however it does not display accents correctly and I can not detect which correct encoding it should be . I have no information of how i...
asked by 16.02.2017 / 01:40