how to write php script in index.html

Paste the code in ur .htaccess file
AddType application/x-httpd-php .php .htm .html
Save and close the .htaccess file. Upload it to your webserver (to your WWW root).

Sample PHP code in a .html webpage

Now create a test file and filename it test.html

Copy the following html
into it:
php:

Upload it to your web server and view it using your browser. You will see that it works fine.

  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.