Dec 06 2005
PHP Business!
I’ve been thinking about this PHP style switcher business, as well as what I’m going to do with BellaBook3.1 to get it safe and secure, ready for release.
I have been trying to figure out the best way to have this PHP styleswitcher without disturbing browsing. I *think* because it’s a server-side language it is going to require a little bit of fuss, but not necessarily with the fart-arsing “if you’re sure this is the skin you want” pages. My theory is I can set what stylesheet the person chooses via $_SERVER['PHP_SELF']?style=bla which keep the user on the same page, and then have an if statement in my header above everything else with if (isset($_GET['style']) { ..etc which stores the cookie. Theoretically. Or am I going about this the wrong way and ignoring a more simple option?
Also.. with BellaBook3.1 my problem at the moment is trying to come up with a totally secure admin panel. I mean, I know nothing I do is really going to be totally 100% secure but I’d like to set off in the right direction. I was thinking of having the login page set up to restrict access and then just include the various admin files when a user is authenticated — with an if statement in the top of each admin page telling the script to exit if it’s accessed directly instead of via the main login thingymajig.
My brain doesn’t work at this time of the morning. *grumble*
ETA: fixed weird comment timestamp thing. I was right: for some reason I was using gmdate() for entries and date() for comments. Oops.
ABE: (that’s “another bloody edit”, btw) I didn’t get that job. Karl had to ring up to find out this, because for some reason we didn’t get the letter that was supposedly posted to me.
Warning
This post is over 6 months old. This means that, despite my best intentions, it may no longer be accurate. Age, motherhood, experience, loss... these things have all changed me from when this blog was started back in the heady (ha) days of my youth.
As much as I would like to go back and edit 10 years of archives to provide an insight into the 'me' of now — to update coding snippets and revise website advice — it would probably take years to do so (by which point I'd have to start again!) This would defeat the point of keeping these archives anyway.
Please take these posts for what they are: a brief look into my past, my history, my journey.
8 Responses so far
-
I use ye old classic skinning script (with a couple of modifications). What I did is just to make the link ?skinlinkhere=newskinblahblah. That way the query string attaches itself to the current page, whatever that might be. Though having said that, when I changed it to have the whole “choose a skin” page I just set it to go back to the homepage because… well, that’s the most interesting part of my site and people should stay there. :P I hate the “YAY YOU CHANGED SKIN!!!1 LIKE IT???” type page (normally called index2.php for some annoying reason) so definitely don’t do that or I shall … um … not change skins? Ha.
-
Pssst, just thought I’d let you know – I logged onto your site from uni where I’ve never visited before (I don’t think anyway) using Safari (I’m on a Mac ^_____^ ) and your stylesheet thingy works fine, no whiteness/unstyled content for me. At home (using Firefox/Win) I did get that at first. Did you fix the stylesheet switcher problem? Or is Safari just way more awesome for some reason? Also, when are you gonna fix your blog timestamp – the way it looks now, it seems I commented before you even posted the entry XD Sorry for the double comment post -_- I should really remember what I was going to say when making my first comments…
-
I’m using the PHP switcher from A List Apart (with some minor modifications) and that sends the user back to the referring page after setting the cookie. I don’t think it would be an improvement over your method though – it doesn’t work exactly as intended for people using certain firewalls (blank referrers get sent to my skin selection page), and the overhead saving seems minimal. But it’s an option :)
-
lalala. It seems to me that some of the older theme switchers didn’t disturb browsing time. Y’know, before this newfangled idea came along about having people switch on a designated page or something. and I agree with Amelie’s method. yay!
-
Amelie – I Jem fixed it ’cause when I pulled the site up on my Mac last night, I received a page of unstyled content. And it can’t be because I have an old browser because I just got the computer like… three weeks ago?
-
Wow, that all sounds/looks quite confusing. I’m from near Ironbridge, though my boyfriend lives the other side of Cannock, so that’s why I am the weekends lol.
-
just wanted to say HEY! sorry about the job, and as far as the rest of your post… was that English?? j/k.









