FirstBorn Posted December 27, 2008 Share Posted December 27, 2008 Hi, Thank you for reading. I'm using the form submit code Code: <?php print $_SERVER["PHP_SELF"]; ?> and it does not work for some reason... Here is sample code for what I'm using: <?php if($_POST["submit"]) { echo "Submit!"; } else { ?> <html> <head><title>Test Submit</title> </head> <body> <form action="<?php print $_SERVER["PHP_SELF"]; ?>" method="post"> <INPUT TYPE="submit" value="submit"> <input type="reset" value="Reset"> </FORM> <!-- form code ends here! --> </body> </html> <?php } ?> Why is this not working? What I mean by 'not working' is that when you press the button, it seems to reload the page and doesn't seem to count the button click as a 'submit' at all... Any Ideas? Thank you for your help! Thanks, FirstBorn PS. I've used two different webservers / hosts to test this out on, and this script works on NEITHER of them. (Dreamhost and HostGator Servers...) Thanks. Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted December 27, 2008 Share Posted December 27, 2008 You need to give the submit button a name for it to be transmitted. BTW, if your script submits to itself, you don't need an action: <form action="" method="post"> <INPUT TYPE="submit" name="submit" value="submit"> <input type="reset" value="Reset"> </FORM> Ken Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.