www.webdeveloper.com
Results 1 to 3 of 3

Thread: php code in html page

  1. #1
    Join Date
    Jul 2003
    Location
    chennai
    Posts
    1

    php code in html page

    sir,
    i wote conter programme code it is working only .php programmes it won't work.html files it will work or not what can i do???
    my wesite add is www.tnmmu.ac.in
    here go to results when i enter rollno it is going to medical.php3 there that counter is working but i want to put
    it in index.html page

  2. #2
    Join Date
    Dec 2002
    Location
    High on life
    Posts
    10,104
    PHP generally only works on pages with a .php extention. This saves the server from having to run every page through the PHP parser. You'll have to rename you page with a .php extention or add a .htaccess file that looks something like this:

    AddType application/x-httpd-php .php .htm .html

    That will tell the server to use .htm and .html files as .php file...

    Personal website http://www.ryanbrill.com/
    Business website: http://www.infinitywebdesign.com/
    TypeSpace http://www.typespace.org/

    I reject your reality and substitute it with my own!

  3. #3
    Join Date
    May 2003
    Posts
    550
    htaccess only works on Apache servers. If your server is running apache, try Pyro's code. If that doesn't work, try this

    AddHandler application/x-httpd-php .php .htm .html

    On other servers, do whatever you need to set the file association of .htm and .html files to php.exe

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles