Log In · Register

 
directories help.
miszxjojo
post Apr 3 2009, 02:52 PM
Post #1


Senior Member
*****

Group: Member
Posts: 354
Joined: May 2007
Member No: 526,982



so i got how to do the headers & footers stuff (i use php includes)
but when i do
mysite.com/folder/whatever.php
it shows up a blank page?
 
 
Start new topic
Replies (1 - 19)
manny-the-dino
post Apr 3 2009, 03:03 PM
Post #2


Senior Member
*******

Group: Administrator
Posts: 8,629
Joined: Jan 2007
Member No: 498,468



Moved to Webmasters' Corner
 
theerinkal
post Apr 3 2009, 04:13 PM
Post #3


Irrisistable Cabbages.
*****

Group: Member
Posts: 549
Joined: Nov 2007
Member No: 589,355



put the [DOCUMENT ROOT] php include into those pages and then you've got it

OR


add the .css page too ALL of your directories and use the other include page


Either of these with include your .css page to your directories.
 
schizo
post Apr 3 2009, 04:20 PM
Post #4


Senior Member
******

Group: Staff Alumni
Posts: 2,435
Joined: Feb 2007
Member No: 506,205



There was just another topic posted about this same exact thing:

http://www.createblog.com/forums/index.php...p;#entry3164560
 
miszxjojo
post Apr 3 2009, 06:33 PM
Post #5


Senior Member
*****

Group: Member
Posts: 354
Joined: May 2007
Member No: 526,982



^ that was was closed.

& i found a way to make my pages not blank.
i moved my header & footer into each folder...
is there an easier way?
 
schizo
post Apr 3 2009, 06:39 PM
Post #6


Senior Member
******

Group: Staff Alumni
Posts: 2,435
Joined: Feb 2007
Member No: 506,205



But you can still read the answers the people gave.

You made the other topic and you said you got it to work, that's why it was closed. If you still have questions, just PM someone to reopen it. Don't make a whole new topic.
 
Mikeplyts
post Apr 3 2009, 06:57 PM
Post #7


Mel Blanc was allergic to carrots.
*******

Group: Official Designer
Posts: 6,371
Joined: Aug 2008
Member No: 676,291



Well like I mentioned in the other topic, try using the full URL to the header and footer page.

Like so:

CODE
<?php include("http://www.mysite.com/path/to/header.php");?>
 
Maccabee
post Apr 3 2009, 07:51 PM
Post #8


Senior Member
*******

Group: Official Designer
Posts: 5,880
Joined: Nov 2007
Member No: 593,382



If you have another folder you need to add ".." to the directory.

So instead of <?php include(/header.php) ?> Change it to:

<?php include(../header.php) ?>

two periods tell it to go a folder back. So if you have a folder in a folder you would then have to use two sets of dots. ../../header.php

Putting the header and footer file in each folder would ruin the point of includes.

Edit:

^No dont ever use the full url in includes. That will mess it up.
 
miszxjojo
post Apr 3 2009, 08:41 PM
Post #9


Senior Member
*****

Group: Member
Posts: 354
Joined: May 2007
Member No: 526,982



idk why but none of these work :/
 
Maccabee
post Apr 3 2009, 08:43 PM
Post #10


Senior Member
*******

Group: Official Designer
Posts: 5,880
Joined: Nov 2007
Member No: 593,382



Could you give us a url or code?
 
miszxjojo
post Apr 3 2009, 09:59 PM
Post #11


Senior Member
*****

Group: Member
Posts: 354
Joined: May 2007
Member No: 526,982



idk why but none of these work :/
 
Mikeplyts
post Apr 3 2009, 10:09 PM
Post #12


Mel Blanc was allergic to carrots.
*******

Group: Official Designer
Posts: 6,371
Joined: Aug 2008
Member No: 676,291



QUOTE
Could you give us a url or code?

 
newkidontheblock
post Apr 4 2009, 08:52 AM
Post #13


Offline.
*****

Group: Official Designer
Posts: 609
Joined: Mar 2007
Member No: 507,591



here is a little example I make for you
 
miszxjojo
post Apr 4 2009, 12:31 PM
Post #14


Senior Member
*****

Group: Member
Posts: 354
Joined: May 2007
Member No: 526,982



my host gave me like a ton of folders in my root >.<
the place where i put my conent is in the www folder.
so should i put the includes folder in the www one or in my root?
 
Maccabee
post Apr 4 2009, 12:49 PM
Post #15


Senior Member
*******

Group: Official Designer
Posts: 5,880
Joined: Nov 2007
Member No: 593,382



Wrong! Ignore all other folders except for the Public_Html folder! That is where you put everything! Think of the public_html folder as the desktop. Its the farthest back you can go.
 
fixtatik
post Apr 4 2009, 01:38 PM
Post #16


Senior Member
******

Group: Member
Posts: 1,237
Joined: May 2008
Member No: 648,123



^ not every host uses a "public_html" folder. some use "html," some use "www," some just use the domain name.

i wouldn't really suggest using "../" to go up a folder every time, as it does get a bit confusing sometimes. if you have your header, footer, whatever, in an "includes" folder or similar, you can use this to call it from wherever:
CODE
<?php include($_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'); ?>

any file you need to include in a page, just replace header.php with the name of that file.
 
miszxjojo
post Apr 4 2009, 02:58 PM
Post #17


Senior Member
*****

Group: Member
Posts: 354
Joined: May 2007
Member No: 526,982



^ out of all the ones i tried, thats the closest one to working.
it still doesnt work though, theres a huge space and my <h1> stuff..
and i didnt have an includes folder before..
i just added it to try the code above. didnt work still.
i think im starting to give up >.<

and btw, i use a www folder.
but when i tried to use your code above, i took out the /includes/ but instead of a blank page, it says some warning: stuff or errors (cant remember which it said) and my layout didnt show?
 
fixtatik
post Apr 4 2009, 03:06 PM
Post #18


Senior Member
******

Group: Member
Posts: 1,237
Joined: May 2008
Member No: 648,123



as i said, if you don't use an "includes" folder to store the header, footer, etc., files, then don't put "/includes" in that code.
 
miszxjojo
post Apr 4 2009, 05:08 PM
Post #19


Senior Member
*****

Group: Member
Posts: 354
Joined: May 2007
Member No: 526,982



i tried that :/
but actually i took out the /includes/ ... ill try just removing the /includes

edit://
it works! :D thanks <3
 
manny-the-dino
post Apr 4 2009, 08:10 PM
Post #20


Senior Member
*******

Group: Administrator
Posts: 8,629
Joined: Jan 2007
Member No: 498,468



Topic Closed & Moved
 

Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: