Results 1 to 6 of 6

Thread: [RESOLVED] Header

  1. #1

    Thread Starter
    Frenzied Member I_Love_My_Vans's Avatar
    Join Date
    Jan 2005
    Location
    In the PHP compiler
    Posts
    1,275

    Resolved [RESOLVED] Header

    Hello all

    php Code:
    1. header("location: index.php");

    Thats the code im using, its coming from my login.php page.

    However when i moves accross to the new php script, the url stays the same, how do i get it to change the url name aswell.

    ILMV2

  2. #2

    Thread Starter
    Frenzied Member I_Love_My_Vans's Avatar
    Join Date
    Jan 2005
    Location
    In the PHP compiler
    Posts
    1,275

    Re: Header

    Not to worry, forgot the exit; after it.

    How do i rep myself?

  3. #3
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: [RESOLVED] Header

    The Location header must be an absolute URI. For example:

    PHP Code:
    <?php header("Location: http://{$_SERVER['HTTP_HOST']}/index.php"); ?>

  4. #4

    Thread Starter
    Frenzied Member I_Love_My_Vans's Avatar
    Join Date
    Jan 2005
    Location
    In the PHP compiler
    Posts
    1,275

    Re: [RESOLVED] Header

    If its within the same directory you can still use the good old ./index.php

    After putting exit; it prevented any more code from the ./login.php page and therefore took the url name of the new page.

  5. #5
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: [RESOLVED] Header

    Yes, you can do it, but you're not supposed to:
    http://www.w3.org/Protocols/rfc2616/....html#sec14.30

  6. #6

    Thread Starter
    Frenzied Member I_Love_My_Vans's Avatar
    Join Date
    Jan 2005
    Location
    In the PHP compiler
    Posts
    1,275

    Re: [RESOLVED] Header

    Ill bear that in mind, thanks dude

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