Questions tagged as 'php'

3
answers

How to not allow repeated INSERT giving reload on the page? [duplicate]

How can I do not to allow% re_completed if someone reloads the page? Example: $libera = $_POST['libera']; if ($libera == "sim"){ $sql = mysql_query ("INSERT INTO a_finan(id_reserva,id_cliente)VALUES('$id_res','$id_cliente')", $conexa...
asked by 16.01.2016 / 16:49
2
answers

Good practices for MVC in PHP

I'm learning more about using MVC using PHP, and after seeing some classes and articles on the internet I've had some doubts about using them, since I've found classes that present the same case differently. I know there is no perfect form, but...
asked by 20.04.2016 / 13:53
5
answers

How to remove ddd from a number

For example, I have a phone number saved in a variable: $numero = 5198765432 However, now I need to remove the ddd from it (51) to save it in another variable. How could I do that?     
asked by 27.04.2015 / 19:25
2
answers

Why use AngularJS?

I've been researching a lot, but I can not understand why I use AngularJS, since I use pages .php so the bank returns, CRUD and etc. I deal directly in the .php pages, bank records lists, insert and such things. Where and how ca...
asked by 18.04.2016 / 02:26
5
answers

Verify that all $ _POST was sent without using many ifs

Good morning, I have to check if all fields of the form, sent as $ _POST, have not been blank, this is until I solved it. But I wanted to see a way to not need to use many if / elif to check every index of $ _POST would: if(empty($_POST['no...
asked by 22.06.2018 / 16:06
4
answers

Call static class method by static variable

In the PHP documentation , I found this code against the scope resolution operator :: <?php class OutraClasse extends MinhaClasse { public static $meu_estatico = 'variável estática'; public static function doisPontosDuplo() {...
asked by 14.12.2015 / 18:00
3
answers

Validate different date formats

I'm having trouble validating different date formats. I need to convert the dates to the Y-m-d format to save to the bank. The dates come like this: 11/12/2014 // MÊS/DIA/ANO 30/10/2014 // DIA/MÊS/ANO I have tried the simple way: echo...
asked by 12.11.2014 / 23:02
1
answer

What are the Events for at laravel?

I have never used Event in Laravel and would like to know what the purpose is and if it has any advantage.     
asked by 09.12.2016 / 14:59
2
answers

Arguments in PHP

I would like to make those scripts that pass arguments. Ex. php script.php -email [email protected] Where can I find documentation on this? PS: I just want to know how to pass these arguments     
asked by 01.01.2017 / 23:03
2
answers

hide variable in url with htaccess

I wonder if there is any way to hide a subdirectory or a variable in the friendly url? Example: .htaccess RewriteRule ^([a-z,0-9,A-Z,_-]+)/categoria-([a-z,0-9,A-Z,_-]+)$ index.php?link=6&categoriaid=$1 In this case, I pass the catego...
asked by 08.11.2016 / 20:22