GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Please phpelp... multiple includes.. (https://gfy.com/showthread.php?t=643612)

spacedog 08-12-2006 07:13 AM

Please phpelp... multiple includes..
 
I am trying to put this thing together,, It's in all pieces.

Code:

<?php
        include '_config/config.php';
        header('location:'.$sDefaultCountry.'/index.php');
?>

That's the existing code I have in place on one page to call up script & php generated pages.. now, I also have several other pages from other scripts.. I need to tie them all together navigation wise & created a header.htm that I want at the top of all pages & the footer at bottom of all pages..

What do I need to do so that header.htm is first, then the above, then the footer??


header.htm footer.inc.php

Damian_Maxcash 08-12-2006 07:21 AM

I have just got up - and its going to take at least 2 coffees for me to just work out what the question is .... maybe later if nobody else had done it.

spacedog 08-12-2006 07:24 AM

Better yet, if I rename index.php to body.php, then is there a way I can include the 3 parts ie include header.htm & body.php & footer.inc.php & name this page index.php & when visited it displays 1st header, then body.php & last footer?

u-Bob 08-12-2006 07:26 AM

First sending (including) an html file and then including the code you pasted (code that sends a "header('Location..."), won't work.

u-Bob 08-12-2006 07:29 AM

Quote:

Originally Posted by spacedog
Better yet, if I rename index.php to body.php, then is there a way I can include the 3 parts ie include header.htm & body.php & footer.inc.php & name this page index.php & when visited it displays 1st header, then body.php & last footer?

Code:

<?php
include('header.htm');
include('body.php');
include('footer.inc.php');
?>

btw: your header.htm is probably static html so you can gain some speed by using:

Code:

<?php
readfile('header.htm');
include('body.php');
include('footer.inc.php');
?>


spacedog 08-12-2006 07:29 AM

Quote:

Originally Posted by u-Bob
First sending (including) an html file and then including the code you pasted (code that sends a "header('Location..."), won't work.

what if I rename header.htm to top.htm, or top.php?

spacedog 08-12-2006 07:30 AM

Quote:

Originally Posted by u-Bob
Code:

<?php
include('header.htm');
include('body.php');
include('footer.inc.php');
?>


I'm trying this,,, thanks..

u-Bob 08-12-2006 07:34 AM

Quote:

Originally Posted by spacedog
what if I rename header.htm to top.htm, or top.php?

file name doesn't matter... PHP can't send HTTP headers followed by html followed by more HTTP headers...

spacedog 08-12-2006 07:36 AM

I tried your code & page shows header & footer, but won't display body?

This also does work for the other pages I want to use this on, but not this one specific page that has the code I have in initial post?

u-Bob 08-12-2006 07:40 AM

contents of body.php?


All times are GMT -7. The time now is 01:36 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123