Dan06 Posted September 17, 2008 Share Posted September 17, 2008 I've created a registration form page, which has all the text fields, checkboxs, radio buttons, etc. Once the user clicks the submit button, another page is used to insert the data into a MySql database. The second page which does the processing is blank and I would like this "processing" page to automatically call another page once the inserting is successfully done. How can I do this? Also, is there a better or more appropriate way to process the form information, other than collecting information in one page and having another page insert/update/delete the information? Below is the code I've used. Insight and feedback is much appreciated. Thanks. <form action="registering.php" method="post" name="generalinformation"> <table width="100%" border="1" cellspacing="0" bordercolor="#000066"> <tr> <td><label><div align="center">First Name: <br> <input type="text" name="firstname"> </div> </label> <label><div align="center">Last Name: <br> <input type="text" name="lastname"> </div> </label> <label><div align="center">Email: <br> <input type="text" name="email"> </div> </label> <label><div align="center">Password: <br> <input type="password" name="password"> </div> </label> <label><div align="center">Re-enter Password: <br> <input type="password" name="confirmpwd"> </div> </label> <p></p></td> </tr> <center><input type="submit" name="join" value="Join"></center> </td> </tr> </table> </form> </div> </body> </html> Link to comment https://forums.phpfreaks.com/topic/124696-need-help-with-registration-form-processing/ Share on other sites More sharing options...
genericnumber1 Posted September 17, 2008 Share Posted September 17, 2008 You can forward people to another page with header('Location:http://page.com/'); Note: this line must be run before any information is sent to the browser Or you can include another page with include() or require(). Link to comment https://forums.phpfreaks.com/topic/124696-need-help-with-registration-form-processing/#findComment-644073 Share on other sites More sharing options...
Imad Posted September 17, 2008 Share Posted September 17, 2008 You can merge the page that processes the information into the form page. All you need to do is this: if(isset(['submit'])) { //add the code that sends the information to mysql } Change the submit to the name of the submit button. Best Regards. Link to comment https://forums.phpfreaks.com/topic/124696-need-help-with-registration-form-processing/#findComment-644078 Share on other sites More sharing options...
Dan06 Posted September 17, 2008 Author Share Posted September 17, 2008 Thank you both for your help. I originally used: if ($queryresult = "TRUE"){ header ('location: registrationspecs.php'); exit(); } to forward users to another page, but this seemed inefficient so that's why I posed my original question. I think I'll try imbedding the processing of the form, within the form page. Kind regards, Link to comment https://forums.phpfreaks.com/topic/124696-need-help-with-registration-form-processing/#findComment-644165 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.