Re: Quite a basic question

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

 



MÃrio Gamito wrote:

> Hi,
> 
> This is quite a very basic question, but i think the code following my
> signature should work.
> Instead, i get a
> "Warning: Cannot modify header information - headers already sent by
> (output started at /home/vhosts/dte/cv/register_action.php:10) in
> /home/vhosts/dte/cv/register_action.php on line 12"
> 
> and no redirection :(
> 
> How can i solve this ?
> Any help would be apreciated.
> 
> Warm Regards,
> MÃrio Gamito
> 
> <?php
> 
>    $hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);
>    $sub_domain = explode (".", $hostname);
>    if ($sub_domain[1] != 'dte') {
>      echo"
>      <script language=\"JavaScript\">
> window.open (\"http://www.google.com\";, \"mywindow\", \"status=1,
> toolbar=0, resizable=0,
> width=200, height=200\");
>      </script>";
>     }
>     header("Location: http://www.dte.ua.pt/cv/";);

the answer is in the question. You cannot send the header() function, as you
have already output some text to the browser.

Move the header() call above the echo call, and it should work.


btw: you should have at least "<html><head></head><body></body></html>" for
any HTML document.

-- 
kae verens
http://verens.com/

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux