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
PHP Script go here ...
?>
PHP Script go here ...
?>
<?php
echo "Hello World ! ";
?>
echo "Hello World ! ";
?>
<html>
<head>
<title>My Page Title here</title>
</head>
<body>
<?php
echo "Hello World ! ";
?>
</body>
</html>
<head>
<title>My Page Title here</title>
</head>
<body>
<?php
echo "Hello World ! ";
?>
</body>
</html>
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 :)