Hello guys,
I have to send mail before submitting my php page, I am submitting the page using javascript. my mail script is in sendmails.php file. so can I send an ajax request to send mail before submitting the page using java script ? like follows
function submit_page()
{
//trying to run send_mail.php
..............................//ajax codes
............................
xmlhttp.open("GET","send_mail.php",true);
xmlhttp.send();
.................................
if(a)
form.action = 'one.php'
else
form.action = 'two.php'
form.submit()//form submitting using javascript
}
Will it run the send_mail.php file in the server ?
Thank you