Jump to content

Redirects based on URL variables...


mkosmosports

Recommended Posts

Hello,

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,
mkosmosports
Link to comment
https://forums.phpfreaks.com/topic/22666-redirects-based-on-url-variables/
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");
}[/code]
[quote author=shivabharat link=topic=110152.msg444786#msg444786 date=1159723004]
Hi,

You have to use the META tag for this

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

Not a good idea: http://www.w3.org/QA/Tips/reback

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.