Re: tutorial failure

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

 



On Thu, 2010-08-26 at 17:45 +0100, e-letter wrote:

> On 20/08/2010, Ashley Sheridan <ash@xxxxxxxxxxxxxxxxxxxx> wrote:
> > You don't have to reinstall the entire OS, that's a very Windows
> > approach to the problem. I played around a bit last night with urpmi and
> > you should be able to just list the packages you need with urpmq --fuzzy
> > package_name, and then install the ones listed you think you need. I did
> > notice that urpmi doesn't install the DB when you install the Apache mod
> > for that DB, so you might need to install that separately, but other
> > than that, you should be good to go if you install the Apache php mod.
> >
> >
> True with respect to the windoze mentality but I had other reasons to
> reformat the pc so this was a good opportunity.
> 
> The resultant web page is:
> 
> Hi, I am a PHP script
> 
> this is a test
> 
> However, the manual page implies to me that the web page should have
> shown the html code, i.e.
> 
> <html>
>      <head>
>              <title>php test
>              </title
>      </head>
>      <body>
>              <p>Hi, I am a PHP script</p>
>              <p>this is a test</p>
>      </body>
> </html>
> 
> The source code of the web page:
> 
> <html>
>      <head>
>              <title>php test
>              </title
>      </head>
>      <body>
>              <p>Hi, I am a PHP script</p><p>
>              this is a test
>              </p>
>      </body>
> </html>
> 
> Is this an error with the explanation of the manual or is the
> apache-php configuration still at fault?
> 


The manual page says that the output is the HTML code, which is exactly
what you're getting. Your browser is responsible for interpreting those
tags, based on the mime header that it receives from PHP (which is
text/html by default) You should only ever need to change this header
when you are outputting some other type of content, like XML, an image,
etc.

If you change your PHP script and add this line before you output any
content you will see the tags as your browser will interpret them as
plain text (Internet Explorer may screw this up, as it tends to ignore
header mime types more often than not):

header("Content-type: text/plain");

Thanks,
Ash
http://www.ashleysheridan.co.uk



[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