/    Sign up×
Community /Pin to ProfileBookmark

Style Switcher?

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.

to post a comment
Full-stack Developer

10 Comments(s)

Copy linkTweet thisAlerts:
@PeOfEoJun 16.2004 — '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.
Copy linkTweet thisAlerts:
@MstrBobJun 16.2004 — 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.
Copy linkTweet thisAlerts:
@johndoe190authorJun 16.2004 — 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?
Copy linkTweet thisAlerts:
@johndoe190authorJun 16.2004 — Any chance you can repost that code mstrbob as i didnt quite understand peofeos post too well being a real noob at php.
Copy linkTweet thisAlerts:
@MstrBobJun 16.2004 — 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:

[upl-file uuid=e23445fd-dbfb-485b-9ef5-93f7f95bd692 size=1kB]styleswitcher.zip[/upl-file]
Copy linkTweet thisAlerts:
@johndoe190authorJun 16.2004 — No problem thanks again mate.

Cheers

Chris Sharkey
Copy linkTweet thisAlerts:
@PeOfEoJun 16.2004 — [i]Originally posted by MstrBob [/i]

[B]I personally think PHP is the best way to go. [/B][/QUOTE]
Personally I think asp.net is. :p
Copy linkTweet thisAlerts:
@MstrBobJun 16.2004 — [i]Originally posted by PeOfEo [/i]

[B]Personally I think asp.net is. :p [/B][/QUOTE]


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.
Copy linkTweet thisAlerts:
@PeOfEoJun 16.2004 — [i]Originally posted by MstrBob [/i]

[B]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. [/B]
[/QUOTE]
It will support asp, not asp.net. There is a distinction. Asp.net and Asp will run on linux, asp.net for free.
Copy linkTweet thisAlerts:
@MstrBobJun 16.2004 — Ah, well, allow me to correct myself. I would have taken up ASP[B].net[/B]. 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 [B]new[/B] programming language. For now. :p
×

Success!

Help @johndoe190 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...