|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
How do I automatically open a new URL based on a condition being met ? i.e. what should the line 'open URL ... 'state?
Note - previous code includes html / text output; therefore header method doesn't work. This is for a password scheme. // previous code if a == b { open URL "http://www.url.com" ; }else{ echo "Incorrect choice"; } // additional code |
|
#2
|
|||
|
|||
|
this should do it
if ($a==$b) { echo "<meta http-equiv="refresh" content="0;url=http://www.whatever.com/">"; }else{ echo "Incorrect choice"; } hth ------------------ cheers |
|
#3
|
|||
|
|||
|
thanks timbo; but have a question;
why doesn't php see the 2 //'s in the url as a start of a comment? My editor (homesite) saw them as a start of a comment, i saw them as a comment, so i kept trying to them out and it didn't work. It did work your way. thanks again |
|
#4
|
|||
|
|||
|
For php to see them as a start of a comment they must be preceded by <? or ; with nothing but whitespace (spaces,n,t,etc) between.
|
|
#5
|
|||
|
|||
|
gotcha - thanks
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages > PHP Development > open new URL in if statement |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|