PHP in HTML

Discussion in 'HTML & Website Design' started by Sparky1, Jan 1, 2007.

Thread Status:
Not open for further replies.
  1. #1
    Ok I am waaaaaaaaaaaaaaaaaa over my head here but hey that is life.

    I am trying to insert a PHP element into my HTML web page and so far I have had little success.

    I want to add a RSS reader to my site using PHP code and the vendor is suggesting the following

    The want me to modify the htaccess. file with one of the following, which I have no problem with but it doesn't seem to work.

    PHP scripts do not automatically work on html pages. If you have an HTML or (.HTM) based site, in order for PHP scripts to run on your .htm or .html pages you have a 2 options;

    1. For Apache Servers Edit your .htacess with AddType application/x-httpd-php .htm .html Then Add the php code from the reader directly to your html pages

    2. For Apache Servers Edit your .htacess with either .htm server parsed .html server parsed or
    Addhandler application/x-httpd-php .html .php Then follow the directions below to use the php code from the reader with SSI Includes.


    Now I tried each but the PHP element does not show.

    Thanks in advance

    Cheers,
    Sparky
     
    Sparky1, Jan 1, 2007 IP
  2. David26

    David26 Well-Known Member

    Messages:
    1,304
    Likes Received:
    47
    Best Answers:
    0
    Trophy Points:
    140
    #2
    David26, Jan 1, 2007 IP
  3. DatR

    DatR Peon

    Messages:
    210
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #3
    it could also depend on your server if that will work... on my hosting that I resell and use to host my sites, this works for parsing html as php:

    AddHandler x-httpd-php .html

    But, it only works when you upgrade your account to Hosting Configuration 2.0. if you have 1.0 then it wont work no matter what you put in. So check with your hosting if they actually allow you to do this and that they do not block it.
     
    DatR, Jan 1, 2007 IP
  4. vitaminp

    vitaminp Peon

    Messages:
    202
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    if its not too much trouble, you could just change the .html file to a .php file - depending on the size and automation of your site this could be possible.
     
    vitaminp, Jan 1, 2007 IP
Thread Status:
Not open for further replies.