Questions tagged as 'php'

2
answers

How do I retrieve and calculate 2 numbers via POST on the Controller in Laravel?

I'm a beginner in language and I'm trying to learn by myself, I created a .blade.php file in order to fill two simple fields and return the calculation via submit, after that I want to list a history stored in the SQL database, but I barely know...
asked by 11.10.2018 / 16:12
1
answer

CakePhp via Shell returns error: class HelloShell could not be loaded

I configured and installed everything with CakePhp for use via the command line in ubuntu. I created and saved the following: class HelloShell extends AppShell { public function main() { $this->out('Hello world.'); } } What is their...
asked by 09.02.2014 / 11:22
3
answers

How to mount a dynamic checkbox

I have one: <select name="snh_predio" id="snh_predio"></select> It loads automatically. When this is changed: $("#snh_predio").change(function() { }); I want you to print to a table a list of checkbox for selection:...
asked by 11.02.2014 / 14:48
1
answer

Strings handling with str_replace

I'm trying to treat a string with the function str_replace however I wanted to insert a <span> before before the treated word, as in the example below: $entrada = array("//"); $tratamento = array("<span class='comentar...
asked by 09.02.2014 / 18:52
1
answer

How to change the value of the joker in the Prepared Statement?

Suppose I have a query with prepare that looks like this: select senha from usuarios where id=? //or id2=?, array($id,$id2); (é só um exemplo). My intention is to change the ? to any other value that I choose within the array...
asked by 17.02.2014 / 17:55
1
answer

Reply (in e-mail) the PHP form response to a different email

I have the following code to send the responses of a form from my site to my email: <?php // //Variáveis $n_nome = $_POST['n-nome']; $n_email = $_POST['n-email']; $n_fone = $_POST['n-fone']; $n_msg = $_POST['n-msg']; $data_envio = date('d...
asked by 17.05.2018 / 22:48
1
answer

Check that all elements are equal

I'm retrieving all the expired tickets from the database, with the following query SELECT user,status,hash FROM ticket WHERE datepay < date_add(now(), interval -1 month) AND user = '119' The result is as expected, as below....
asked by 17.05.2018 / 19:55
1
answer

Make the Average in Javascript

I have a table that per line is performing a calculation and putting the result in the results column. The goal is that now at the end in three cubes appear averages depending on the results obtained and do not know how to call those results....
asked by 28.05.2018 / 13:18
1
answer

Too slow table using Datatable

I am bringing 3,000 MYSQL database records using a connection to PDO and PHP. The time to be taken costs around 40 seconds until all the data is presented. Is Datatable unable to bring data in pieces? Below is my entire code: -HTML-...
asked by 01.06.2018 / 14:46
2
answers

Contact Form PHPMailer does not work

I'm using the PHPMailer class to send emails, but every time I click the submit button it stays with the message forever in the "Sending your message ...". I do not know if the problem is in AJAX or my mail.php . On the console it gives...
asked by 27.01.2018 / 22:41