Re: [PHP] header



On 15 Sep 2008, at 12:10, Jason Pruim wrote:

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.

That's not an HTTP header. I had assumed minimal PHP knowledge on the part of the OP. If he doesn't even know how to output HTML he needs to start with a very very basic beginners tutorial.

-Stut

--
http://stut.net/
.



Relevant Pages

  • Re: Http code that precedes the html tags
    ... however when I try to put it before the <HTML> tag it does not work. ... I don't understand what format the http code takes. ... contains permittted HEAD elements ... The only thing permitted before the tag is the Doctype Declaration, which normally should be this one: ...
    (alt.html)
  • Re: Creating Java/DHTML Vertical Navigation Menu in FrontPage
    ... <html xmlns="http://www.w3.org/1999/xhtml"</a>; xml:lang="en"> ... //Specify whether at least one header should be ... .urbangreymenu .headerbar a{ ...
    (microsoft.public.frontpage.programming)
  • Re: linux socket programming and HTTP Protocol Problem
    ... http header and code looks like this: ... HTTP 1.1 assumes that you will use Persistent Connections by default. ... If you don't want to reuse the transport for the next HTTP request you must send a "Connection: close" header back to the client. ... wget likely works because it can get away with dumping bits to disk but a browser needs to read in enough HTML to render it in a performant way. ...
    (comp.unix.programmer)
  • Re: Make HTML code show up on the web
    ... It's the HTTP ... _usually_ makes the server send a header that tells that the resource is ... IE has been observed to ignore the HTTP header and treat data as ... Anyone who can possibly benefit from seeing HTML ...
    (alt.html)
  • Re: php redirect doesnt work
    ... header() from work, as it has to be sent before any other output from a script. ...
    (alt.php)