<?php

include("./access.php");

if(isset($_POST['cle'])&&($_POST['cle']!='')&&($_POST['nom']!=''))
{

 $queradd = "UPDATE referents SET
 nom='".addslashes($_POST['nom'])."',
 mobile='".$_POST['mobile']."'
 WHERE cle='".$_POST['cle']."'";
  $resultadd = mysqli_query($connect,$queradd);

  
}
elseif($_POST['nom']!='')
{

 $queradd = "INSERT INTO referents SET
 nom='".addslashes($_POST['nom'])."',
 mobile='".$_POST['mobile']."'";
  $resultadd = mysqli_query($connect,$queradd);
}

  header("location: index.php");
?>