Closed Thread Icon

Preserved Topic: Weird question. (Page 1 of 1) Pages that link to <a href="http://ozoneasylum.com/backlink?for=20970" title="Pages that link to Preserved Topic: Weird question. (Page 1 of 1)" rel="nofollow" >Preserved Topic: Weird question. <span class="small">(Page 1 of 1)</span>\

 
Skatefx
Bipolar (III) Inmate

From: Small Patch of Grass in CT
Insane since: Mar 2001

posted posted 06-02-2001 18:31

OK, I am designing a webpage in php. Well the page is not totally in php but i use the index.php file to call 3 other html files with the include() function. The problem I have run into is were to relative link my CSS. Should it be in the main index.php file or in one of the other 3 html files that compose the webpage?

Here is the link to the design I am slowly working on. (Dont laugh )

thanks

Mike

"Society, we all know that somethings wrong. And we've know it all along" -Pennywise-

WarMage
Maniac (V) Mad Scientist

From: Rochester, New York, USA
Insane since: May 2000

posted posted 06-02-2001 18:51

I am wondering why you are using a single page to include 3 other pages.

The reason I say this is because I am assuming that one page is the head, the next the content while the third is the foot. If this is the case, I would then recommend placing the head and the foot in a main file, and simply include the content. That IMO.

In your case, you need to place the ccs include in the head of the file. So in that case place the include whereever the head section is located.

In any case it would not make a huge difference, and not one that I could answer for you. You may have to run some tests to figure the speed out on that one. It is all computed relitively fast, and if you are not getting over 150,000 hits in a day it would not even make a semi-noticable difference.

linear
Paranoid (IV) Inmate

From: other places
Insane since: Mar 2001

posted posted 06-03-2001 17:35

Agreed the the reference to the CSS needs to go in the HEAD of the document, whrever that is.

But I would recommend that the path ththe CSS not be relative, i.e. it should start with a slash:
<LINK href="/lib/linear.css" rel="stylesheet" type="text/css">

I do my pages exactly like you describe, for what it's worth, so mine is in header.inc. Here's my generic page:

<?php
$pagetitle="[linear]";

include("header.inc");
include("index.inc");
include("footer.inc");
?>

One reason I had it that way was readability. I had at one point an elaborate nested table scheme (I'm table free now, woo-hoo!). I set a comment to indicate the start and end of the content section of the page. Then I chopped that up into header and footer and inserted the page content between with an include file (see above).

Keep working on it, you've got the right ideas. Anything you do to make your own maintenance easier is well worth it. If you never update your site, noone will read it.

Skatefx
Bipolar (III) Inmate

From: Small Patch of Grass in CT
Insane since: Mar 2001

posted posted 06-04-2001 01:40

I totally agree with you Linear. I had to design my site this way for the same fact as I had way too many nested tables and it made updates and changes a bitch. I designed my site a bit differently though. I am not using a header - index - footer scheme. I am still using tables but uinserting other html files into it. Is there something I am doing wrong, do you think it should be done another way? any suggestions?

linear
Paranoid (IV) Inmate

From: other places
Insane since: Mar 2001

posted posted 06-04-2001 05:22

1) get your layout tightened up without using includes. Tighten up some more.
2) when you're reasonably happy, insert comment tags to mark the boundaries of the content areas.
3) only rthen carve your masterpiece up into modules. Hopefully the right chunk size will be apparent.

My scheme is flexible enough to allow some things that I don't do currently, like serve content adjusted to different browsers. Stuff like that mattered to me, and drove my design decisions. What should be at the top of your own list is ease of mainentance. Think about that before you do any sort of change to your page. You'll be a happy guy.

Skatefx
Bipolar (III) Inmate

From: Small Patch of Grass in CT
Insane since: Mar 2001

posted posted 06-04-2001 17:00

That is exactly what I am doing. The maintanence on the old site was horrible. To change one link on the navi bar I had to edit 20 pages of html. The way I have it set now I would only have to edit one. Thanks for the advice Linear, I found it to be very informative and useful.

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 06-05-2001 00:33

Skate

Here is the deal. The path to your css must be relative to the whole page. like linear said I'd do it from the root of your server so things don't get confused.

Think about it like this though.

1. Browser requests the page from the server
2. Server (PHP) assembles the page
3. Server sends it to the browser
4. Browser recieves what you see if you view the source.
5. Browser renders page (this is the step where it grabs your .css doc)
6. Browser displays page.

See how by the time it looks for your css doc it's already run the PHP.
If you use JS it would be the same way

make sense?


Walking the Earth like Kane

Skatefx
Bipolar (III) Inmate

From: Small Patch of Grass in CT
Insane since: Mar 2001

posted posted 06-06-2001 01:40

Thanks for the advice. This helped, when I finish I'll post the results.






« BackwardsOnwards »

Show Forum Drop Down Menu