Re: header()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Niel Archer wrote:
> Hi Alf
>
>   
>> Is this the correct method to use in Windows?
>>     
>
> No, it's not the correct method on ANY platform.  Before asking a
> question on these lists, it's wise to check the documentation first.
>
>   
>> Note: HTTP/1.1 requires an absolute URI as argument to Location: including the scheme, hostname and absolute path, but some clients accept relative URIs.
>>     
I have copied the code almost verbatim out of the manual and it still
does not work.
/* Redirect to a different page in the current directory that was
requested */
    $host  = $_SERVER['HTTP_HOST'];
    $uri  = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
    $extra = 'index.shtml';
    $ReturnTo = sprintf("http://%s%s/%s";, $host, $uri, $extra);
    echo "<br>".$ReturnTo;
    header("Location: $ReturnTo");
    exit;

and when I cut and paste the line produced by the echo into the, can I
call it "go box", at the top of the screen and press enter it goes where
I want?

-- 
Regards,
Alf Stockton		www.stockton.co.za
 
Your sister swims out to meet troop ships.
My email disclaimer is available at www.stockton.co.za/disclaimer.html

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux