I want to build a page that automatically transfers me to other pages-eg
switch()
{
case 1:
go to a url;
break
case 2:
go to another url;
break
.........etc.
Problem:- I don't want to display links to the URL's, I want the page to automatically send me to the URL's
Surely there must be some PHP code that allows for this
Many thanks.
Auto?
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
If what you mean is that you don't want the user to see the url he or she is being shipped off too, I suspect PHP is NOT going to get the job done. Additionally, most browsers show the user the url they are headin' for in the address bar. If you can use Javascript to affect this in someway, then you would have your answer eh? As a matter of fact, if you want to use some evil pop-up, you should be able to control whether or not it shows the address bar. I think that may be the direction you want to go.Problem:- I don't want to display links to the URL's, I want the page to automatically send me to the URL's
Later on,
BDKR
- RandomEngy
- Forum Contributor
- Posts: 173
- Joined: Wed Jun 26, 2002 3:24 pm
- Contact:
Code: Select all
switch( $variable ) {
case 1:
header("Location: page1.php");
exit;
break;
case 2:
header("Location: page2.php");
exit;
break;
case 3:
header("Location: page3.php");
exit;
break;
default:
break;
}Sorry
Sory if this seemed vague, Randomengy's got it though, yes header() is just what I'm looking for.
I wanted to post a variable to the page and depending on the value of that variable, to be sent (automatically) to another page(of course that page would be given a specific URL in the switch() routine.
thanks for your replys
I wanted to post a variable to the page and depending on the value of that variable, to be sent (automatically) to another page(of course that page would be given a specific URL in the switch() routine.
thanks for your replys
Don't know if this helps or not, but you could try a more concise approach:
Code: Select all
$pages = array('page1.php', 'page2.php', 'page3.php');
if (in_array($_GETї'page'], $pages))
header('Location: '.$_GETї'page']);