initial commit
This commit is contained in:
21
alumnos/register_post.php
Normal file
21
alumnos/register_post.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
require_once('../models/alumno.php');
|
||||
require_once('../rut_validacion.php');
|
||||
|
||||
$rut = $_POST['rut'];
|
||||
if(!validar_rut($rut)){
|
||||
echo "ERROR";
|
||||
header("location: /alumnos/registrar.php");
|
||||
var_dump("OH NO");
|
||||
exit();
|
||||
}
|
||||
|
||||
$alumno = new Alumno();
|
||||
$alumno->set_rut($_POST['rut']);
|
||||
$alumno->set_nombre($_POST['nombre']);
|
||||
|
||||
if($alumno->save())
|
||||
{
|
||||
header("location: /alumnos/index.php");
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user