Jump to content

Redirects based on URL variables...


Recommended Posts


Does anyone know how to invoke a redirect to another html page (error page) based on the condition that a user selects certain variables in the URL. I know an if statement would have to be used, and I would use "if $variable =>.." so greater than or equal to. But I cant think of a way to invoke the redirect.....

Any suggestions?

Thanks a lot,
Link to comment
Share on other sites

If you want to redirect a user use header, For example say you had a login script and then you checked for the logout variabled in the url If you find it you'll redirect the user to the logout page:
[code=php:0]if(isset($_GET['logout') && $_GET['logout'] == 'true')
    header("Location: logout.php");
Link to comment
Share on other sites

[quote author=shivabharat link=topic=110152.msg444786#msg444786 date=1159723004]

You have to use the META tag for this

[code]<meta http-equiv="refresh" content="2;url=http://mypage/index2.php">[/code]

Not a good idea: http://www.w3.org/QA/Tips/reback
Link to comment
Share on other sites

This thread is more than a year old. Are you sure you have something important to add to it?

Join the conversation

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

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.