Re: PHP-Yes, HTML-No --- Why?



Lennart Björk wrote:
Barry,

 > test.html just gets printed out right?

To a certain extent, yes. It looks like

 >>>
'; echo("
Host: $host"); echo("
Server: $server"); ?>
<<<

I am still confused.


ok the way php works is that if the web server has to serve a file with a .php extension, it recognises it as a PHP file and it sends it through the PHP parser and then it serves you the resulting html.

the .html file just gets served as is.

because .php went though the parser, you get the parsed php results
because .html just got served, you got the php code as is

it is possible to set up the server to send .html files through
the parser aswell, but as a norm this is not done.

Regards,
Barry

Lennart Björk
.



Relevant Pages

  • Re: PHP Instalation problems. Browser doesnt know what to do
    ... This is loaded and run as a local server (for class ... PHP 5.2.0 from php-5.2.0-win32-installer.msi ... # configuration directives that give the server its instructions. ...
    (comp.lang.php)
  • Re: PHP Instalation problems. Browser doesnt know what to do
    ... This is loaded and run as a local server (for class ... PHP 5.2.0 from php-5.2.0-win32-installer.msi ... # configuration directives that give the server its instructions. ...
    (comp.lang.php)
  • Re: write with cURL
    ... execute permissions. ... This is assuming that the PHP script runs ... of potential security risks from other users on the same server. ... Apache as the global web server user and thus needs world write ...
    (alt.php)
  • Re: Down or Upload Problem
    ... I would be happy if I had the picture on my FTP after I called my Site. ... echo "Cannot write to file "; ... You (web server), don't have the right to create and write to the ... location where the PHP script is run. ...
    (alt.php)
  • mysqli error?
    ... I'm just setting up my php enviroment and I typed in a simple script ... # configuration directives that give the server its instructions. ...
    (comp.lang.php)

Quantcast