Announcement

Collapse
No announcement yet.

Is it mandatory to save PHP code in .PHP extention?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is it mandatory to save PHP code in .PHP extention?

    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>
    <sig removed because it violated the forum rules. Two requests were sent but ignored>

  • #2
    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...

    Comment


    • #3
      Why .pro ?

      AddType application/x-httpd-php .pro
      <sig removed because it violated the forum rules. Two requests were sent but ignored>

      Comment


      • #4
        I think he did that as an example.... and his username is The Prohacker.

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

        Comment


        • #5
          Just to make sure.
          <sig removed because it violated the forum rules. Two requests were sent but ignored>

          Comment

          widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
          Working...
          X