Pleasant URLs in PHP

phpRiot.com posted a new article on creating search engine friendly URLs in PHP. I always like to see this topic get attention, there are too many sites on the web that generate very long and difficult to read URLs. Usually this involves transforming GET parameters into part of the URL. Here is an example of a URL using GET parameters:

http://www.example.com/articles/?post_id=987654321


Here is an example using a more pleasant URL:

http://www.example.com/articles/title/nice-php-urls


The phpRiot article goes on to describe different methods for achieving this.

PHP, But Only When Needed

There are times when you only want to have your PHP scripts run when certain conditions have (or haven’t) been met. This technique is often used for caching. A real life example of this is discussed in Serving rendered images at the speed of light. The gist of the story is that a PHP script is used to generate thumbnails of images, but it only needs to be called when a thumbnail doesn’t already exist.

The described solution involved making use of Apache‘s mod_rewrite, so this isn’t a purely PHP solution. If you aren’t already familiar with mod_rewrite that is okay (I’ve used and it is still quite confusing at times), the author covers each step one at a time.

To Suppress Errors Or Not, That Is The Question

This is going to bounce around a bit, so stay close. Tim reminded me of a thread on the php-internals list about disabling the @ operator, which suppresses errors. The desire was to disable the @ operator to help track down errors. There was even a patch included.

Then Derick came to the rescue with a simple runtime solution:

error_reporting(E_ALL ^ (E_RECOVERABLE_ERROR | E_WARNING | E_NOTICE));

I haven’t tested this, but if one call to error_reporting() will do the trick, then I’m all for it.

Trying Out Site5

I’ve been looking for another host and have decided to give Site5 a try. I would have preferred a provider using FreeBSD (like Pair) instead of Linux, but I can deal with that (time to learn more about bash). The other bummer was lack of PostgreSQL support (like Bluehost).

So if you are reading this then you’ve picked up the DNS updates. Let me know if you notice something broken that I’ve missed.

Amanda UnBoomed

I started watching Rocketboom a few months after they started. It tended to be fun and often informative. Eventually I gave up on watching each of the episodes though. I haven’t watched Rocketboom regularly for almost a year, only checking it out when others specifically point out really interesting episodes (like network neutrality).

Today Rocketboom itself made news, with the announcement that Amanda is no longer part of Rocketboom. Turns out that Amanda had a 49% share and Andrew Baron has 51% ownership. In her unboomed announcement Amanda indicated that Andrew was no longer interested in working with her. Since she held minority ownership, out she went.

I haven’t seen anything indicating what Andrew’s side of the story is, so there may be more details that come out later.

In the mean time, what does this mean for Rocketboom?

UPDATE Wed 5 Jul 2006 @ 12:35pm : More info has started to come out. There are reports that Andrew found out Amanda was leaving by watching the unboomed video. This may have started because Amanda wanted to move Rocketboom to L.A., but that Andrew and company weren’t up for that yet. Then of course there are the rumors and Amanda and Andrew were dating and that things started coming undone when they broke up.

UPDATE Wed 5 Jul 2006 @ 3:40pm : There is a statement on rocketboom.com verifying that Amanda left for L.A.. New episodes and an interim host are scheduled to start on Monday, July 10th:

ROCKETBOOM ANNOUNCEMENT:

Amanda Congdon has decided to move to L.A. to pursue opportunities that have arisen for her in Hollywood.

We wanted to meet her demands to move production out to L.A., however, we are a small company and have not been able to figure out a way to make it work, financially and in many other ways at this time. While we continue to remain with open arms, Amanda has in fact quit and left Rocketboom. So sadly, we bid Amanda adieu and wish her all the best.

Rocketboom goes on.

Andrew Baron, the founder and creator of Rocketboom, will stay with the company in New York and will continue to produce and direct the show. We are in the daunting process of recruiting a replacement for Amanda.

While Amanda will be sorely missed, we have big plans for Rocketboom and are determined to make the show better than ever.

After Field Week and a week on hiatus, we know that you are hungry for the news! Rocketboom will be back with a news episode and an interim host this MONDAY, JULY 10.

UPDATE Wed 5 Jul 2006 @ 8:40pm : Wow, the drama continues with Amanda responding in a “for the record” post. Perhaps she should just take Jason’s offer to work at Netscape.

Movie Review: Superman Returns

Sarah and I went to see Superman Returns last Friday. I really wanted to like this movie. I’ve seen all the original Superman movies (yes even 3 and 4) and read my fair share of Superman comics as a kid. Strangely enough, my biggest worry before seeing the movie was having Brandon Routh play Superman. After seeing the movie though he turned out to be one of the better parts of the film. I think he does a good job in the dual roles of Clark Kent and Superman, playing them very much in the same style as Reeve.

I don’t have too many other positive things to say about this movie though. To sum it up, I wasn’t thrilled with the story they tried to tell. I felt like too much of it was very un-Superman like. Just like Star Wars though, it really doesn’t matter how bad it is, you are still going to see it. It is Superman after all.

I’ve opted to not give specific details about my complaints because it would spoil the movie for those who haven’t seen it. Besides, I’m sure you’ll know what I’m talking about after you see it :-)

2.5 out of 5 for a very un-Superman like story line.