Skip to content Skip to sidebar Skip to footer

How Change Php Email Form (return Section) To Match With Javascript And Html Template?

Recently I posted a question PHP Script not send emails and read lots of similar topics on SO like as AJAX JQUERY HTML EMAIL topics but none of them solved my problem. My problem

Solution 1:

Why you just output the url in php side and then in the javascript side you call the script that you want:

PHP Side

$mail_status = mail($mail_to, $subject, $body_message, $headers);
if ($mail_status) {
    echo"{'url':'contact_page.html#contactSuccess'}";
} else {
    echo"{'url':'contact_page.html#contactError'}";
}

Javascript Side

complete: function(){
   ...
   window.location = s.responseJSON.url
   ...
}

Post a Comment for "How Change Php Email Form (return Section) To Match With Javascript And Html Template?"