Jump to content

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