Posts by Brittz • 428 points
17 posts
-
1
votes2
answers1391
viewsA: confirmation of registration via e-mail
I took this good example from the official PHP site: <?php $to = '[email protected]'; $subject = 'the subject'; $message = 'hello'; $headers = 'From: [email protected]' . "\r\n" . 'Reply-To:…
-
2
votes2
answers63
viewsA: PHP does not print output when equal to 0
The right thing to do in this case is to use the is_null, because when the variable value is 0 it will return phony, so you won’t fall for the first IF. My suggested code:…
-
0
votes1
answer125
viewsA: Ionic emulate - Error running on AMD processor machine
Researching I found this solution: Go to Control Panel Programs and Resources Enable or disable Windows features Deselect the "Hyper-V" option in the window that opens Restart the computer Source:…
-
1
votes2
answers557
viewsA: First steps: Ionic
Prerequisites First you need to have knowledge in: HTML CSS Javascript Angularjs is also required, but if you don’t know, you can learn as you learn to interact with Ionic resources. However, I…
-
1
votes1
answer602
viewsQ: How to send data from an Ionic Framework generated form to a PHP file and return a JSON?
I’ve been following the documentation of Ionic Framework and selling tutorials on the internet, but there is no detail of communication with the server. I would like to send form data and receive…
-
2
votes2
answers86
viewsA: How to choose date in timestamp
You can use the time PHP, which returns the team in seconds. <?php // time atual em segundos $now = time(); // adicionando 5 minutos $futuro5min = $now + (5*60); // adicionando 10 minutos $futuro…
-
2
votes3
answers45
viewsA: & Error inside mysql query
There are two ways CORRECT to solve this. 1) Escaping (\) the special character. $sql = mysqli_query($con,"SELECT * FROM semana WHERE Dias = 'Segundas \& Terças'"); 2) Using the…
-
8
votes2
answers31712
viewsA: What is the difference between " n" and " r n" (special characters for line breaks)?
According to the same topic in English: \r = CR (Carriage Return) // Used as line break on Mac OS prior to version X \n = LF (Line Feed) // Used as line break Unix/Mac OS superior to X version \r n…
-
1
votes2
answers339
viewsA: Is it possible to create a "synonym" of a function, two names for the same function?
I did a lot of research and I couldn’t find an alternative. The way you’re doing it is elegant and I use it a lot. I usually use it to make intuitive function names, so that the programmer does not…
-
0
votes4
answers5322
viewsA: Send Javascript array via Ajax with jQuery for PHP file
In the PHP script that will receive the data, just access it using $_GET, or $_POST, if the method is post. So it would look something like this: <?php $nome_receita = $_GET['nome_receita'];…
javascriptanswered Brittz 428 -
1
votes5
answers1390
viewsA: Page redirection according to access country
You can use the $_SERVER["HTTP_ACCEPT_LANGUAGE"] php. It brings information sent from the browser. <?php echo $_SERVER['HTTP_ACCEPT_LANGUAGE']; // pt-BR,pt;q=0.8,en-US;q=0.6,en;q=0.4,gl;q=0.2…
-
0
votes1
answer62
viewsA: PHP Find directory stating part of directory name
That should do what you want: <?php $dir = "2016/783/01-relatorios/2016-07-26-00001-relatorio semanal 21"; $peaces = explode("/", $dir); foreach ($peaces as $idx => $peace) { if…
-
2
votes3
answers1080
viewsA: One process at a time PHP
I believe that using thread It won’t work for what you want, because according to my research, thread is a feature that will allow you to run in parallel blocks, so I understand you want sequential…
-
1
votes1
answer135
viewsA: fopen does not open uploaded files
The problem is that you are using the fopen with the temporary file path, which has already been moved by move_uploaded_file. Try to make this change in the code: <?php if($_POST){ $arquivo =…
-
2
votes2
answers518
viewsA: Grab File without knowing the extension of it
You can search all files from a directory using the function scandir, and then comparing the name using the function pathinfo, using the parameter PATHINFO_FILENAME. Feel free to change this script…
-
0
votes1
answer479
viewsA: How can I improve this loop that has one foreach inside another?
An alternative way is to store the HTML content and print (echo) everything at the end, so you can use the function implode in place of foreach intern. See the code below: <?php $xml =…
-
0
votes1
answer43
viewsA: Receive notification from google drive
The Google Drive API has support for PHP. You can use it to make a query, through an asynchronous task written in PHP, to check daily changes in the directory and send emails according to its rules.…