PDA

View Full Version : Is it mandatory to save PHP code in .PHP extention?


certify
Mon 20th Aug '01, 2:51pm
Assuminng the below codes and I want to save it in .SHTML extention. will it still work?



<head>
<body>

<table>
<tr><td>
<font face="verdana" size="1">Test Page.....</font></td></tr>
</td></tr>

<tr><td>

<?php

chdir($DOCUMENT_ROOT . "/vb_folder");
require("./global.php");
chdir($DOCUMENT_ROOT . "/whateverthefoldernameis");

if ($bbuserinfo['userid']==0) {
echo"<center><font size=1 color=red style=verdana>You need to log in!</font>";
}
else
{
$username=$bbuserinfo['username'];
}

?>

</td></tr>
</table>

</body>
</html>

The Prohacker
Mon 20th Aug '01, 3:15pm
You have to tell apache to handle .shtml files with the php handler, you can add:
AddType application/x-httpd-php .pro
to an .htaccess file, or your httpd.conf, if you add it to your httpd.conf comment out the line that uses that extension for ssi...

certify
Mon 20th Aug '01, 3:22pm
Why .pro ?


AddType application/x-httpd-php .pro

Mark Hensler
Mon 20th Aug '01, 7:10pm
I think he did that as an example.... and his username is The Prohacker.

Use this:
AddType application/x-httpd-php .shtm .shtml

certify
Tue 21st Aug '01, 5:02am
Just to make sure. ;)