PHP refresh, while carrying over variables.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Zac199
Forum Newbie
Posts: 4
Joined: Wed Jan 20, 2010 11:07 am

PHP refresh, while carrying over variables.

Post 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.
SidewinderX
Forum Contributor
Posts: 407
Joined: Fri Jul 16, 2004 9:04 pm
Location: NY

Re: PHP refresh, while carrying over variables.

Post by SidewinderX »

You can use SESSION variables.
Zac199
Forum Newbie
Posts: 4
Joined: Wed Jan 20, 2010 11:07 am

Re: PHP refresh, while carrying over variables.

Post 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?
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Post by Jonah Bron »

The Session variables do not POST. Read up on how sessions work.

http://w3schools.com/php/php_sessions.asp
Zac199
Forum Newbie
Posts: 4
Joined: Wed Jan 20, 2010 11:07 am

Re: PHP refresh, while carrying over variables.

Post 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.
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Post by Jonah Bron »

I'm confused as to what the frames are doing. Could you clarify?
Zac199
Forum Newbie
Posts: 4
Joined: Wed Jan 20, 2010 11:07 am

Re: PHP refresh, while carrying over variables.

Post 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?
Post Reply