CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 28th, 2003, 04:53 PM
dackerman dackerman is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 26 dackerman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question include() pages not taking CSS style?

Excuse my noobness, as I just started getting into PHP. Quite an exciting language it is!

Anyways, my site (splix.net) is basically set up using query strings, which took me FOREVER to figure out, but I think I got it down pretty well.

I'm just going to describe my site setup because some people weren't sure of what was going on...

index.php (front page) is the banner and the menu and the copyright footer. The default redirect inside of index.php goes to main.php which has the little Navigation image that you see when you first go to my site. All my pages are basically set up in the same way, just with different data. They are all being included with this script...don't know if this is the most efficient way to do it but it seems to work.

PHP Code:
<?php

if ($_GET[page] !=""){
$file "" $_GET[page] . ".php";
} else {
$file "main.php";
}
include(
"$file");

?>


Now, I have CSS styles on ALL of my pages. For example if you go to about.php on my server you will see the style sheet in action. But when you go to a page such as http://www.splix.net/?page=contact, it doesn't take the style correctly for some reason. Why I have no idea...

Another question I have is why the TITLES of the pages do not work either. For example the main.php title is splix.net :: v1. The about page title is splix.net :: v1 :: about. But when I include the pages the titles don't seem to go through...so I came up with this idea...

I would put the <head></head> tags UNDER the script above, using something like this:

PHP Code:
<title>splix.net :: v1 :: <?php print $file?></title> 


Don't know if that's allowed or not...seems to be working correctly though.

Sorry for all the questions...I'm just a very confused person right now.

Reply With Quote
  #2  
Old December 28th, 2003, 05:10 PM
BluesForTheRedS BluesForTheRedS is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Melbourne, Australia
Posts: 8 BluesForTheRedS User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi, I had a look at that page and there seams to be a problem with the HTML code you are rendering. The <HEAD> section should preceed the <BODY> section but on your contacts page they are reversed.

Cheers

Dave

Reply With Quote
  #3  
Old December 28th, 2003, 05:13 PM
Dragons Master's Avatar
Dragons Master Dragons Master is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Land o' da d00med
Posts: 124 Dragons Master User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 h 14 m 36 sec
Reputation Power: 0
Send a message via ICQ to Dragons Master Send a message via AIM to Dragons Master Send a message via Yahoo to Dragons Master
well if it's any compensation to you your site works great for me, I'm on the http://www.splix.net/?page=contact page and the title has "contect me" in the end of it, the css is working good (hover works) so I don't get the problem - code also seems okie.

Reply With Quote
  #4  
Old December 28th, 2003, 05:16 PM
dackerman dackerman is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 26 dackerman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
The links (and visited links) are supposed to be a light blue color...#7A9DBD in particular.

Are they like the default internet explorer blue (not #7A9DBD) for you?

Reply With Quote
  #5  
Old December 28th, 2003, 05:24 PM
BluesForTheRedS BluesForTheRedS is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Melbourne, Australia
Posts: 8 BluesForTheRedS User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
You need to look at where you are include()ing your content in relation to the rest of the file.

You have 2 <HEAD> and <BODY> sections, its only really by the good grace (and poor parsing of browsers) that you get what you want sometimes.

<TITLE>, <STYLE>, <SCRIPT> should all be included in <HEAD></HEAD> and this should come before the <BODY> section of your HTML.

Currently your <STYLE> section is within the 2nd <HEAD> block which is not valid HTML.

Cheers

Dave

Reply With Quote
  #6  
Old December 28th, 2003, 06:16 PM
Dragons Master's Avatar
Dragons Master Dragons Master is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Land o' da d00med
Posts: 124 Dragons Master User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 h 14 m 36 sec
Reputation Power: 0
Send a message via ICQ to Dragons Master Send a message via AIM to Dragons Master Send a message via Yahoo to Dragons Master
ohhh man just took a look at the code..
listen you made a.... well I wouldn't say common... but you made a small mistake here, you can't have 2 <html>,<head>,<body> tags - the problem is that you're having the css styling on your standalone .php files too - wut I suggest you to do is to go through all your php files except for index.php and delete everything from <HTML> to <BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 ONLOAD="preloadImages();"> - after that stuff should work - but back up yer stuff anyways.
ohh yeah and replace
<title>splix.net :: v1</title>
with
<title>splix.net :: v1 :: <?php echo $file; ?></title>

and everything should work.. keep us updated man..

Reply With Quote
  #7  
Old December 28th, 2003, 06:22 PM
BluesForTheRedS BluesForTheRedS is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Melbourne, Australia
Posts: 8 BluesForTheRedS User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Just a tip, if you are moving to a CSS based website then you can move you <BODY> tag into css

ie

<BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 ONLOAD="preloadImages();">

becomes something like

body {
background-color: #FFFFFF;
margin: 0;
padding: 0;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
}

leaving you with

<BODY ONLOAD="something">

Reply With Quote
  #8  
Old December 28th, 2003, 06:43 PM
dackerman dackerman is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 26 dackerman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
This makes me extremely mad...

In my links section I did not have a # infront of the color codes...therefore they were not working.

Stuff like that just pisses me off...

Thanks guys everything is working correctly now.

Reply With Quote
  #9  
Old December 28th, 2003, 06:48 PM
azz0r azz0r is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 377 azz0r User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 40 m
Reputation Power: 5
PHP Code:
<?php

if ($_GET[page]){
$page =  $_GET[page];
$file "$page.php";
} else {
$file "main.php";
}
require(
"$file");

?>

Reply With Quote
  #10  
Old December 28th, 2003, 06:49 PM
BluesForTheRedS BluesForTheRedS is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Melbourne, Australia
Posts: 8 BluesForTheRedS User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
yeah - css is a bitch like that, i always pass my ccs though a validator if its not working properly. That gets the errors, some of the time,

Cheers

Dave

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > include() pages not taking CSS style?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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 On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway