Welcome to Dream.In.Code
Getting PHP Help is Easy!

Join 136,008 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 2,350 people online right now. Registration is fast and FREE... Join Now!




Integrating Pages

 
Reply to this topicStart new topic

Integrating Pages

Dilerious
21 Mar, 2008 - 05:33 AM
Post #1

D.I.C Regular
Group Icon

Joined: 30 Dec, 2005
Posts: 264


Dream Kudos: 365
My Contributions
I integrated my forum into one of my pages [somewhat like this website]

And when I clicked on one of the forum topics it removed what was outside of the forum.
For example, it would have a header, and then the forum itself, but when I clicked on a part of the forum the header was removed.

Is there anyway I can keep the header at the top of the page while browsing the forums?

My Site
[still working on the skin and layout and what not but you get the idea]

Here is the code that I used to integrate it

CODE
    
<?php
    include('index.php');
?>

User is offlineProfile CardPM
+Quote Post

Nykc
RE: Integrating Pages
21 Mar, 2008 - 05:39 AM
Post #2

sudo rm -R /
Group Icon

Joined: 14 Sep, 2007
Posts: 4,121



Thanked: 16 times
Dream Kudos: 275
My Contributions
If you are going to start using PHP includes, you should seperate the header and footer and you can also do
php
<?php include('header.php') ?>

etc..

This should fix the problem, my blog is structured in a similiar fashion. It has a header, sidebar, main, footer, and navigation....

This post has been edited by Nykc: 21 Mar, 2008 - 05:40 AM
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: Integrating Pages
21 Mar, 2008 - 05:47 AM
Post #3

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 8,983



Thanked: 125 times
Dream Kudos: 8525
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
In stead of having your include file like you have it now (in the start of your PHP code


php

1. <?php include('header.php') ?>


Do it outside your PHP code . Do your PHP code, then you have your HTML, <HEAD></HEAD> then <BODY>, inside your body tag add your include


php

<? php include("filename.php") ?>


User is offlineProfile CardPM
+Quote Post

Dilerious
RE: Integrating Pages
21 Mar, 2008 - 05:49 AM
Post #4

D.I.C Regular
Group Icon

Joined: 30 Dec, 2005
Posts: 264


Dream Kudos: 365
My Contributions
Yeah thanks guy's, it's all working like I want it to now =D
User is offlineProfile CardPM
+Quote Post

hexeliebe
RE: Integrating Pages
22 Mar, 2008 - 08:36 PM
Post #5

New D.I.C Head
*

Joined: 22 Mar, 2008
Posts: 9

I would also suggest you look at utilizing a very simple MVC framework such as Fusebox. I found an older version online and modified it to port to PHP so I don't have the include issues inherent in code such as yours.

Check out www.fusebox.org to obtain a sample app in FB3 which is written in PHP to give you some guidance.

QUOTE(PsychoCoder @ 21 Mar, 2008 - 06:47 AM) *

In stead of having your include file like you have it now (in the start of your PHP code


php

1. <?php include('header.php') ?>


Do it outside your PHP code . Do your PHP code, then you have your HTML, <HEAD></HEAD> then <BODY>, inside your body tag add your include


php

<? php include("filename.php") ?>



User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/1/08 01:01PM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month