The forums have permanently moved to forum.kirupa.com. This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.


Results 1 to 4 of 4

Thread: PHP redirect

Hybrid View

  1. #1

    PHP redirect

    How can I conditionally redirect the page with PHP?

    Like...

    If($redirect)
    //do redirect
    else
    //no redirect

    Thanks if you help.

  2. #2
    PHP Code:
    header("location:site.com"); 
    make sure whatever forwarding you're doing is being done at the very begining of the page, other wise it wouldn't work

  3. #3
    what if I have this as the first line in my PHP script:

    <?php session_start(); ?>

  4. #4
    hm.. good question, cause both send header information.. try having
    PHP Code:
    <?php 
    session_start
    (); 
    if ( 
    condition header("location:site.com");
    ?>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012