SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    Non-Member
    Join Date
    Aug 2010
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how to write php script in index.html?

    how to write php script in index.html

    Example: If we write <?php echo "Hello";?> in index.php the output is "Hello", if we write <?php echo "Hello";?> in index.html what will be the out put?

    and is it possible to execute the php script in extension of html (ie. index.html)


    Web Development Services

  2. #2
    SitePoint Evangelist elgumbo's Avatar
    Join Date
    Nov 2002
    Location
    North West, UK
    Posts
    545
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi, you can tell your server to treat a html file as a php file in the .htaccess file.

    Add this to your site's .htaccess file
    Code:
    AddType application/x-httpd-php .html .htm
    Try your echo statement again in the index.html file to check it's working.

    More info here: http://www.besthostratings.com/artic...tml-files.html


Tags for this Thread

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
  •