mikebyrne Posted March 16, 2009 Share Posted March 16, 2009 Im just coding a menu page that will redirect the user to the desired page once they click a submit button i want my first button to goto test.php the code at present is <p align="center"> <input name="submit" value="Input into Database" type="submit" /> </p> Whare do I insert test.php?? Link to comment https://forums.phpfreaks.com/topic/149715-solved-submit-button-to-redirect-to-another-page/ Share on other sites More sharing options...
POG1 Posted March 16, 2009 Share Posted March 16, 2009 You will need to do it in the opening form tag. <form action="page.php" method="post"> <p align="center"> <input name="submit" value="Input into Database" type="submit" /> </p> </form> Link to comment https://forums.phpfreaks.com/topic/149715-solved-submit-button-to-redirect-to-another-page/#findComment-786177 Share on other sites More sharing options...
mikebyrne Posted March 16, 2009 Author Share Posted March 16, 2009 There's going to be 5 or 6 buttons at present my form looks like this <html> <style type="text/css"> label { width:150px; margin-right:5px; text-align:right; display:block; float:left; } .style1 {font-weight: bold} </style> <body> <p><img src="untitled.jpg" alt="" width="994" height="176" /></p> <p align="center"> <input name="submit" value="Input into Database" type="submit" /> </p> <p align="center"></br> <input name="submit" value="Search By Name" type="submit" /> </p> <p align="center"></br> <input name="submit" value="Search by Estate" type="submit" /> </p> <p align="center"></br> <input name="submit" value="Search by Polling Station" type="submit" /> </p> <p align="center"> <input name="submit" value="Search by Voting type" type="submit" /> </p> Link to comment https://forums.phpfreaks.com/topic/149715-solved-submit-button-to-redirect-to-another-page/#findComment-786191 Share on other sites More sharing options...
POG1 Posted March 16, 2009 Share Posted March 16, 2009 onClick="window.location='pageurl.php';" Link to comment https://forums.phpfreaks.com/topic/149715-solved-submit-button-to-redirect-to-another-page/#findComment-786215 Share on other sites More sharing options...
mikebyrne Posted March 16, 2009 Author Share Posted March 16, 2009 How do you write it? I've tried <p align="center"> <input name="submit" value="Input into Database" onClick="window.location='test.php';" /> </p> But that doesn't work Link to comment https://forums.phpfreaks.com/topic/149715-solved-submit-button-to-redirect-to-another-page/#findComment-786224 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.