PHP Script installation, PHP and HTML

After the introduction, we will talk few about the php script installation and the php within html.

Were the php script must be ?

The php script can be a whole file, all the file is a php script, or it may be some part of the page, a small part of a html page.
Anywhere you put your php script, the rule you must follow is that the php script should be contained within the following <?php and ?> Just like that:
PHP Script go here ...
echo "Hello World ! ";
Or may be in a html file:

<title>My Page Title here</title>
echo "Hello World ! ";

The file ?

Any file that contain a php script should be with .php extention always. If you had your home page index.html, you need to rename it to index.php .

What if I have many pages linking to index.html ? Should I change the link in all pages ?
If there is really many pages that link to index.html, so use the html redirection, you will have two files index.php and index.html that redirect to index.php ! There is always a solution !

What if I don't like the .php extention, I feel that .html is much pretty ?
here is no problem, we can use the rewriting in the apache server, we will se that later :)


Super Bowl Commercials 2012 said...

Excellent pieces. Keep posting such kind of information on your blog. I really impressed by your blog.

kokila zenrays said...

Thanks for sharing this information. Good blog post about PHP, HTML. Really useful informative article. Best PHP training in Bangalore