Results 1 to 3 of 3

Thread: php redirect

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 2001
    Location
    Ottawa, Canada
    Posts
    181

    php redirect

    i have a form...

    when the submit button is clicked it goes to another php file to process it and write to the db. after that is done, i want it to redirect to another page...how do i do that?
    how do i make it goto to another page?



    just a side question..not connected to the above

    is there a way of checking if there is a query string, like if (_POST[] == null) or something like that? cause i want to do something different if theres no query string.

    thanx a lot
    --770

  2. #2
    Lively Member Brandito's Avatar
    Join Date
    Nov 2000
    Location
    Here, There, Every Where!
    Posts
    106

    work'n it

    Here is an example of instantly recalling that php page:
    header("Location: ".$_SERVER['PHP_SELF']);

    you can replace that with your other php file if wanted:
    header("Location: next.php");
    Master of Cyber Fu - A Temple of Digital Chi

  3. #3
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Just remember that no output can be sent to the browser before the header() function is used.

    This includes html, echos, and, unless it's been changed, not even a blank line before your <?php tag.
    My evil laugh has a squeak in it.

    kristopherwilson.com

Posting Permissions

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



Click Here to Expand Forum to Full Width