Jump to content


Photo

Go To Page Function??


  • Please log in to reply
3 replies to this topic

#1 cohlson2002

cohlson2002
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 29 March 2006 - 06:10 AM

Is there a php function to go to a page under a certain condition?
For example, someone is on page1, they click on a link which takes them to page2, which, if certain conditions are met, thay would automatically be forwarded to page3 (they really wouldn't even see page2, it would just be a processing page).
Is there a "automatic go to page" function?

Thanks

#2 Honoré

Honoré
  • Members
  • PipPipPip
  • Advanced Member
  • 66 posts
  • LocationAntwerp - Belgium

Posted 29 March 2006 - 06:35 AM

[!--quoteo(post=359558:date=Mar 29 2006, 08:10 AM:name=cohlson2002)--][div class=\'quotetop\']QUOTE(cohlson2002 @ Mar 29 2006, 08:10 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
For example, someone is on page1, they click on a link which takes them to page2, which, if certain conditions are met, thay would automatically be forwarded to page3 (they really wouldn't even see page2, it would just be a processing page).
[/quote]
One possible example:
if(mycondition == true) {
include('page3.php');
} else {
include('page2.php');
}

#3 cohlson2002

cohlson2002
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 29 March 2006 - 01:38 PM

[!--quoteo(post=359562:date=Mar 29 2006, 01:35 AM:name=Honoré)--][div class=\'quotetop\']QUOTE(Honoré @ Mar 29 2006, 01:35 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
One possible example:
if(mycondition == true) {
include('page3.php');
} else {
include('page2.php');
}
[/quote]


I tried that, I need to pass a variable to the page I want to go to. When I use an include it will display the page, but without the variable.

Any other suggestions

#4 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 29 March 2006 - 01:52 PM

Use the [a href=\"http://php.net/header\" target=\"_blank\"]header[/a]() function to do a redirect.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users