Saturday 9 July 2011

PHP Master page concept

There is no such thing in php; however, there are 2 functions you can use to simulate that.

include() and require().

Include will continue processing the page even if the file isn't there or readable; while require will fail if the file isn't there or readable.

So an example of this would be:

template.php

PHP Code:
<!DOCTYPE html>
<html>
    <head>
        <title><?php echo $title?></title>
    </head>
    <body>
        <?php echo $content?>     </body>
</html>
contentX.php
PHP Code:
<?php

$title 
'Something';
$content = <<HTML
    
<h1>Title</h1>
    <
h2>Sub Title</h2>
    <
p>Some static text</pHTML;

require(
'template.php');

Thursday 30 June 2011

How to install joomla

  1. Download joomla and extract and rename the extracted folder to joomla
  2. copy joomla folder to C:\xampp\htdocs\ folder
  3. open browser and type http://localhost:90/joomla
  4. it will bring the wizard to install joomla

Monday 27 June 2011

Install and Configure Xampp

  1. Open the file C:\xampp\apache\conf\httpd.conf and change the line: Listen 80 to Listen 78
  2. Restart PC
  3. To check it is working, open a browser and type http://localhost:78 in the address bar and press enter.
  4. It will open xampp web page physically C:\xampp\htdocs\xampp\index.php file
  5. All web site projects are saved into C:\xampp\htdocs\ directory or you create a directory here to access by web browser
  6. FileZilla is used to upload website into internet