September 17, 2009

Simple query strings

Often times a developer will want to pass a piece of information between pages on his website. While the most desirable method to do this is via a form, sometime this just isn’t possible. During these times, it’s time to turn to query strings.

Query strings are a bit of a confusing concept, mostly because of their name. If you ignore the terminology, it is just a way for you to pass information between pages on a website using the url. This is the key to Query strings. They make your url go from this

index.php

to this:

index.php?q1=something&q2=somethingelse

And that’s all a query string is. When a user sees a link like that in the location bar in their browser what they are really seeing is index.php but with a little added information passed to it.

How do you do it?

Creating query strings is ridiculously simple. Say you want to pass an id to news.php. You would like it like this:

<a href="index.php?id=4">Link to index.php with id 4</a>

If you wanted to pass an id and another value, you would do it like this:

<a href="index.php?id=4&another=value">Link to index.php with id 4 and another value</a>

And that’s it. If a user clicks on that link they will be directed to index.php with your query string attached!

How do I get that information?

Writing the query string, of course, is only half the battle. The other half is actually reading that query string. This is where the $_GET array comes into play. $_GET is built into PHP and provides you access to the values after the ? in query strings. Since $_GET is an array, the key that you will use to access your values, are their names!

A little confusing, but let me give you a quick breakdown using one of our query strings:

key = id
value = 4

So that means, to get that value 4, we would need to use $_GET['id'].

If we follow that logic, then to get the value of “another” we would use $_GET['another'].

Summary

Query strings are a little confusing until you realize that they’re just a way of passing variables through the url.

Still confused? Post your questions in the comments or send me an email!

September 15, 2009

I’ve been Binged.

Bing!

I’ve always been a little apprehensive of new Microsoft products, but this year they’ve continued to surprise me. First there was the beta version of Windows 7, which rendered my usual quip about not using anything beta and by Microsoft fairly useless (Why don’t you just wait till it comes out? It’ll be buggy enough to SEEM like it’s in beta). And now Bing. I’ve tried my very hardest to hate it and to think that Google was the clear winner, but I just couldn’t do it.

Before I begin comparing the two, let me just say that I’m still a huge Google fan. I’ve been since I started using computers and when they launched gMail, I actually paid for a beta invite. I’ve been using gMail and converting people to Google ever since. I know that by using Google so much they pretty much own my data, but I don’t care. I know I’ll continue to use them.

That being said, I hope they take a few pages from Microsoft.

Bing works. I know there’s the whole oxymoron joke going around about “Microsoft Works” but Bing really does work. I spent 4 days using Google to do some research for my day job. I can’t speak about WHAT I was looking for (I believe it falls under confidentiality agreements and such) but suffice it to say that I thought it should be fairly easy to find. It wasn’t. I wasted about 4 days worth of time looking things up. Then on a whim I decided to check out Bing. Imagine my surprise when the first time I ever use it it shows me exactly the results that I’d been hoping to find. Despite all our anecdotes about books and judges, first impressions really do matter. And Microsoft really hit it. I was actually floored. It made me consider how well the other Live services were coming along.

I haven’t had a chance to test out ALL of Bings options, but another thing I loved was the ability to keep scrolling during image searches. I hate page reloads and generally anything that might slow down my multi-tasking, and so being able to scroll through hundreds of images in one go was a great idea.

Currently I use Bing for all my searches and have been for the past few days. The only thing I really don’t like is the very busy interface that they have but I’m willing to give Microsoft the benefit of the doubt with this one. Things are really easy to see, and I like the addition excerpt feature, so I can live with the busy interface.

Now I can’t vouch for the rest of the Live services, but I WILL say that I really like the idea of the Live platform and being powered by Bing search I think Microsoft really has a chance to change peoples perceptions of them…

September 6, 2009

Rising Legends launches version 0.1b

After messing the database for almost an hour trying to configure everything properly, I can officially announce that the latest version of Rising Legends (0.1b –> the b signifies beta) is out!

You can access it at http://boba.feethavebeen.com and you can access the forums at http://boba.feethavebeen.com/forum/

As a bonus to everyone, I managed to keep all your characters and just reset everything instead. You have lost all gold and items, and all your stats have been reverted to that of a level 1. This was necessary as the next step in the game is content and balancing so I needed everyone to start at the same place and work their way up. Testing various monsters/items.

There are about 11 monsters I believe, scattered between two zones. The first being Deepgate, which is the starting zone, and Candlewood. I can tell you now, it’s a waste of time going into Candlewood unless you are at least level 11 or 12. At least then you won’t die in a couple of hits.

There is also the mapping system which is VERY basic at the moment. Here is the legend:

  1. @ = you
  2. = = portal
  3. s = shop
  4. t = tavern

When you move over a portal, shop or tavern the “interact” link appears which will let you use that particular service.

At this stage I am also looking for suggestions, so PLEASE head over to the forums and post away. Not all suggestions will be incorporated into the game, but you never know.

Finally, I just want to thank everyone who helped out with running everything namely Felipe, Sebastian and Greg. Between them they found pretty much all the bugs with prior versions, extensively tested (we’re talking level 100+ in a game that had 3 monters) the game and had plenty of suggestions that were incorporated into the alpha version.