If you want to use a 302 redirect, change the redirect line:
$redirect = 302;
If you don't want to use one, you'll need to comment out the redirect codes (keep in mind i'm using an old version, and i am not sure if the latest build doesn't allow you to turn it off with a simple tick).