• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

Control CSS server side

Originally posted by meow
Whould this work in an .htaccess? Heavely guessing here...:eek:

AddType application/x-httpd-php .php .php3 .phtml .meow
AddHandler server-parsed .php .php3 .phtml .meow
[/B]


Not sure not that hot on .htaccess but some info suggests that it could be done

server-parsed sounds like it'd SSI the page not php it


should the addtype be text/html looks like it's what's sent to the browser

who know give it a whirl :)
 
Originally posted by meow
WHOOOPIE!!! Wow. Now I'm in love. :eek:

Thank you so very much. I've asked about this at several places and all I have got is 100 line long ASP scripts. I knew it had to be simpler than that.

Huh, my 500Megs are quite empty. The Directoris one I got because I want a playground and learn some more useful scripting than the unknown language I have been fiddling with. Then Yupapa dropped another one in my knee. Wasn't planned. I had just signed up for one of the free accounts, not applied for anything. Guess he is just a nice fellow.

Boy, are you good or what?!? I'm off buying black candles. :D
Doesn't directoris has only 250MB and 5GB?
 
Thanks Lucifer! :)
This is great stuff. I must save this whole thread so I can chew it all.
Do you hear me purring? ;)

Gyrbo -
Yes, you are right. Directoris is 250/5. But Yupapa gave me and some others free pro accounts the other day. I guess we were the first to sign up for the free service. Thank you Yupapa!
 
LUCIFERRRRRRRRRRRR!

I ought to able to figure this out, but I'm stuck. :eek:
What I want is the users to be able to change the whole style sheet. It works fine, if I start with no style at all.

What I have now is this. front.css is the full style sheet and none.css just contains a fake rule. Works fine. But how do I set it up so the full CSS (front.css) is loaded with the page from start?

Code:
--- In HEAD ---
<?

# errors??

if ($style=="none" || $style==front){

## $style will be substituted for its value

echo "<link rel='stylesheet' href='$style.css' type='text/css'>";

}

?>

---- In BODY ----

<a href="test.php?style=none">Disable CSS</a><br>
<a href="test.php?style=front">Enable CSS</a>

One stupid cat :(
 
meeeeeeeoooooooooooooooooooooooooow!!!!!

Lucifer, don't you ever leave this board. ;)
You are agood techer. Thank you again!
 
Teach - I'm curious. Why isn't there a double equal sign between the variable and it's value in this last one? Is this significant? :confused:
 
Originally posted by meow
Teach - I'm curious. Why isn't there a double equal sign between the variable and it's value in this last one? Is this significant? :confused:
In the first one, it's a compair sign. If the two values are the same, it returns a 1, otherwise a 0. On the second one it declairs a variable, the asigns a value to a variable.
 
yup,

easy f**k-up

if ($fish=7){ do something } :(

not

if ($fish==7){ do something } :)

first one just sets $fish to 7 and does the thing

the second does the thing only if $fish has value of 7
 
It's me again. :eek:
if (empty($style)){$style="front";}
Could I add another conditional statement that overrules the first? And says (in plain English):

"If the user comes from the specific page blah.html load other.css and this will overrule the first command (load front.css)"

That is, everyone will get front.css when they first enter except those that come from blah.html. They will get other.css instead.

Sorry to be such a pest.
 
you could do

PHP:
if ( preg_match( "/blah\.html/" , $HTTP_REFERER ) ){$style="other";}

if you put it after the 'empty' check it'll just override it

this does't work if the browser doesn't send a HTTP REFERER header

you could just hard code the link from blah.html to have ?style=other
 
you could just hard code the link from blah.html to have ?style=other
Faeces I'm stupid! I see how it looks in the address field and still I don't...Grrrrrrr!

I'll try the other way. Seems more fun. Why wouldn't the browser send a HTTP REFERER header? Does that depend on the browser or - what?

Thanks! :):):)
(We have just invented a kinder, more devilish browser sniffer. ;) )
 
Originally posted by meow

Faeces I'm stupid! I see how it looks in the address field and still I don't...Grrrrrrr!
is that the regular expression bit /somemeaninglesscrap/ worth using and not to hard to learn but you need a good tutorial

Why wouldn't the browser send a HTTP REFERER header?
when has a browser ever done what it should
HTTP REFERER is optional/not required

browsers not doing what they should example

if you are as claimed in your sig. using K-Meleon then my atavar is f**ked with the transparancy, though yours is OK maybe it's an alpha/index transparancy thing or just animation.
 
Are you implying that I should read a book or tutorial on php? Why? I've got all I need here at fws. ;)
But if you know of a good online beginner's tutorial I'll listen.

Your avatar looks like a bleeding snowflake. The previous version didn't have full image support. Don't know about this one, but I haven't noticed that before. Maybe it's the animation? And I don't know what Peo has done, but the "submit"and preiew" buttons are totally gone in kmel. Has been there before. :(
 
on K-meleon the submit/preview buttons are back again :)

it's got no file upload though :(

I'm sure someone as resourcefull as you can find a good tutorial ;)
 
Lot's of them out there. That's the problem with everything in this world. You have to wade through the crap to get to the candy. :D
 
not online but o'reilly's has a good reg expression chapter in perl programing worth a read if your in a bookshop.

sorry not much help :(
 
Oh Regexp, I thought you were suggesting I should learn php and stop nagging you. ;)
Wow, what an handsome avatar. :D
 
Back
Top