Jump to content

Q about redirecting to another page


sai

Recommended Posts

Hi,

I am trying to create a dice game in PHP and it requires the randomization of the dice.

My problem is: if the player does not like his dice he can "refresh" the page or "go back" a page on the browser, to generate different dice.

 

What code could I put in my PHP so that if the player clicks the "refresh" or "back button" on the browser, the browser would either stop it, or redirect to another page?

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/58564-q-about-redirecting-to-another-page/
Share on other sites

Yeah you can use it for hrefs or images as far as i know..

 

what im going to post is likely wrong cause i HATE Javascript with a vengence and dont know much about it but...

<a href="#" onlclick="doJavaSomething()">Refresh The Dice</a>

 

Im not sure about what you would put in the function but maybe a <meta refresh> tag. Is what i use alot of the time when using php header() location is out of the question.

 

Andy

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.