gish Posted April 10, 2009 Share Posted April 10, 2009 I am trying to create a tally by using the get function this is the code so far page one <?php if ($_GET['t'] == ''){ $_GET['t'] = 0; } if ($_GET['q'] == 1){ $answer = "While she is tried."; } else if ($_GET['q'] == 2){ $_GET['t'] = $_GET['t']+1; $tally = $_GET['t']; $answer = "While she is tried."; } else if ($_GET['q'] == 3){ $answer = "While she is tried."; }else { echo '<a href="QuestionOne.php" name="question_one"> Oops you did not select an answer please try again</a>'; } ?> <a href="QuestionTwo.php?t=<?php echo $tally;?>" name="question_two">Question Two</a> This works fine when I send it to QuestionTwo.php i will get 0 or a 1 in the url bar Then I have to ask a question. When the form submits to The next page it does not take the t variable with it. How do I do this? Quote Link to comment https://forums.phpfreaks.com/topic/153454-get-variable/ Share on other sites More sharing options...
laffin Posted April 10, 2009 Share Posted April 10, 2009 use a hidden field or use sessions Quote Link to comment https://forums.phpfreaks.com/topic/153454-get-variable/#findComment-806265 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.