Re: header

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

 




On Sep 15, 2008, at 7:19 AM, Jochem Maas wrote:

Jason Pruim schreef:
On Sep 15, 2008, at 7:05 AM, Alain Roger wrote:
thanks for info

On Mon, Sep 15, 2008 at 1:03 PM, Stut <stuttle@xxxxxxxxx> wrote:

On 15 Sep 2008, at 11:57, Alain R. wrote:

how in PHP can i create the similar header as following ?
<head>
<base href="www.mywebsite.com">
</head>


Assuming you mean with the header function, you can't. There is no HTTP
header equivalent of the base tag.

It would be possible though if your php page is displaying html or at least spitting out the html to be displayed somewhere to use HEREDOC. Something like this:
echo <<<HEAD
   <head>
   <base href="www.mywebsite.com">
   </head>
HEAD;
the only gotcha is that HEAD; as to be on it's own line AND at the start of the line to work.

and the newline has to come *directly* after the semi-colon, any additional white space makes the parser crap out (E_PARSE), something that's bitten me more times than I care to remember :-)

I always forget about that until I've been fighting with it for a few days :P

Worse thing is when I copy/paste from a different project because I had already written almost the exact same function that I needed... And my editor tries to "help" me :)


--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
11287 James St
Holland, MI 49424
www.raoset.com
japruim@xxxxxxxxxx





--
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