1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| <?php
session_start();
if(!$_SESSION['candidat']){
header('location:connect.php');
}else
{
//conection:
$link = mysqli_connect("127.0.0.1","**","**","**") or die("Error " . mysqli_error($link));
//consultation:
$cne=$_SESSION['candidat'];
$choices="";
foreach($_POST['choix'] as $choix)
{
$choices .= ", ".$choix;
}
$query1 = "update listemodulereinscription set status=1 where cne='".$cne."' and IDMODULE IN (.$choices.) " or die("Error in the consult.." . mysqli_error($link));
//execute the query.
$result1 = $link->query($query1);
}
if($result1)
{
$query2 = "update compte_candidat set statut_SA=1 where cne='".$cne."' " or die("Error in the consult.." . mysqli_error($link));
//execute the query.
$result2 = $link->query($query2);
header('Location: ../reinsc_SP.php');
}else{
header('Location: ../error.php');
}
?> |
Partager