PHP Header Redirects

There’s a few ways to redirect a page in PHP. Well, two. A right and a wrong.

Wrong Way

header('Location: foo.php ');

Right way

header('HTTP/1.0 302 Found');
header('Location: foo.php ');
exit;

This is evident on IIS6 and IIS7 where the wrong redirect will just fail.

Even if you are not using IIS6 or IIS7 its good practice to set the headers correctly and exit the script.

WordPress/Shopp Shipping Calculator/Options Access-Control-Allow-Origin Error

I’ve recently been debugging a customer’s WordPress/Shopp store. When the customer set the Cart & Checkout to be served over SSL  the shipping calculator failed.

Serving Cart / Checkout / My Account pages over SSL is not built into Shopp for some reason. I have a post on this –  SSL/HTTPS for Shopp pages or checkout process only. If you use a shipping calculator, or offer different shipping methods this will fail. Continue reading “WordPress/Shopp Shipping Calculator/Options Access-Control-Allow-Origin Error”

Not your usual WordPress IO Error

Today I noticed I was getting the dreaded WordPress IO Error when uploading media. I’ve fixed this before, for me and other clients but this wasn’t the usual error.

Not  file permissions, not an anally retentive PHP install, not user error. Besides, media uploads worked via the HTTP uploader, just not the Flash uploader. Continue reading “Not your usual WordPress IO Error”