directories help. |
directories help. |
![]()
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? |
|
|
![]() |
![]()
Post
#2
|
|
![]() Senior Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Administrator Posts: 8,629 Joined: Jan 2007 Member No: 498,468 ![]() |
Moved to Webmasters' Corner
|
|
|
![]()
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. |
|
|
![]()
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 |
|
|
![]()
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? |
|
|
![]()
Post
#6
|
|
![]() Senior Member ![]() ![]() ![]() ![]() ![]() ![]() Group: Staff Alumni Posts: 2,435 Joined: Feb 2007 Member No: 506,205 ![]() |
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. |
|
|
![]()
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");?>
|
|
|
![]()
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. |
|
|
![]()
Post
#9
|
|
Senior Member ![]() ![]() ![]() ![]() ![]() Group: Member Posts: 354 Joined: May 2007 Member No: 526,982 ![]() |
idk why but none of these work :/
|
|
|
![]()
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?
|
|
|
![]()
Post
#11
|
|
Senior Member ![]() ![]() ![]() ![]() ![]() Group: Member Posts: 354 Joined: May 2007 Member No: 526,982 ![]() |
idk why but none of these work :/
|
|
|
![]()
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? |
|
|
![]()
Post
#13
|
|
![]() Offline. ![]() ![]() ![]() ![]() ![]() Group: Official Designer Posts: 609 Joined: Mar 2007 Member No: 507,591 ![]() |
here is a little example I make for you
![]() |
|
|
![]()
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? |
|
|
![]()
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.
|
|
|
![]()
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. |
|
|
![]()
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? |
|
|
![]()
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.
|
|
|
![]()
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 |
|
|
![]()
Post
#20
|
|
![]() Senior Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Administrator Posts: 8,629 Joined: Jan 2007 Member No: 498,468 ![]() |
Topic Closed & Moved
|
|
|
![]() ![]() |