Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

site layout
is it possible to control css with php

Report this thread to moderator Post Follow-up to this message
Old Post
appplehead2000@yahoo.co.uk
03-14-08 12:10 AM


Re: site layout
appplehead2000@yahoo.co.uk wrote:
> is it possible to control css with php
>

Sure.  CSS can be generated with PHP, just like HTML can.

The main question being - why?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================


Report this thread to moderator Post Follow-up to this message
Old Post
Jerry Stuckle
03-14-08 03:03 AM


Re: site layout
..oO(Jerry Stuckle)

>appplehead2000@yahoo.co.uk wrote: 
>
>Sure.  CSS can be generated with PHP, just like HTML can.
>
>The main question being - why?

I do it for one reason - CSS doesn't support variables. With PHP I can
define some variables or constants at the beginning and then simply use
them later. Makes it very easy to play with different values.

And with some proper HTTP headers at the beginning the PHP-CSS is still
cacheable in browsers.

Micha

Report this thread to moderator Post Follow-up to this message
Old Post
Michael Fesser
03-14-08 01:03 PM


Re: site layout
On Fri, 14 Mar 2008 13:04:24 +0100, Michael Fesser <netizen@gmx.de> wrote:
> .oO(Jerry Stuckle) 
>
> I do it for one reason - CSS doesn't support variables. With PHP I can
> define some variables or constants at the beginning and then simply use
> them later. Makes it very easy to play with different values.
>
> And with some proper HTTP headers at the beginning the PHP-CSS is still
> cacheable in browsers.

Indeed. Do provide the correct content-type and some caching headers :).
--
Rik Wasmus

Report this thread to moderator Post Follow-up to this message
Old Post
Rik Wasmus
03-14-08 01:03 PM


Re: site layout
Michael Fesser wrote:
> .oO(Jerry Stuckle)
> 
>
> I do it for one reason - CSS doesn't support variables. With PHP I can
> define some variables or constants at the beginning and then simply use
> them later. Makes it very easy to play with different values.
>
> And with some proper HTTP headers at the beginning the PHP-CSS is still
> cacheable in browsers.
>
> Micha
>

Hi, Micha,

Yes, that I can understand, and I've done similar in the past.  But once
I get something I like, I typically just convert it to CSS and let it go
at that.

But that also isn't "controlling" CSS like I think the op wants to do.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================


Report this thread to moderator Post Follow-up to this message
Old Post
Jerry Stuckle
03-14-08 01:03 PM


Re: site layout
Jerry Stuckle wrote:
> Michael Fesser wrote: 
>
> Hi, Micha,
>
> Yes, that I can understand, and I've done similar in the past.  But once
> I get something I like, I typically just convert it to CSS and let it go
> at that.
>
> But that also isn't "controlling" CSS like I think the op wants to do.
>
Does he mean - say - linking to a stylesheet that is in fact a php script?


Report this thread to moderator Post Follow-up to this message
Old Post
The Natural Philosopher
03-15-08 12:16 AM


Re: site layout
The Natural Philosopher wrote:
> Jerry Stuckle wrote: 
> Does he mean - say - linking to a stylesheet that is in fact a php script?
>
>

Yes.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================


Report this thread to moderator Post Follow-up to this message
Old Post
Jerry Stuckle
03-15-08 12:16 AM


Re: site layout
you can pass arguments to the PHP script and generate different CSS



Report this thread to moderator Post Follow-up to this message
Old Post
GuangXiN
03-16-08 10:05 AM


Re: site layout
Greetings, Jerry Stuckle.
In reply to Your message dated Friday, March 14, 2008, 05:24:43,
 

> Sure.  CSS can be generated with PHP, just like HTML can.

> The main question being - why?

In example, You have 3 browsers (Regular desktop, Mobile client (GPRS-WAP an
d
the like), specialized in-application browser) what should render the same
page without loosing of readability. Yes, You can send different CSS for eve
ry
single one, but maintaining 3 different files isn't easy, if they are so
close and You need to make changes in them all if something goes to change.
Much simpler to have PHP script that acting to serve CSS template and adapt 
it
to every browser. Even then, with server-side caching it's very fast process
,
and with proper headers it will be cached on the client side too.


--
Sincerely Yours, AnrDaemon <anrdaemon@freemail.ru>


Report this thread to moderator Post Follow-up to this message
Old Post
AnrDaemon
04-03-08 12:20 AM


Re: site layout
AnrDaemon wrote:
> Greetings, Jerry Stuckle.
> In reply to Your message dated Friday, March 14, 2008, 05:24:43,
> 
> 
> 
>
> In example, You have 3 browsers (Regular desktop, Mobile client (GPRS-WAP 
and
> the like), specialized in-application browser) what should render the same
> page without loosing of readability. Yes, You can send different CSS for e
very
> single one, but maintaining 3 different files isn't easy, if they are so
> close and You need to make changes in them all if something goes to change
.
> Much simpler to have PHP script that acting to serve CSS template and adap
t it
> to every browser. Even then, with server-side caching it's very fast proce
ss,
> and with proper headers it will be cached on the client side too.
>
>

And even simpler is to have valid CSS which works in all browsers.  Then
you don't need hacks like you are promoting.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================


Report this thread to moderator Post Follow-up to this message
Old Post
Jerry Stuckle
04-03-08 01:12 PM


Sponsored Links




Last Thread Next Thread Next
Pages (2): [1] 2 »
Search this forum -> 
Post New Thread

PHP Programming archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 12:42 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.