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
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

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.