Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: enabling php in html files with .htaccess

  1. #11
    Join Date
    Jun 2006
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by BLiZZaRD View Post
    Not sure about local servers, but on my web servers I had to place it OUTside the root dir. One server it didn't work unless it was inside the root, the other it had to be outside.

    Worth a shot I guess..

    OHH.. one other thought... you said you downloaded the latest version of php... would that be php5? If so your ,htaccess needs to have php5 added to the lines.
    It is php5, so where in the line would you have php5?

    like this?
    AddType application/x-httpd-php5 .php .htm .html
    AddHandler application/x-httpd-php5 .html .php .htm

    I tried that, still doesn't parse the php code in the html page.

    I'm curious, when you said your .htaccess file would only work outside the root, was it then in the same dir as your pages?

  2. #12
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    no it was on level with root:

    htaccess file
    root folder --> folders -->html pages & subfolders

    Try adding this to it:

    Code:
    AddHandler php-script .php .php5 .php4 .php3 .html .htm .phtml
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

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
  •