Jump to content

Get variable


gish

Recommended Posts

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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.