Home › Forums › Back End › Contact Me PHP Help › Reply To: Contact Me PHP Help
September 23, 2014 at 6:51 am
#184356
Participant
Technically, yes. At least if you are using jQuery.
But you will have to interpret the serialized data on the PHP side. I have not idea what serialize()
function is doing and don’t know how to handle it in PHP, not until I try this on my own.
Also I would recomment to return data back from PHP side to make sure to display the correct message. You can’t automatically asume that the message was sent.
If you output something in the PHP file (simple echo
would be fine) you can read it in the success callback, so let’s assume we don’t get anything returned from the PHP file if the message is sent:
success: function (data) {
if(data.length > 0) {
alert('something went wrong');
//I usually console.log(data) to see what I get from PHP
} else {
alert('Your message has been sent. Thank you for contacting.');
}
}