Fix javascript

you need to validate what the javascript sends to the php, or else you will get hacked