ajoutAppareil.php 1.48 KB
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8"/>
		<title>Page principale</title>
		<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css"
		      rel="stylesheet"
		      integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x"
		      crossorigin="anonymous">
		<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/js/bootstrap.bundle.min.js"
			integrity="sha384-gtEjrD/SeCtmISkJkNUaaKMoLD0//E1J19smozuHV6z3Iehds+3Ulb9Bn9Plx0x4"
			crossorigin="anonymous">
		</script>
	</head>
	<body>
		<?php 
			session_start();
			if(isset($_SESSION['identifiant'])){
				$login = $_SESSION['identifiant'];
				echo "Vous etes : $login <br>";
			}else{
				echo "<meta http-equiv=\"refresh\" content=\"0;url=index.html\">";
			}
			include("connexion.php");
			if(isset($_POST['banc']) && isset($_POST['ip']) && isset($_POST['name']) && isset($_POST['type'])){
				$banc = $_POST['banc'];
				$ip = $_POST['ip'];
				$name = $_POST['name'];
				$type = $_POST['type'];
				echo "banc = ".$banc." // ip = ".$ip." // name = ".$name."// type = ".$type."<br>";
				$requete = "INSERT INTO equipement VALUES($banc,'$ip','$name','$type')";
				$exec_requete = mysqli_query($db,$requete);
				echo "<meta http-equiv=\"refresh\" content=\"0;url=gestionAppareil.php\">";
			}else{
				//echo "L'ajout n'a pas fonctionné";
				echo "<meta http-equiv=\"refresh\" content=\"0;url=gestionAppareil.php?erreur=1\">";
			}
			mysqli_close($db);
		?>
	</body>
</html>