Re: Re: header

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

 



Robert Cummings wrote:
On Tue, 2008-09-16 at 17:49 +0100, Nathan Rixham wrote:
tedd wrote:
At 3:16 PM +0100 9/16/08, Nathan Rixham wrote:
Alain R. wrote:
Hi,

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

thx.

A.
just incase everybody else went down a complete tangent on this one

<head>
<base href="<?php echo $_SERVER['HTTP_HOST']; ?>">
</head>

it's not nice, elegant, the *proper* way to do things but it'll do the job if I understand you correctly

I don't see anything wrong with it. It looks nice, elegant and proper to me.

Cheers,

tedd
thanks tedd, to be full proof though there's a lot lacking; for example http/1.0 browsers don't pass through HTTP_HOST seeing as it's only in http/1.1; also even on http/1.1 it's sometimes spoofed; further there's the whole HTTPS_HOST to concider; there's only one full proof method and thats to simple hard code or define it:

I think you mean "fool proof" when you say "full proof". It's synonymous
with "idiot proof".

Cheers,
Rob.

indeed; I also meant "consider" && "simply";

I also meant:
define('PUBLIC_BASE_HREF' , 'http://php.net/')
<head>
<base href="<?php echo PUBLIC_BASE_HREF; ?>" />
</head>

and further thinking there has to be an easier / cleaner way of getting "http://"; / "https://"; in php..

ps: please excuse the typo's etc.

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