Page 1 of 1

$_get problem

Posted: Mon Jun 28, 2010 6:17 am
by zoyid55
Hello
In my website I have a php page to receive data from get method from ajax file - then send a mail with all the data received by get method - but its not working - the problem is when I send an email address(test@test.com) from get method its not working when I remove @ or dot(.) it works. my working page is (either @ or dot(.) is missing):
process.php?name=name&email=test@test&phone=123123&details=test
process.php?name=name&email=test@test&phone=123123&details=test
not working page
process.php?name=name&email=test@test.com&phone=123123&details=test

is not working because @ and dot(.) both are present at same time and i am receiving the data with $_GET

please help
Thanks in advance

Re: $_get problem

Posted: Mon Jun 28, 2010 8:28 am
by dimxasnewfrozen
It's not really a PHP problem.

You will have to escape those characters in your javascript file where it's doing the AJAX call.

Re: $_get problem

Posted: Mon Jun 28, 2010 8:49 am
by timWebUK
You need to URL encode the email address.

[text]test%40test.com[/text]

Re: $_get problem

Posted: Mon Jun 28, 2010 9:55 am
by AbraCadaver
encodeURIComponent()
or
encodeURI()