Questions tagged as 'php'

2
answers

Error passing variable as double parameter

I have a function pesquisaPagamentos($pesquisa) I have a $pesquisa variable that is getting the following value: '2015-10-05','2015-10-01' , with single quotation marks. It turns out that the way it, when it arrives at funct...
asked by 05.10.2015 / 23:53
1
answer

Is there a pattern similar to Singleton?

It's really frustrating, a bit interesting maybe, but frustrating above all, I still figured out how and why to use the Singleton standard yesterday, and today, when I was going to finish a little improvement on a project, the true face of the...
asked by 14.11.2015 / 05:00
4
answers

foreach php inside script

Could you please let me know if it is wrong to use this code like this: <script type="text/javascript"> <?php foreach ($lista as $key => $value) { $id_indicador = $lista[$key]['id']; ?> var id_indicador = <?php echo $i...
asked by 11.11.2015 / 16:34
2
answers

How to create Exceptions to treat statement with Mysqli

I'm migrating from PDO to Mysqli and when doing some operation with the bank, the check block was like this: $query = $db->prepare("ppapapa sql sql"); try { $query -> execute(); return $query -> fetchAll(); } cat...
asked by 18.10.2015 / 13:44
2
answers

Token in URL is safe?

I'm developing an application, and I'm doubtful about the password recovery part. I have a method that the user enters the email that is registered in the application when he forgets the password. Ex: public function esqueciSenha($email) {...
asked by 01.10.2015 / 18:56
1
answer

How to validate birth date between the year 1900 and Today?

How to validate birth date with 3 fields? I have the field "date1" with the day, "date2" with the month and "date3" with the year, I need to validate the date of birth. These 3 fields come from a bd . It would look something like this:...
asked by 02.05.2014 / 05:39
2
answers

Script to Extract Values from the InfoMoney Website for Dollar Quotation

I have a PHP Code with a script in Jquery that collects information from the InfoMoney site and returns the quotation of the commercial dollar (Buy and Sell). I would like to know how to update this code so that in addition to the commercial...
asked by 05.06.2017 / 15:36
1
answer

Security in php failing

I created a small security code for my login system, to prevent people from compiling the administrative panel link and pasting and accessing it. <?php ob_start(); if(($_SESSION['usuarioNome'] == "") || $_SESSION['usuarioNivelAcesso'] =...
asked by 13.07.2017 / 14:53
2
answers

What utility has this form of accessing variable values

<?php $Bar = "a"; $Foo = "Bar"; $World = "Foo"; $Hello = "World"; $a = "Hello"; $a; $$a; $$$a; $$$$a; $$$$$a; ?> How can I take advantage of this way of accessing v...
asked by 04.07.2017 / 00:41
2
answers

Count number of records in a database

I want to count the number of records in a database table. I have 3 records in my DB, but the result is always 1. I used this code: $base_hndl = new SQLite3("p.sqlite"); $select = "SELECT COUNT(*) FROM users"; $resultat = $base_hndl->exec($...
asked by 10.11.2014 / 01:13