Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums

Go Back   Code Forums > Application and Web Development > PHP

Reply
 
LinkBack Thread Tools Display Modes
Old 06-23-2005, 09:35 PM   #16 (permalink)
falsepride
Regular Contributor
 
Join Date: Oct 2004
Posts: 219
falsepride is on a distinguished road
why would you want a dynamic css file? dont browsers cache those so they dont have to redownload them?
falsepride is offline   Reply With Quote
Old 06-24-2005, 05:24 AM   #17 (permalink)
DJMaze
Senior Contributor
 
DJMaze's Avatar
 
Join Date: Mar 2005
Posts: 705
DJMaze is on a distinguished road
Quote:
Originally Posted by teknomage1
What the heck are you talking about DJMaze? There's no difference a far as the browser is concerned with the dynamic or non dynamic version (once it works). All this happens in the server. This doesn't affect the fact that he doesn't need load of tables to accomplish layout and it doesn't affect the browser's ability to cache the images.
Say you write a page in PHP and every time a visitor looks at that page PHP generates a nice HTML document.
Now you write a CSS file so that the HTML page size can be reduced and people will recieve this page, and others, faster and at the same time they don't have to re-download the CSS file again because it's cached.

If you make your CSS dynamic it's pretty useless because it adds a overload to the server because:
- the html page needs to be generated
- the CSS file needs to be generated

To solve this you should send the following header()'s
= Cache-Control
- Date
- Last-Modified
- Expired
and process the recieved header:
- If-Modified-Since
http://www.w3.org/Protocols/rfc2616/....html#sec14.25

Instead of doing all that just skip the dynamic CSS and use <html background="img"> or <div style="background:url()">
This is actualy faster then to have 2 dynamic generators.
DJMaze is offline   Reply With Quote
Old 06-24-2005, 07:38 AM   #18 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,505
sde is on a distinguished road
you can't be so close minded. vbulletin among many other Web Applications are a perfect example of CSS data being stored in a database.

i've written several web apps which give a user control to modify colors, font sizes, and other CSS attributes. these parameters get stored in a database.

programming my database values to modify the layout inline vs a single dynamic style sheet would be REDICULOUS!! this would be a nightmare to maintain.

your load time argument is seriously flawed also. a dynamic style sheet would be a smaller size to load vs putting style tags in every div you use since there would be a LOT more DHTML to load into the browser.

when was the last time you were worried about a couple of MS for a style sheet to load?? i mean huge bloated dhtml drop downs can get pretty bad sometimes, but if you are just making a little style sheet, the user is not going to notice a difference. ( especially considering my point that you would be loading a lot more html if you coded all style attributes inline )

whether your CSS attributes are in a style sheet or inline, if your page is PHP, then the server call is being made anyway. lol, i keep thinking wtf! as i write this. anyway what about my question .. what do you use PHP/MySQL for?

i would say your argument is completely invalid. take the scope of what he, or anyone else making a dynmic style sheet into context.

the only suggestion you have proposed as an alternative to dynamic style sheets is coding all your style tags inline which i can not believe someone as experienced as yourself would suggest.
__________________
Mike
sde is offline   Reply With Quote
Old 06-24-2005, 08:56 AM   #19 (permalink)
metazai
Regular Contributor
 
Join Date: Apr 2004
Location: Orange County, CA
Posts: 125
metazai is on a distinguished road
One fell swoop and he solves it. All my CSS is self-taught, and I've never been clear on the differences between # and . when defining classes and ids . . . when learning to do more complicated CSS layout, I used some online tutorials and have been reusing code learned from that experience, so this is good to know.

Thanks everybody for all your help. My first CodeNewbie problem NOT solved by Stan! =+) (sorry, Stan).
metazai is offline   Reply With Quote
Old 06-24-2005, 11:06 AM   #20 (permalink)
teknomage1
Jack of all trades
 
teknomage1's Avatar
 
Join Date: Feb 2005
Location: Los Angeles
Posts: 598
teknomage1 is on a distinguished road
Send a message via AIM to teknomage1
Quote:
Originally Posted by metazai
Thanks everybody for all your help. My first CodeNewbie problem NOT solved by Stan! =+) (sorry, Stan).
Aw, shucks...
__________________
Stop intellectual property from infringing on me
teknomage1 is offline   Reply With Quote
Old 06-24-2005, 12:17 PM   #21 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,505
sde is on a distinguished road
you're giving up? make sure you type back if you find an aswer.
__________________
Mike
sde is offline   Reply With Quote
Old 06-24-2005, 02:36 PM   #22 (permalink)
teknomage1
Jack of all trades
 
teknomage1's Avatar
 
Join Date: Feb 2005
Location: Los Angeles
Posts: 598
teknomage1 is on a distinguished road
Send a message via AIM to teknomage1
No Stan, it's solved, it was just an improper CSS selector. '#' instead of '.'
__________________
Stop intellectual property from infringing on me
teknomage1 is offline   Reply With Quote
Old 06-24-2005, 04:06 PM   #23 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,505
sde is on a distinguished road
lol sorry, i was too busy driving the thread off topic to notice ..

3 people have called me stan in the last 2 days so i guess i should say too .. that the mascott is named stan, .. not me
__________________
Mike
sde is offline   Reply With Quote
Old 06-24-2005, 04:32 PM   #24 (permalink)
metazai
Regular Contributor
 
Join Date: Apr 2004
Location: Orange County, CA
Posts: 125
metazai is on a distinguished road
So your name is sde? How do you pronounce that?

LOL . . .
metazai is offline   Reply With Quote
Old 06-26-2005, 12:46 AM   #25 (permalink)
teknomage1
Jack of all trades
 
teknomage1's Avatar
 
Join Date: Feb 2005
Location: Los Angeles
Posts: 598
teknomage1 is on a distinguished road
Send a message via AIM to teknomage1
an initial S and a tag line of, "look it's stan" do kind of set you up for that.
__________________
Stop intellectual property from infringing on me
teknomage1 is offline   Reply With Quote
Old 06-26-2005, 06:43 AM   #26 (permalink)
DJMaze
Senior Contributor
 
DJMaze's Avatar
 
Join Date: Mar 2005
Posts: 705
DJMaze is on a distinguished road
@teknomage1: Great that you solved it, my congratz to you.

@sde:
Quote:
Originally Posted by sde
i would say your argument is completely invalid. take the scope of what he, or anyone else making a dynmic style sheet into context.

the only suggestion you have proposed as an alternative to dynamic style sheets is coding all your style tags inline which i can not believe someone as experienced as yourself would suggest.
Don't get mad i gave 2 solutions for CSS, one was dynamic and the other was inline.
But my dynamic version was probably misunderstood since it uses much more client/server communication then teknomage1 actualy needed to know due to the small size of his script.

I will write a full bloated tutorial about headers and caching someday
DJMaze is offline   Reply With Quote
Old 06-26-2005, 10:47 AM   #27 (permalink)
teknomage1
Jack of all trades
 
teknomage1's Avatar
 
Join Date: Feb 2005
Location: Los Angeles
Posts: 598
teknomage1 is on a distinguished road
Send a message via AIM to teknomage1
I didn't need anything, actually. DJMaze the reason everyone got upset is that you basically flamed metazai for a valid use of technology and continued offering irrelevant alternate solutions, based on the flawed premise that dynamic style sheets are bad.
Your bit about the headers isn't needed because everytime it's passed through the php interpreter, it gets a time created header of now. Altering the images inline is not elegant or scalable considering you'd still have to position it with CSS.
__________________
Stop intellectual property from infringing on me
teknomage1 is offline   Reply With Quote
Old 06-28-2005, 08:59 AM   #28 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,505
sde is on a distinguished road
Quote:
Originally Posted by metazai
So your name is sde? How do you pronounce that?

LOL . . .
lol, my name is mike. sde is just an online nick i use. it was short for sdelectronic, which was a san diego based electronic music site i used to maintain and shoot/host video of events on. the site is no more, but the name just stuck.
__________________
Mike
sde is offline   Reply With Quote
Old 06-28-2005, 10:30 AM   #29 (permalink)
jeffro
Person of interest
 
jeffro's Avatar
 
Join Date: Mar 2003
Location: New Jersey
Posts: 102
jeffro is on a distinguished road
Quote:
Originally Posted by sde
lol, my name is mike. sde is just an online nick i use. it was short for sdelectronic, which was a san diego based electronic music site i used to maintain and shoot/host video of events on. the site is no more, but the name just stuck.
I met a guy who I had been talking to on a forum for years in real life. We naturally just started referring to each other buy our forum nicks, since that is how we had been 'talking' since we first met on the board. :-)
__________________
Jeffro
Linux counter#:213782
GnuPG ID: 406238E7
jeffro is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP 5.0.4 and 4.3.11 Released sde Code Newbie News 0 04-20-2005 10:56 AM
PHP vs .NET Redline Lounge 1 11-24-2004 06:10 AM
Installing and using CMUgraphics library. Valmont Standard C, C++ 12 03-29-2003 08:39 AM


All times are GMT -8. The time now is 03:19 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting