Find the answer to your Linux question:
Results 1 to 3 of 3
is there a function in PHP that passes you/takes you to another page? there's redirect but maybe PHP has something better than this. what if the browser doesn't support redirection? ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux User
    Join Date
    Aug 2003
    Posts
    289

    redirect


    is there a function in PHP that passes you/takes you to another page? there's redirect but maybe PHP has something better than this. what if the browser doesn't support redirection? -- which is rather higly unlikely in today's modern browsers, but it still helps to be sure.. .
    Registered User #345074

  2. #2
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    The canonical way to do it is like this:
    Code:
    header&#40;"Location&#58; <an URL>"&#41;;
    That will insert the Location header into the response and change the response code to 302, which all browsers are required to implement by the HTTP compatibility guidelines, even since HTTP/1.0. Note that the URL must be absolute.

  3. #3
    Linux User
    Join Date
    Aug 2003
    Posts
    289
    whoa, that was fast! thanks dolda, i'll try this out.. .
    Registered User #345074

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •