Portal Home > Knowledgebase > Articles Database > Form post won't insert into MySQL


Form post won't insert into MySQL




Posted by FinalFrontier, 11-28-2011, 11:48 PM
I am trying to insert a form input into MySQL, but can't seem to get it working. foobar.html /setpassword I echoed the query, everything is fine except there is no post coming through. I also tried it without the MySQL real escape, but still the same result. Can anyone see whats going on?

Posted by 8088, 11-28-2011, 11:54 PM
What do you mean with 'there is no post coming through'? Is $_POST empty? Also, allow PHP to return any MySQL errors:

Posted by FinalFrontier, 11-28-2011, 11:56 PM
Yes, $_POST is empty. I echo out $query and get this: INSERT INTO orders (orderpassword) VALUES ('') WHERE id = '1646'

Posted by 8088, 11-29-2011, 12:00 AM
What do and return?

Posted by FinalFrontier, 11-29-2011, 12:03 AM
and (nothing)

Posted by 8088, 11-29-2011, 12:07 AM
Seems like the method of the form is set to "get" unlike your first example...

Posted by FinalFrontier, 11-29-2011, 12:08 AM
What does that mean?

Posted by 8088, 11-29-2011, 12:13 AM
As far as I can see, there seems to be a discrepancy between the code you posted and the code that you're using. You posted but it looks like you're actually usingAre you absolutely positive the form is being posted? Apart from looking at your code, you could verify it with Tamper Data. Or a link to a testcase would help.

Posted by FinalFrontier, 11-29-2011, 12:18 AM
I am 200% sure it is being posted. BTW, Tamper Data is such a cool plug-in.

Posted by FinalFrontier, 11-29-2011, 12:31 AM
I restarted apache, cleared cookies, and now POST is coming through... but its still not going into MySQL. I'll keep this thread updated.

Posted by FinalFrontier, 11-29-2011, 12:37 AM
Well, thats seems to be that. I'll put my money down on that Apache was playing up, which is why things are now working since I rebooted it. Solved.

Posted by 8088, 11-29-2011, 01:06 AM
That is quite odd...but good to hear it's solved.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
Brute Force Attacks? (Views: 629)
eAccelerator tweak (Views: 609)
Cloudflare and Email (Views: 591)