|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-04-23 03:30 UTC] Robbo at Skins dot nu
I have a single file that does both displaying a form if nothing has been submitted, or process data if data has been submitted. When the file is called with a query string (eg, file.php?hello) the form is displayed properly (as it should be), but as soon as I hit the submit button after completing the form, PHP crashes and I get an error 500 (internal server error). If I remove the query string, everything works fine (but I need the query string for a seperate function). This only happens when the form action is post, it works fine with get. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 10:00:02 2025 UTC |
I have a php4 file called temp.php with the following *exact* contents: <? mysql_connect("localhost", "root", "Robbo567"); if (!isset($frmAction)) { // If data has not been submitted ?><html><head></head><body> <form action="temp.php" method="post"> <input type="hidden" name="frmAction" value="submitted"> <input type="submit"> </body></html> <? } else { ?>Form has been submitted<? } ?> When this file is executed, it works perfectly, unless you supply it with a query string (eg temp.php?hello). As soon as a query string is supplied, PHP4 crashes and a 500 error is produced. I have norrowed it down to two workarounds, comment out the mysql_connect line and it works fine, or change the form method to get and it works fine... but as is it should also work fine.... alas it does not!!