Fully working version of personalisation

Got rid of the 500 server error, at last.
Had output printed before the redirect instruction