Thank you for the replies and I solved it. I tried running the require statement in a separate script and it worked fine so I looked over it for the 6th time and I realised there was no ';' at the end of 'Provide a name and valid email.'
I can't believe I missed it when it was such a simple problem. I checked this thing so many times yesturday.