Script Garage

 

Do php scripts work on a .html page?

Well, I was wanting to know if php scripts will work on a site that is .html. My site is .html and I'm wanting to have some scripts for it. When I used freewebs about a year ago I used scripts made by freewebs for hitcounters, etc; and I know that all sites on freewebs have a .html extension (or maybe it is .htm). So, is it possible?

Public Comments

  1. PHP is a server-side scripting language. That means that PHP scripts run on the *Web server*. Therefore, you will need to check with whoever runs the Web server -- in this case, that would be Freewebs -- on whether they support PHP.
  2. php needs the php extension plus support for php on the web server you are using. The scripts like a hit counter were most likely CGI/perl scripts that wrote to a file on your web server to keep track of the count
  3. php script won't work in a file with .html / .html extension... you have to save the file containing php script with .php extension... (and upload it to a server supporting php / run it locally on your 'comp server' e.g. with xampp) you can try it yourself: <?php echo "hello world"; ?>
Powered by Yahoo! Answers