Page 1 of 1

Quick fix needed

Posted: Thu Jul 30, 2009 3:45 pm
by synical21
Im having trouble inputting the last part of information from my form.
"Notice: Undefined index: total_cost1 in F:\wamp\www\process.php on line 20"
I think i know the reason i just dont know how to fix it.

This is the html part of the code:

Code: Select all

<b>Estimated Job Cost:$<span id=total_cost1  name=total_cost1></span><br>
This is the process part:

Code: Select all

$sql="INSERT INTO jobs (title, descript, proof, min, amountworkers, totalcost, perperson)
VALUES
('$_POST[title]','$_POST[descript]','$_POST[proof]','$_POST[min]','$_POST[amountworkers]','$_POST[total_cost1]','$_POST[perperson]')";
all the other posts work except for totalcost and i believe it has something to do with the way the total cost is created. Total cost is calculated from other inputs where as the other stuff like title/proof/min there all inputed by the user. so maybe i dont use $_POST for something what isnt inputted by the user? Well i hope i havnt confused you i dont think i explained it very well.

If you need more info just ask.

Re: Quick fix needed

Posted: Thu Jul 30, 2009 4:12 pm
by jackpf
Only inputs in forms are sent as post data by the browser, not span tags.

Btw your query is horrible, you should do some validation on your post data, unless you have magic quotes turned on....which really shouldn't be.