Test for valid token.

Whoops. http://lob.li/8pg
While functional in theory, header(location:index.php) will load the index again in the message field with non-functioning javascript