NLT Posted July 16, 2011 Share Posted July 16, 2011 Say if I had a simple email script, how would I make it when they submit a form in index.php it will take them to index.php?=done Quote Link to comment https://forums.phpfreaks.com/topic/242155-indexphpdonephp/ Share on other sites More sharing options...
herghost Posted July 16, 2011 Share Posted July 16, 2011 <?php //if all ok header('Location: done.php'); ?> Your above line doesn't really make sense, you would need something like index.php?status=done Quote Link to comment https://forums.phpfreaks.com/topic/242155-indexphpdonephp/#findComment-1243590 Share on other sites More sharing options...
Fadion Posted July 17, 2011 Share Posted July 17, 2011 <form method="post" action="index.php?status=done"> <!-- rest of form elements --> </form> Quote Link to comment https://forums.phpfreaks.com/topic/242155-indexphpdonephp/#findComment-1243616 Share on other sites More sharing options...
NLT Posted July 18, 2011 Author Share Posted July 18, 2011 THanks both. How would I make the index.php?=done have different things on rather than the index? Quote Link to comment https://forums.phpfreaks.com/topic/242155-indexphpdonephp/#findComment-1244194 Share on other sites More sharing options...
teynon Posted July 18, 2011 Share Posted July 18, 2011 You keep doing index.php?=done. The ? indicates a variable being passed to the server via GET method. Therefore, you must specify the variable name IE (index.php?status=done) as was already stated. In PHP, you can interpret the variables by doing this: if ((isset($_GET['status']))&&($_GET['status'] == 'done')) { // Do something } Quote Link to comment https://forums.phpfreaks.com/topic/242155-indexphpdonephp/#findComment-1244197 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.