I have a registration form which worked perfectly for me, now I get errors in the lines on lines 15 21 31 and 32 of the process of saving data, that is to say this:
<?php
require_once "../php/connect.php";
$hoja_mat=$_POST['hoja_mat'];
$año=$_POST['año'];
$semestre=$_POST['semestre'];
$ciclo=$_POST['ciclo'];
$nombres=$_POST['nombres'];
$apellidos=$_POST['apellidos'];
$tipo_docu=$_POST['tipo_docu'];
$numero_docu=$_POST['numero_docu'];
$lugar=$_POST['lugar'];
$fecha_naci=$_POST['fecha_naci'];
$grup=$_POST['grup'];
$rh=$_POST['rh'];
$genero=$_POST['genero'];
$dire=$_POST['dire'];
$ciudad=$_POST['ciudad'];
$estra=$_POST['estra'];
$tele=$_POST['tele'];
$barrio=$_POST['barrio'];
$zona=$_POST['zona'];
$sisben=$_POST['sisben'];
$eps=$_POST['eps'];
$nombre_acu1=$_POST['nombre_acu1'];
$tipo_docu1=$_POST['tipo_docu1'];
$c_c1=$_POST['c_c1'];
$paren=$_POST['paren'];
$dire1=$_POST['dire1'];
$tele1=$_POST['tele1'];
$tele2=$_POST['tele2'];
$situ=$_POST['situ'];
$matri=$_POST['matri'];
$query="INSERT INTO formulario(hoja_mat,año,semestre,ciclo,nombres,apellidos,tipo_docu,numero_docu,lugar,fecha_naci,grup,rh,genero,dire,ciudad,estra,tele,barrio,zona,sisben,eps,nombre_acu1,tipo_docu1,c_c1,paren,dire1,tele1,tele2,situ,matri)
VALUES('$hoja_mat','$año','$semestre','$ciclo','$nombres','$apellidos','$tipo_docu','$numero_docu','$lugar','$fecha_naci','$grup','$rh','$genero','$dire','$ciudad','$estra','$tele','$barrio','$zona','$sisben','$eps','$nombre_acu1','$tipo_docu1','$c_c1','$paren','$dire1','$tele1','$tele2','$situ','$matri')";
if($mysqli->query($query)){
echo("<script>alert('Datos Guardados');
window.location.href='../formulario.php';
</script>
");
}else{
echo("<script>alert('Ocurrio un error');
window.location.href='../formulario.php';
</script>
");
}
How do I have to name them on the form so that I can take them correctly?
These are the errors:
Notice: Undefined index: genre in C: \ xampp \ htdocs \ Latin American \ processes \ saveDrives.php on line 15
Notice: Undefined index: zone in C: \ xampp \ htdocs \ Latin American \ processes \ saveDrives.php on line 21
Notice: Undefined index: situ in C: \ xampp \ htdocs \ Latin American \ processes \ saveDrives.php on line 31
Notice: Undefined index: matri in C: \ xampp \ htdocs \ Latin American \ processes \ saveDrives.php on line 32
the code is this (the zone, site and matri is the same): Gender: Male Female