Skip to content

Instantly share code, notes, and snippets.

@nicolapiz
Created March 2, 2014 17:56
Show Gist options
  • Save nicolapiz/9310650 to your computer and use it in GitHub Desktop.
Save nicolapiz/9310650 to your computer and use it in GitHub Desktop.
fichero php que se encarga de comprobar la existencia del registro y si no ingresarlo. incluie la clase clase.php que nos sirve para el Ej2 y Ej3
<?PHP
include_once ("clase.php");// incluyo las clases a ser usadas
$usu= new Usuario($_POST["id"]);
if($usu->nombre!=""){
echo "1";
}
else
{
$usu->setID($_POST["id"]);
$usu->setNombre($_POST["name"]);
$usu->setApellido($_POST["surname"]);
$usu->save();
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment