The following entries were made in the “All Things PHP” category.
Archive for “All Things PHP”
Supporting Legacy Browsers, or Not
When I started using computers in the early 90s I used to complain every time Microsoft or some software manufacturer came up with a new version of whatever it was of theirs I was using. My gripe was that I had finally gotten a good handle on the old product and didn’t really want to upgrade and re-live an often painful learning curve. I was content. But, as support waned, I relented and did as was expected of me — what I was essentially forced to do: I upgraded. As software improved and I became more computer savvy these transitions got easier. Usually, after the fact, I was happy I stayed current. That was me as a user. Now, as a web developer, I find myself on the other side of that very situation.
Continue reading “Supporting Legacy Browsers, or Not” »
Securing PHP Include Files
One of the great things about the PHP server-side scripting language is the ability to “include” files. Using includes you can share files across several pages. For example, if you’re not using a functions library to handle global page sections, you can create a file called header.php
, put some variable hooks in it to handle a dynamic title, keyword set, and description, then use this one file for all your web pages. This can save a tremendous amount of initial work when creating a site, plus it can greatly reduce maintenance down the road if you want to make changes. But the web being what it is, it is possible to access some includes directly and thus you may want to secure them.
Continue reading “Securing PHP Include Files” »
Directories Set to 777 are Safe/Unsafe?
I will first say this as a disclaimer: I’m not a hacker, cracker, or a server security expert! This post is more of a question than an answer. Okay, now that that’s said I can get on with this short article. To the best of my knowledge, and after doing some research on the subject, and reading eighteen million conflicting versions of this information, I must tell you that manually setting directory permissions to 777 is not safe! Or at least I don’t think it is? I’m pretty sure if you set directories/folders on your server to 777 you can be cracked and probably will be, eventually — unless said directories were created with a server side scripting language thus taking ownership away from “Apache,” “Nobody,” or whatever the common default owner name on your server is.
Continue reading “Directories Set to 777 are Safe/Unsafe?” »
WordPress Titles & Descriptions for SEO
I recently made some modifications to this blog to help get its articles indexed more quickly (for SEO reasons), to help users identify one article or page from the next with greater ease, and to make it easier for people to Digg articles, mark them in Ma.gnolia, etc. If you see your browser’s title bar you’ll now notice that the individual article pages show the name of the article more clearly, and on the “blog pages” the position of the page name is better. You’ll also see I modified the title separators. These modification also apply to the META “description” as I tried to make them more distinctive as well (good article titles help). It was pretty simple. Here’s what I did and how can do it, too.
Continue reading “WordPress Titles & Descriptions for SEO” »
PHP Contact Form v.2.0 Released
This has been long overdue — almost a year — but I have finally reworked my old contact form completely and I’m extremely pleased to re-release it as my all-new Secure and Accessible PHP Contact Form v.2.0. I made a vast number of improvements to enhance its accessibility, usability, and most notably its security. To get the full picture about its features, and to download it for yourself, please see this official download page, and if you want, you may also check out the working demo form. I have slaved over this for more than a week adding fourteen fifteen sixteen security features and myriad enhancements. My main goal was to make it spam-proof. It’s not, there are no absolutes, but it should be very resistant. Think of it as you would a waterproof watch. Sure, it won’t be ruined when you go swimming, but at around 2000 feet it’s going to implode. Anyway, I’m really pleased with the results and hope you like it too.
Continue reading “PHP Contact Form v.2.0 Released” »
PHP Style Changer Experiment
I wanted to open up this latest experiment for comments since it was the comments to Roger Johansson’s Build your own PHP style sheet switcher article that inspired me to add cookie acceptance detection functionality to my own PHP Style Changer Experiment. It seems to work nicely but I figure it’s always good to get some real-world feedback. And since I don’t accept comments at MikeCherim.com I figured I’d do it here. The link above leads to the supporting article, but here’s the actual experiment page, and here’s the well-commented script provided as a text file. Feel free to use it and tell others if you like it — it is safe from XSS so use it with confidence. It’s been in use a long time but I never released it.
Continue reading “PHP Style Changer Experiment” »
The One-Click Accessibility Self-Test
Everybody and their brother has CSS and X/HTML links on their site(s) nowadays. These, in case you don’t know, are for self-testing your site’s style sheet(s) and mark-up validation (on the page tested). These links are coded to use an absolute URI or the “Referrer,” but for testing page accessibility I know of no such thing. We used to have links that led to various sites that showed the results of previous testing, but that was before Bobby became WebXact. Rarely do I see those links now. Nowadays people rely on a web developers’ or web accessibility tool bar for their browser.
Continue reading “The One-Click Accessibility Self-Test” »
PHP/CSS Donations Thermometer
You know those donation thermometers you see sometimes? The ones where the level of the mercury marks the charity’s progress? Well, I made one for the web using PHP and CSS. It started life as a growth gauge I made for a friend’s son, then I had the notion of making it a thermometer or gauge for measuring and displaying charity’s donations progress. Next thing I know, my friend’s friend, a person who in fact runs a charity, sees it and comes to the same conclusion as I and requests the gauge. This is for them I suppose.
Continue reading “PHP/CSS Donations Thermometer” »
Accessible Form Results
That’s all there is to it. Save the files and go. You’re done.
After playing around with some modifications to Dan Champion’s Accesskey Script in use at Accessites.org, I discovered a significant improvement to the self-returning form result to make it more accessible. I have recently been going through my forms, starting with those on the site mentioned above, one at a time, improving their level of accessibility by adding a simple ID to the results heading and a bookmark pointing to the results heading on the form submit self-target. I haven’t changed my PHP contact form download (yet), but herein I will describe the changes which are quite simple to implement so you may do it yourself.
Continue reading “Accessible Form Results” »