|
Posted by deko on 12/16/15 11:57
> Just to add to this thread - that I occasionally use PHP to get the
> browser version (in case JS is turned off) so that I can import
> different sets of (accordingly tweaked) stylesheets. It's a bit of a
> kludge though, I think.
Sounds interesting. How do you get the browser info with PHP?
I liked Satya's suggestion:
> You can give your css file extension php and do what you want
> with them like a php file.
> like
> .table1 {
> width:<?=$urVar;?>
> }
> and include this file in <style .....>
I assume it would look something like this:
<head>
<meta ... >
<title ... >
<style>
http://www.example.com/style.php
</style>
</head>
I haven't tried this yet, but I assume the idea is to use $_GET in style.php.
I have a form on a page with a select drop-down that posts a 'color' value that
changes the page background color - the value resets to 'change background' (or
null) after postback. The problem is I want to add a couple of links: "normal
font" and "large font", in addition to the select background option. But if the
user clicks one of these links, the page reloads with a null post variable and,
if a background color was previously selected, it's lost after selecting the
font size.
Because the select option resets to null after the postback, I have no way of
knowing what the user had selected (if anything). So I'm not sure if a
style.php file is going to help me. And I'm not sure I want to deal with page
state just to include those font size links.
Navigation:
[Reply to this message]
|