Page 1 of 1

PHP refresh, while carrying over variables.

Posted: Wed Jan 20, 2010 11:17 am
by Zac199
Hi. Im making a web page that needs a specific function, but i cant for the life of me figure out how to do it.

I have my index that has you input 2 variables. What you want to to say, and how many times. (Its for a game im making.)

Thats easy enough. But what I need those variables to do, is use POST, and goto another webpage that requests and posts them...

What i cant figure out how to do is have a page, that refreshes every, lets say 5 seconds, then refreshes, goes to said POST the variables, and goto the web page. WHile at the same time keeping count of how many times its done it...

Any suggestions/Clarifying questions I can answer?

Thanks ahead of time.

Re: PHP refresh, while carrying over variables.

Posted: Wed Jan 20, 2010 11:23 am
by SidewinderX
You can use SESSION variables.

Re: PHP refresh, while carrying over variables.

Posted: Wed Jan 20, 2010 11:26 am
by Zac199
Hrmm, Ok. I will look into those. :P Thanks

EDIT: After i setup the session variable, can I just have it do the html meta tag refresh, and every time it refreshes would it
POST the data?

Posted: Wed Jan 20, 2010 11:43 am
by Jonah Bron
The Session variables do not POST. Read up on how sessions work.

http://w3schools.com/php/php_sessions.asp

Re: PHP refresh, while carrying over variables.

Posted: Wed Jan 20, 2010 11:57 am
by Zac199
Was already reading that page :). But how could I make it to so that if I had a frameset, 2 frames, one on top one on bottom. The tops frame displays how many times its posted, the bottom frame shows the posting in action... How could I get it to do that. Cause the page that actually grabs the text uses a $_REQUEST function to get it.

Posted: Wed Jan 20, 2010 12:19 pm
by Jonah Bron
I'm confused as to what the frames are doing. Could you clarify?

Re: PHP refresh, while carrying over variables.

Posted: Wed Jan 20, 2010 1:06 pm
by Zac199
Ok ill attempt to clarify xD.


Ok so my program goes, Index.html, you enter the info.

Then it goes to Frame.html. Which has 2 frames in it.

Code: Select all

<frameset rows="25%,75%">
  <frame src="ticker.php">
  <frame src="/Game/Say">
</frame>
 
Ticker.php is supposed to display, What you are saying, and how many times you have said it.

/Game/Say Gets the variable text, then says it in the game.

So the top frame displays what its doing, and how many times.
The bottom frame displays the game, and sends the variable.

Get it?