SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Feb 2013
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Seach Field Inside A .html File.

    I'm trying to make a php search engine on my web side, but the search field will be place at the header on every page on my website and not just in one single serach.php page.


    So at my index.html i will start with code with:

    <?php
    //my code
    ?>


    Now my question is, will the php script work if i still save the file as index.html? or do i need to change it to index.php to allow the php script to work. If so, does it mean that i have to save my entire website as php, since the search field will paced at the header trought all the pages. If thats the case, is it any way to embed or run a php script and still call the file .html?

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,109
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    Hi darkloshean. Welcome to the forums.

    Though the ideal is to have pages with a .php extension, you can set your server to accept PHP on .html pages. E.g.

    http://php.about.com/od/advancedphp/p/html_php.htm

    The common way to set this up is via a .htaccess file.
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  3. #3
    SitePoint Member
    Join Date
    Feb 2013
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok i'll try that way. thank you, appreciate it


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
  •