-1
After I put this code below ....
$capturaValorTotal = $_POST['valor'];
$capturaValorPagar = $_POST['valor-pagar'];
$valorDevido = $capturaValorTotal - $capturaValorPagar;
$inserindoBanco = "INSERT INTO `clientes` (`saldoDevedor`) VALUES ('".$valorDevido."')";
$executandoQuery = mysql_query($inserindoBanco);
Happened these mistakes below ...
PHP Error was encountered
Severity: Notice
Message: Undefined index: valor-pagar
Filename: controllers/financial.php
Line Number: 355 PHP Error was encountered
Severity: Warning
Message: Cannot Modify header information - headers already sent by (output Started at /home/molu/public_html/ossystem/system/core/Exceptions.php:185)
Filename: Libraries/Session.php
Line Number: 675 PHP Error was encountered
Severity: Warning
Message: Cannot Modify header information - headers already sent by (output Started at /home/molu/public_html/ossystem/system/core/Exceptions.php:185)
Filename: helpers/url_helper.php
Line Number: 542
Remembering that it is a system made in codeigniter, with POO. All the fields cited above were inserted in the database. In Models I selected the fields I need (if necessary, I put here tbm Models.)
My intention is just to make a change to the system, so that when the user receives part of a payment, the system registers the "missing" in the balance field.
I hope I can explain my doubt.
Put
var_dump($_POST)
at the beginning of your code, and see if the "value-pay" key actually exists.– William Novak
If you are using the pq codeigniter you are using
$_POST
direct? should use the classinput
. Not to mention obsolete functionmysql_query()
– rray
rray, I am a beginner in PHP. I am starting and I have this system known MAP OS (the one of Orders of Service). Since I’m short of cash, and I need to make these urgent changes, I have to get my hand on the code. But I don’t know much about codeigniter, although I’m enjoying it. If you could refer me to some website or codeigniter course I’d appreciate it. But how would I input this problem? Is $this->db->input-post the same as _$POST()? I had researched but could not find the answer or could not understand this question!
– Jardel Dint
William Novak, I put the var_dump and generated this error:
– Jardel Dint
The PHP Error was encountered Severity: Notice Message: Undefined index: value-pay Filename: controllers/financial.php Line Number: 355 NULL The PHP Error was encountered Severity: Warning Message: Cannot Modify header information - headers already sent by (output Started at /home/molu/public_html/ossystem/system/core/Exceptions.php:185) Filename: Libraries/Session.php Line Number: 675
– Jardel Dint
But in the VIEW there is the value-pay field, which is na for (for="value-pay"). Now what I don’t understand is: if the view has this field, how will I "declare" here in the controller.
– Jardel Dint
Even following the RRAY tip, I made $this->input->post('value'); and $this->input->post('value-pay');, replacing _$POST(). Although that pile of error did not appear any more, but became all white screen (what worried me more). And in the bank nothing was recorded... tipow.. that "contained" result that should be recorded in the bank, was not recorded. I will post the code again....
– Jardel Dint
$capturValorTotal => $this->input->post('value'); $capturValorPagar => $this->input->post('value-pay'); $valueDeved = $capturValueTotal - $capturValuePagar; $insertionBanco = "INSERT INTO
clientes
setsaldoDevedor
='".$valueValue." '"; $executandoQuery = mysql_query($insertionBanco);– Jardel Dint