SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Addict certify's Avatar
    Join Date
    May 2001
    Location
    Malaysia
    Posts
    216
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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>
    Your WebHosting Partner - RouterWebHost.com
    eXam SIMulation Software - ExamSim.net
    geeks forums -ProgrammingTutor.com
    BMWClub of Malaysia - BMWClub.com.my
    unofficial MU Fan Club coming soon - ManchesterUnited.com.my


  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not unless you specify that in a .htaccess fiel or in your server config file assuming your are using Apache. Also I am not sure as to whether your server config will have a conflict of interest so to speak, because if your server is set up to parse .shtml files as SSI, then I think it might have a problem with trying to parse it as PHP at the same time.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  3. #3
    SitePoint Addict certify's Avatar
    Join Date
    May 2001
    Location
    Malaysia
    Posts
    216
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes I'm using Apache.

    OS is RedHat 7.1

    If I can get this work then I don't have to convert all my files into .PHP
    Your WebHosting Partner - RouterWebHost.com
    eXam SIMulation Software - ExamSim.net
    geeks forums -ProgrammingTutor.com
    BMWClub of Malaysia - BMWClub.com.my
    unofficial MU Fan Club coming soon - ManchesterUnited.com.my


  4. #4
    You talkin to me? Anarchos's Avatar
    Join Date
    Oct 2000
    Location
    Austin, TX
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Add AddType application/x-httpd-php .html to your httpd.conf
    ck :: bringing chris to the masses.

  5. #5
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anarchos, he wants to use .shtml extensions not .html, do you think Apache will complain if he has .shtml already set to parse as SSI?
    Please don't PM me with questions.
    Use the forums, that is what they are here for.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •