#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    1
    Rep Power
    0
    Hi,

    I am a php newbie and I have a quite lame question: I am building my site ( http://thewearables.dynip.com ) and I would
    like to include some php code in the index.html main page, but the php engine does not process it. It should be something in a configuration file. My box runs Suse Linux with Apache + php4
    Thanks a lot
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Posts
    7
    Rep Power
    0
    You could add this line to your httpd.conf

    AddType application/x-httpd-php3 .html

    The only problem here is that it will add a slight overhead to all your .html files (they will all be processed as PHP files) but then again this means that you can always embed php script into any .html file.

    ------------------
  4. #3
  5. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Location
    thane
    Posts
    50
    Rep Power
    0
    i think u need to tell ur webserver (apache in ur case) that
    DirectoryIndex index.htm index.html index.php3 index.phtml index.php

    this allows ur webserver to search for index.htm/html if not found then give index.php3 file as default file to client browser

    ranjeet
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Posts
    38
    Rep Power
    15
    if the page has PHP code in it, it needs to have the .php3 extension on it. otherwise, i don't think that the server will parse it.
    you could do a simple redirect in the index.html if you wanted to a index.php3.
    that might be what you want..
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Posts
    7
    Rep Power
    0
    Sorry, that might be

    AddType application/x-httpd-php4 .html

    (4 instead of 3 at the end) if you are using php4!
  10. #6
  11. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    >>f the page has PHP code in it, it needs to have the .php3 extension on it.
    Not really.

    You can even have both:
    AddType application/x-httpd-php3 .php3 .htm .html
    AddType application/x-httpd-php .php .php4 .html .htm

    trollhunter, if most of your html documents are php and its extension is html, you should also give it a higher priority by putting it first..
    DirectoryIndex index.html index.htm index.php index.php4

    Putting this DirectoryIndex in .htaccess file in particular directory will override server httpd.conf file.

Similar Threads

  1. Replies: 3
    Last Post: February 17th, 2004, 10:08 AM
  2. How to write a PHP script to remove a file?
    By xmxpcom in forum PHP Development
    Replies: 2
    Last Post: February 16th, 2004, 05:58 PM
  3. Pointer problem in opening a file
    By LAKI in forum C Programming
    Replies: 13
    Last Post: February 11th, 2004, 08:27 AM
  4. PHP file upload script trouble
    By casbboy in forum PHP Development
    Replies: 9
    Last Post: February 5th, 2004, 07:42 PM
  5. Simple find and replace word search for a text file with php?
    By rabid lemming in forum PHP Development
    Replies: 4
    Last Post: February 1st, 2004, 09:37 PM

IMN logo majestic logo threadwatch logo seochat tools logo