Click to See Complete Forum and Search --> : Style Switcher?


sharkey
06-15-2004, 06:57 PM
Hey i thought this would suit the general forum the best as i no longer know if i should do this in PHP, Javascript or others.

After doing a bit of research looking for tutorials on PHP versions i came across an old ALA article with a PHP version but one problem i read all of the feedback about it and its terrible about security flaws etc as i have rarely no knowledge of PHP i do not know what way to go now. Does anybody know of any good tutorials on it which have a good robust version.

Any help is appreciated.

PeOfEo
06-15-2004, 07:02 PM
'style switcher'. I am doing a similar thign for a cms, basically use the server side language to read from a cookie what sheat the user wants then write out the import statement in the head with the value. If there is no cookie set it will write the default. To set the style just set the cookie. If the user logs in you can store the data in a db of course, but with no logins a cookie is the best option.

MstrBob
06-15-2004, 07:09 PM
EDIT: Didn't see Peo's post. Yes, you can set a cookie with PHP to save the user's preference. I personally think PHP is the best way to go. I will include a style switcher I made for you, though, in case you are interested.

sharkey
06-15-2004, 07:15 PM
Cheers you guys ill try out your one and ill post back tomorrow about how i got on. Yeah i never really read it all but they were saying about how a hacker could get into some of your cookies or something and then have the ability to change your mark-up and that.

But anyways thanks again guys:)

sharkey
06-15-2004, 07:18 PM
Any chance you can repost that code mstrbob as i didnt quite understand peofeos post too well being a real noob at php.

MstrBob
06-15-2004, 07:24 PM
Yes, sorry, here's the PHP style switcher I made, I revamped it to use Cookies. Include the PHP in all of your header pages to make the stylesheet change universal on your site, although the HTML form is optional. Just a basic script.

EDIT: Woops, typo in script, this should work:

sharkey
06-15-2004, 07:39 PM
No problem thanks again mate.

Cheers
Chris Sharkey

PeOfEo
06-15-2004, 08:08 PM
Originally posted by MstrBob
I personally think PHP is the best way to go. Personally I think asp.net is. :p

MstrBob
06-15-2004, 08:11 PM
Originally posted by PeOfEo
Personally I think asp.net is. :p

You would. :p PHP man! You know, if I had ASP support, I would have learned it. But I've made all of my websites on Linux without that ASP adaption thing-a-ma-jiggy I've heard of. Plus, Windows ME (says you) won't support ASP. So, um, PHP!!

Sharkey, I hope you got my message on the PHP change. The cookie name didn't originally, hence it won't work. Tis what happen when I type without looking. Stupid is me, sorries.

PeOfEo
06-15-2004, 08:15 PM
Originally posted by MstrBob
You would. :p PHP man! You know, if I had ASP support, I would have learned it. But I've made all of my websites on Linux without that ASP adaption thing-a-ma-jiggy I've heard of. Plus, Windows ME (says you) won't support ASP. So, um, PHP!!

Sharkey, I hope you got my message on the PHP change. The cookie name didn't originally, hence it won't work. Tis what happen when I type without looking. Stupid is me, sorries. It will support asp, not asp.net. There is a distinction. Asp.net and Asp will run on linux, asp.net for free.

MstrBob
06-15-2004, 08:22 PM
Ah, well, allow me to correct myself. I would have taken up ASP.net. Garghs, couldn't they have come up with a new name? Tis rather confusing. Anywho, I wouldn't want to spend time learning ASP classic if it's being phased out. As it is, I'll eventually have to learn PHP 5 since it's had its final release. Eh, but, when it comes down to it, I'm probably too lazy to take up a new programming language. For now. :p