4.1.1 Editing the PHP
Go to C:\Program Files\xampp\htdocs and open the '03Demo' folder.You will find out that the HTML file is now PHP. Let's open it with notepad++.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <!-- 1. Choose your page Title --> <title>Buy : My title book from my site</title> <!-- 2. Choose your page Description --> <meta name="description" content="My book title helps to ..."> <!-- 3. Choose your page Keywords --> <meta name="keywords" content="My book keywords"> <!-- 4. Choose your page charset. Find the allias code of your language from here : http://www.iana.org/assignments/character-sets Or from here : http://en.wikipedia.org/wiki/Character_encoding If you are not sure what this is leave it as is --> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <!-- 5. Choose your page Style --> <LINK href="css/BlueStyle.css" rel="stylesheet" type="text/css"> </head> <body> <?php // 6. Choose the page Content $_GET['content'] = MyBook; // 7. Choose the page Scheme include "includes/schemes/MainScheme.php" ?> </body> </html>The index.php from 03Demo
As you can see the page is even simpler from the HTML page. So this PHP page has seven important attributes to edit
- Title
- Description
- Keywords
- Charset
- Style (CSS)
- The content
- The scheme
The scheme attribute defines the page format and in order to modify it you need some basic HTML knowledge, but since the scheme proposed by this e-book is very generic (header, three columns and footer) it is recommended to leave it as is since this scheme will cover you.
The modification of the scheme will not be covered at this e-book since you need some program skills and we need to retouch the CSS file heavily and not just modify it's attributes.
Expert users of course can modify anything.
So the important new part of this PHP file is only the content attribute.
What does the content attribute ?
$_GET['content'] = MyBook;The content attribute
The content attribute just says where your page content is located. so 'MyBook' means that 'index.php' has it's content to
03Demo\includes\contents\MyBook.inc .
If you want to point an alternative inc (included) page then just change the 'MyBook' to 'MyCd' and then that page will include
03Demo\includes\contents\MyCd.inc
So now you should have learned how to edit a generic PHP page.