Question

I'm trying to post form data in a lightbox through jQuery and php. There are only 3 field values I need to pass. I do not get any errors on submit, but the emails aren't sending. I'm noticing (through Firebug) that the email addresses that are being entered into a textbox (which are the email addresses the form sends to) are being sent as: '%40' instead of '@'. Has anyone experienced this or know why/how to fix this issue?
My jQuery function is as follows:

$('#notify form').submit(function(){
  $.post('path/to/action/to/send/email', { id: $("#id").val(), client_reviews: $("#client_reviewers").val(), client_reviewers_msg: $("#client_reviewers_msg").val() }, function(){
  tb_remove();
  $('#client_reviewers').val('');
  $('#client_reviewers_msg').val('');
});
return false;

});

thanks in advance for any help. j

Was it helpful?

Solution

What you're seeing is URL encoding.

Basically, the @ is a special character in a URL. So when you submit a field with a special character in it, it has to be escaped. This is most useful in a GET request where the field values actually end up in the URL, but a POST request follows the same rules.

In PHP, you can use the urldecode function to decode this.

OTHER TIPS

%40 is the URL representation of the @ sign. You'll need to URLDecrypt the email in php.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top