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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
| <!doctype html>
<?php
$var1 = new mysqli('localhost', 'phil', '', 'shoutbox');
if ($var1) {
printf("Tabarnak de Criss ca marche pas: %s\n", mysqli_connect_error());
exit();
}
$var2 = "INSERT INTO messagetexte ('date', 'message') VALUES (date, message,)";
if (mysqli_query($var1,$var2)) {
echo "nouvelle entrer";
}
$stmt = $var2->prepare("INSERT INTO messagetexte (message) VALUES(?);");
$stmt->bind_param($_POST['message']);
$stmt->execute();
if ($stmt->errno != 0) {
echo $stmt->error;
} else {
header('location: history.php');
}
$var1->close();
die();
?>
<html>
<head>
<meta charset="utf-8">
<title>intégration</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<header id="entete">Philippe Paré</header>
<div id="principale">
<div id="onglet1">shoutbox</div>
<a href="history.php">
<div id="onglet2">messages</div>
</a>
<form method="post">
<textarea input type="text" placeholder="messages"></textarea>
<input type="submit" value="envoyer" />
</form>
</div>
<div class="footer">TP1-ShoutBox</div>
</body>
</html> |
Partager