+ Reply to Thread
Results 1 to 3 of 3

Thread: Apache File Format Handler

  1. #1
    NVarg91 is offline x10Hosting Member NVarg91 is an unknown quantity at this point
    Join Date
    Oct 2008
    Posts
    1

    Apache File Format Handler

    I need help having PHP executed within html files. This is because it will allow me to format the site a lot easier. On the cPanel X administration page, I can't seem to find the Apache Handler button. It's supposed to be under the advanced tab, but I don't see it. Any help would be appreciated. THANKS.

    e.g. code.

    <?php
    $br = strtolower($_SERVER['HTTP_USER_AGENT']); // what browser they use.

    if(ereg("msie", $br)) {
    echo "THIS IS IE";
    } else {
    echo "THIS IS FOR OTHER BROWSER NOT IE";
    }
    ?>

    BTW I have intermediate permissions. My friend has the same level of permission and he has that little icon.
    Last edited by NVarg91; 11-10-2008 at 07:54 PM.

  2. #2
    Scoochi2's Avatar
    Scoochi2 is offline x10 Sophmore Scoochi2 is an unknown quantity at this point
    Join Date
    Aug 2008
    Location
    Southport!
    Posts
    185

    Re: Apache File Format Handler

    Quote Originally Posted by NVarg91 View Post
    I need help having PHP executed within html files. This is because it will allow me to format the site a lot easier.
    So you want to parse PHP, but from a page with the .html extension?
    So your example code might be found in a file called mypage.html then?
    If so, read on

    In the directory you wish to have these PHP enabled files (or at the top www root directory), create a new file called .htaccess

    Yes, it does start with a dot! That is important. Call it .htaccess nothing more nothing less.

    Edit it, and put the following:
    Code:
    AddType application/x-httpd-php .html .htm
    Save it. All done
    Now when you run .html or .htm pages, any PHP inside will be run as PHP as if the file was a normal .php file.
    If anyone can see it, my post was meant for anyone who reads it. Don't take it personally or think I'm being condescending... :nuts:

  3. #3
    leafypiggy's Avatar
    leafypiggy is offline Community Advocate leafypiggy is on a distinguished road
    Join Date
    Aug 2007
    Location
    Massachusetts
    Posts
    2,228

    Re: Apache File Format Handler

    Code:
    AddType application/x-httpd-php .html .htm
    WRONG!

    on x10 its different:

    Code:
    AddType application/x-httpd-phpv# .html .htm
    where it says phpv#

    put either phpv1 phpv2 or phpv3 depending on your php level

    Basic = v1
    Intermediate = v2
    etc

    :D
    Neil Hanlon | x10Hosting Support Representative
    Neil[at]x10hosting.com
    █ I'm always happy to help. Just ask a question in Free Hosting
    Terms of Service IRC

+ Reply to Thread

Similar Threads

  1. It works! ...
    By bpakidz in forum Programming Help
    Replies: 4
    Last Post: 09-07-2008, 11:12 PM
  2. Internal Serve Error
    By xaakx in forum Free Hosting
    Replies: 6
    Last Post: 02-03-2008, 08:02 AM
  3. configuring php on localhost
    By ufclan in forum Scripts & 3rd Party Apps
    Replies: 15
    Last Post: 01-22-2008, 08:34 AM
  4. installing Apache in Localhost.
    By naim4u in forum Tutorials
    Replies: 5
    Last Post: 01-20-2008, 04:46 AM
  5. php version
    By loveispoison in forum Free Hosting
    Replies: 10
    Last Post: 11-21-2007, 10:53 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers