#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Posts
    10
    Rep Power
    0
    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. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 1999
    Location
    London
    Posts
    110
    Rep Power
    0
    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
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Posts
    10
    Rep Power
    0
    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
  6. #4
  7. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    19
    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.
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Posts
    10
    Rep Power
    0
    gotcha - thanks

Similar Threads

  1. Read an external URL with Javascript?
    By narainsbrain in forum JavaScript Development
    Replies: 4
    Last Post: May 27th, 2004, 10:23 AM
  2. Question about the WHERE statement
    By layz d in forum MS SQL Development
    Replies: 5
    Last Post: January 28th, 2004, 12:58 PM
  3. conversion: *.*.txt to *.*.xls or *.*mdb
    By Bigtallim in forum Visual Basic Programming
    Replies: 5
    Last Post: January 14th, 2004, 10:38 AM
  4. KOffice vs Open Office
    By Scratchy in forum Linux Help
    Replies: 1
    Last Post: January 3rd, 2004, 01:45 PM
  5. Creating forum. Need help with URL commands.
    By barcodegeek in forum PHP Development
    Replies: 10
    Last Post: December 17th, 2003, 09:44 PM

IMN logo majestic logo threadwatch logo seochat tools logo