Not all files on a web server are parsed by PHP. Generally, you need to 
specifically tell the web server to use PHP to parse files based on their 
extension. 

I'm assuming you're using Apache as the web server here, so for IIS or 
iPlanet or whatever this may be different...

For Apache, open up the httpd.conf file and look for the AddType directive. 
Basically, you're going to want to add lines that look like this:

AddType application/x-httpd-php .php

Which tells Apache to use PHP on the files that have the extension .php. 
So, if you want files with the extension .html or .htm or whatever to parse 
your PHP code, add another line with the proper extension:

AddType application/x-httpd-php .html
AddType application/x-httpd-php .htm

etc.

Apache will need to be restarted after you save the .conf file.

IIS works similarly, but it has a fancy-schmancy dialog.

J


Cgi Guy wrote:

> I'm trying to test the following:
> 
> I have created a simple cookie script:
> 
> <?php
> if (!IsSet($session)) {
> $cookievalue = md5(uniqid(rand()));
> setcookie('session', $cookievalue, mktime
> (8,0,0,7,31,2001));
> } else {
> mail("[EMAIL PROTECTED]", "cookie", $session);
> }
> ?>
> 
> I have placed it in an html page, at the very top (no
> spaces, lines, etc.), and have left no lines/spaces
> between the '?>' and '<html>' tags. Yet the script
> does not execute (nor does it return an error of any
> kind). What gives?!?!
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to