ChrisMartino Posted July 18, 2010 Share Posted July 18, 2010 Well I found a css layout on the net for a form, its quite nice although there's a slight downside to it, when you hit the submit button its not posting the value submit, so for example if I where do a if statement with the following: if($_POST['submit']) { // something. } The above statement wouldn't do anything but if I do the if statement with the post check value as one of the text input fields like so: if($_POST['account_username']) { // something. } it would return true to the above statement if you specified something in the box. Here is my form: <div id="container"> <p>Register a new account at <b>X-Host</b> to purchase products and other items!</p> <form action="index.php?v=account&register" method="post" class="niceform" id="regform"> <table width="329" border="0"> <tr> <td><label for="account_username">Username:</label></td> <td><input type="text" id="account_username" name="account_username" size="20" /></td> </tr> <tr> <td><label for="account_password">Password:</label></td> <td><input type="password" id="account_password" name="account_password" size="20" /></td> </tr> <tr> <td><label for="account_password_check">Password(Again):</label></td> <td><input type="password" id="account_password_check" name="account_password_check" size="20" /></td> </tr> <tr> <td><label for="account_email">Email Address:</label></td> <td><input type="text" id="account_email" name="account_email" size="20" /></td> </tr> <tr> <td> </td> <td><input type="submit" value="Register Account" /></td> </tr> </table> <br /> <p>By signing up at X-Host you agree to our <a href="index.php?v=tos">Terms of Service</a></p> </form> </div> </div> I would like to thank anyone in advance who could spare some time to shed some light into this :s Link to comment https://forums.phpfreaks.com/topic/208097-form-not-posting/ Share on other sites More sharing options...
Pikachu2000 Posted July 18, 2010 Share Posted July 18, 2010 The submit button needs a name="submit" . . . <input type="submit" value="Register Account" /> EDIT: Or better still, add a hidden field to pander to the weaknesses of some versions of Internet Exploder . . . <input type="hidden" name="submit" value="submit" /> Link to comment https://forums.phpfreaks.com/topic/208097-form-not-posting/#findComment-1087794 Share on other sites More sharing options...
kenrbnsn Posted July 18, 2010 Share Posted July 18, 2010 You don't have a "name" attribute on the submit line: <td><input type="submit" value="Register Account" /></td> without it, PHP doesn't receive the field. use <td><input type="submit" value="Register Account" name="submit" /></td> Ken Link to comment https://forums.phpfreaks.com/topic/208097-form-not-posting/#findComment-1087795 Share on other sites More sharing options...
ChrisMartino Posted July 18, 2010 Author Share Posted July 18, 2010 Thanks haha, simple mistake Link to comment https://forums.phpfreaks.com/topic/208097-form-not-posting/#findComment-1087810 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.