html website - integrate php?

by nealh
9 replies
  • WEB DESIGN
  • |
I have a html website for my business which suits me fine.

I have just found a really nice php script for an enquiry form and would like to add it to my site on an exsiting html page.

Is this possible without turning it into php page as this would change the url from contact.html to contact.php and i dont want to do that.

So the main question is how to go about achieving this?
#html #integrate #php #website
  • Profile picture of the author webhosting
    It is possible to allow PHP code in the .html files using .htaccess. I have never done this so I do not know the code but it should be possible to find it in google easily.
    Signature
    {{ DiscussionBoard.errors[7274866].message }}
  • Profile picture of the author Niranpr
    If you don't want to change html file to php file then you put <form> tag into your contact.html file
    then you need to write php file to recieve data from contact.html and redirect to thankyou.html or page which you want.
    {{ DiscussionBoard.errors[7277853].message }}
  • Profile picture of the author Marcustlr
    Hello Nealh,

    Firstly create a contact.php page and paste your script which have you found. Upload it on server then use this code in .htaccess file

    "RewriteRule ^contact.html$ contact.php [L]"

    Thanks
    Marcus
    Signature
    {{ DiscussionBoard.errors[7277873].message }}
  • Profile picture of the author nealh
    thanks for the replies people.

    I shall try using the .htaccess file to allow me to write php in my html page as per the article posted by nesterdwarf. Thanks
    {{ DiscussionBoard.errors[7278973].message }}
    • Profile picture of the author Lloyd Buchinski
      Originally Posted by nealh View Post

      I shall try using the .htaccess file to allow me to write php in my html page as per the article posted by nesterdwarf.
      There's a good chance you will have problems. If not right now, then the next time php is updated. I tried this a couple of years ago. Altogether I got about 6 different versions of ways to do it with the .htaccess file. 3 from this forum, and 3 from my host.

      None of them worked on my site. Apparently they had worked on earlier versions of php.

      It's certainly worth trying. If it does work, let us know, but I'm losing my interest in doing it this way. Personally I'm just going to use redirects and change my remaining html pages over that way. It has the advantage that while I'm at it, I can reorganize with more folders.
      Signature

      Do something spectacular; be fulfilled. Then you can be your own hero. Prem Rawat

      The KimW WSO

      {{ DiscussionBoard.errors[7281412].message }}

Trending Topics