I'm trying to send a form, but when sending the page does not reload, for that I'm using ajax and then to save them PHP, but I have the following problem, he says Notice: Undefined index: mail in C: \ xampp \ htdocs \ send \ formsubs.php on line 2
HTML CODE
<form class="form-subs" id="form-sub" method="post" onsubmit="return subs();">
<input type="email" id="correo" name="correo" placeholder=" Correo electronico"><br>
<input type="submit" name="submit" id="send1" value="Enviar">
</form>
JavaScript CODE
function subs() {
var correo = document.getElementById('correo').value;
//var fdata = 'correo='+correo;
$.ajax({
type:'post',
url:'../send/formsubs.php',
data: 'correo='+correo,
success:function(msgsub) {
$("#send1").hide(function() {
$("#load2").fadeIn(function() {
$("#load2").delay(1000).fadeOut(function() {
$("#sub-res").html(msgsub);
});
});
});
}
});
return false;
}
AND THE PHP CODE STILL NOT FINISHED
<?php
$correo = $_REQUEST['correo'];
echo $correo;
?>
If someone could help me I would be very grateful !!!