PHP include and require Statements


PHP include statement to your web page 

  • The include and require statements are used to insert php pages to your web page
  • Including files saves a lot of work and tme. 
you can create a standard header, footer, or menu file for all your web pages. Then, when the header needs to be updated, you can only update the header include file


Step 01    main page design

 <html>  
 <body>  
 <?php include 'header.php'; ?>  
 or  
 <?php require 'header.php'; ?>  
 </body>  
 </html>  


Step 02   header page design

 <html>  
 <head>  
 <style type="text/css">  
 .main {  
  height: 100;  
  width: 980px;  
 }  
 </style>  
 </head>  
 <body>  
 <div class="header_box">this is header</div>  
 </body>  
 </html>  


use the .php extension for all pages to save




PHP include and require Statements PHP include and require Statements Reviewed by Unknown on 1:40 PM Rating: 5

No comments:

Powered by Blogger.