RE: [PHP] Redirect to a new page?
if the browser doesn't support Javascript use this : if (YES) { header(Location: thispage.php); } else { header(Location: thatpage.php); } exit(); Just make sure you haven't send any output to the browser yet. A suggestion: place this code before you ever print in your code. I know you could do it :) Thanks, Miches:) -Original Message- From: Beauford.2002 [mailto:[EMAIL PROTECTED] Sent: Thursday, March 13, 2003 10:44 AM To: PHP General Subject: [PHP] Redirect to a new page? Hi, I have searched around for hours on this and nothing seems to work. I want simply to do this if yes - goto thispage.php if no - goto thatpage.php Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Redirect to a new page?
Hi, I have searched around for hours on this and nothing seems to work. I want simply to do this if yes - goto thispage.php if no - goto thatpage.php Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Redirect to a new page?
you can use javascript instead.. for example in a jump menu: function seleccionPerfil(form) { if (form.perfil.selectedIndex == 0) { window.location.href=yourpage1.php; } if (form.perfil.selectedIndex == 1) { window.location.href=yourpage2.php; } if (form.perfil.selectedIndex == 2) { window.location.href=yourpage3.php; } } On Thu, 13 Mar 2003, Beauford.2002 wrote: Hi, I have searched around for hours on this and nothing seems to work. I want simply to do this if yes - goto thispage.php if no - goto thatpage.php Thanks -- David Elías Sánchez Vásquez Bachiller en Educación PUCP [EMAIL PROTECTED] telf. (51)-1-5255601 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Redirect to a new page?
btw in your case would be just if/else cheers David. On Thu, 13 Mar 2003, David E.S.V. wrote: you can use javascript instead.. for example in a jump menu: function seleccionPerfil(form) { if (form.perfil.selectedIndex == 0) { window.location.href=yourpage1.php; } if (form.perfil.selectedIndex == 1) { window.location.href=yourpage2.php; } if (form.perfil.selectedIndex == 2) { window.location.href=yourpage3.php; } } On Thu, 13 Mar 2003, Beauford.2002 wrote: Hi, I have searched around for hours on this and nothing seems to work. I want simply to do this if yes - goto thispage.php if no - goto thatpage.php Thanks -- David Elías Sánchez Vásquez Bachiller en Educación PUCP [EMAIL PROTECTED] telf. (51)-1-5255601 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Redirect to a new page?
if(something){ header(Location: {$_SERVER['HTTP_HOST']}/thispage.php); }else{ header(Location: {$_SERVER['HTTP_HOST']}/thatpage.php); } Beauford.2002 wrote: Hi, I have searched around for hours on this and nothing seems to work. I want simply to do this if yes - goto thispage.php if no - goto thatpage.php Thanks -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Redirect to a new page?
Figured it out echo Script Lang=javascript; echo window.location.href = 'viewpostats.php'; echo /script; - Original Message - From: Leif K-Brooks [EMAIL PROTECTED] To: Beauford.2002 [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, March 13, 2003 2:20 PM Subject: Re: [PHP] Redirect to a new page? if(something){ header(Location: {$_SERVER['HTTP_HOST']}/thispage.php); }else{ header(Location: {$_SERVER['HTTP_HOST']}/thatpage.php); } Beauford.2002 wrote: Hi, I have searched around for hours on this and nothing seems to work. I want simply to do this if yes - goto thispage.php if no - goto thatpage.php Thanks -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php