Archive for July, 2007

Use PHP to get the current page/file name

Friday, July 13th, 2007

I probably already have this posted somewhere, I know I use it a ton but always have to look it up for the exact syntax. Here’s how you can get the name of the current file (ie. if your file is “aboutus.php” this will echo “aboutus.php”)
<?php
$currentFile = $_SERVER["PHP_SELF"];
$parts = Explode(’/', $currentFile);
echo $parts[count($parts) - 1];
?>

I’ve seen variations on it, as I said, I always have to look it up for the exact syntax - but today I found that from here. Also here - which seems to list a bunch of other useful snippets.

Warning: reference to undefined property

Tuesday, July 10th, 2007

The main reason I’ve seen that error come up in javascripts is because a form name or field name has been misspelled somewhere. Tonight, while I combed over every name until my vision was crossed - I discovered a new reason why you might get this error:

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

I was working with CubeCart - and that’s their default. I usually use:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

Hope that saves someone else some pain…

Working with CubeCart

Friday, July 6th, 2007

As I wrote in the comments on this post, I have a new project that needed a shopping cart again. I tried Zen Cart again, and again I quickly remembered why I hated it so much. If I ever even so much as think of trying that package, just hand me the spork to remind me how I wanted to spork my eyes out everytime I use it.* Last time I really liked working with Cube Cart but ran into a problem with shipping and then went on a long hunt for something that did what I needed with shipping, was easy to modify templates, etc. etc. Since this time I didn’t have the same kind of shipping restriction, I figured I’d give Cube Cart another go. So far so good. Customizing has been a breeze. Very intuitive. I’ll be updating this post over the next few days with things I find useful as I work on the project (due next week! Wish me luck! heh)
(more…)

Email fiasco

Wednesday, July 4th, 2007

Something strange happened to my email address (the one that receives comment notifications from this site, of course) - it just sort of disappeared off the server. I’ve set it up again, so everything should be fine now - but if you’ve tried to contact me and I haven’t responded, or if you left a comment on this site and it seemed like it was stuck in moderation forever, I apologize. Everything’s fixed now. (And here I thought I wasn’t getting any email because no one loved me) ;P