Depending on your needs, it may make more sense to do this in Javascript, so the results appear instantly rather than people having to submit a form. But I have over a decade of programming experience in both PHP and Javascript, so I have you covered either way you want to do this.