GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 09-Feb-2004, 18:50
demtro demtro is offline
Awaiting Email Confirmation
 
Join Date: Feb 2003
Location: Florida
Posts: 28
demtro is on a distinguished road

Need help adding a footer


Hi List, please forgive this newbie question but I am new to web development with PHP. heck i am new to web development with html. anyway i got seme help here and was hoping i could get some more pasted below are the last few lines of my webpage and I need to know what i need to do to insert a footer. if anybody can help i would appreciat eit.

HTML Code:
?> </td> </tr> </table> <p>&nbsp;</p> </div> </body> </html>

thanks
Last edited by dsmith : 09-Feb-2004 at 21:50. Reason: Added html syntax highlighting
  #2  
Old 10-Feb-2004, 08:03
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough

How to include a file with PHP


Demtro, you just need to create another html/inc/php file, then add a single line in your existing page to have it include the HTML bit of the include files.

Here's a simple example; let's say you want this bit of HTML or php code to be your footer, copy and paste the code into a file (you can name it anything), let's assume it's saved as inc_footer.php

PHP Code:

<?php

// FILENAME: INC_FOOTER.PHP

?>
<p>Something in the footer.</p>
<p>Guess what? You can also include php code; here's a test:<br />
What's my OPERATING SYSTEM? Answer - <?php echo PHP_OS; ?></p>

Now... to include this 'page' in your homepage or any other web page in your WWW root folder, you just include it using the include_once() or require_once();

Taking your example above:

PHP Code:

</td>
    </tr>
  </table>
  <!-- FOOTER -->
  <?php include_once( './inc_footer.php' ); ?>
  <!-- END FOOTER -->
</div>
</body>
</html> 


FYI, incl_footer.php could have also been named inc_footer.inc, inc_footer.txt or even simply inc_footer.html. However, if you have the include file saved in your WWW root folder, it's wise to save it with the .php extension.
  #3  
Old 10-Feb-2004, 19:48
demtro demtro is offline
Awaiting Email Confirmation
 
Join Date: Feb 2003
Location: Florida
Posts: 28
demtro is on a distinguished road
Thank you very much I appreciate the help.



Quote:
Originally Posted by JdS
Demtro, you just need to create another html/inc/php file, then add a single line in your existing page to have it include the HTML bit of the include files.

Here's a simple example; let's say you want this bit of HTML or php code to be your footer, copy and paste the code into a file (you can name it anything), let's assume it's saved as inc_footer.php

PHP Code:

<?php

// FILENAME: INC_FOOTER.PHP

?>
<p>Something in the footer.</p>
<p>Guess what? You can also include php code; here's a test:<br />
What's my OPERATING SYSTEM? Answer - <?php echo PHP_OS; ?></p>

Now... to include this 'page' in your homepage or any other web page in your WWW root folder, you just include it using the include_once() or require_once();

Taking your example above:

PHP Code:

</td>
    </tr>
  </table>
  <!-- FOOTER -->
  <?php include_once( './inc_footer.php' ); ?>
  <!-- END FOOTER -->
</div>
</body>
</html> 


FYI, incl_footer.php could have also been named inc_footer.inc, inc_footer.txt or even simply inc_footer.html. However, if you have the include file saved in your WWW root folder, it's wise to save it with the .php extension.
 
 

Recent GIDBlogVista ?Widgets? on Windows XP by LocalTech

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding another section to the site BobbyDouglas Learning Journal by J de Silva 4 08-Nov-2003 12:55
Customised title for adding to favourites jrobbio Web Design Forum 0 16-May-2003 10:23
Trouble adding RAM JBrewMan1 Computer Hardware Forum 13 29-Apr-2003 20:32
Adding RAM Guest Computer Hardware Forum 2 23-Jun-2002 16:32

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 20:28.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.