| 12345678910111213141516171819202122232425262728 |
- <?php
- include_once(__DIR__ . "/auth.php");
- include_once("requestDB.php");
- if (isset($_POST["message"])){
- queryw("INSERT INTO `post` (`postid`, `username`, `content`, `posttime`) VALUES (NULL, '" . $_SESSION['login'] . "', '" . $_POST["message"] . "', CURRENT_TIMESTAMP)","teabag");
- }
- header("Location: index.php");
- /*
- $conn = mysqli_connect("localhost","root","","message");
- if($conn->connect_error)
- {
- echo "Unable to connect to database";
- exit;
- }
- //$sql = "INSERT INTO `message` (`user`, `datetime`, `messgae`, `id`) VALUES ('".$_SESSION['login']."', current_timestamp(), '".$_POST[message]."', NULL);";
- $stmt = $conn->prepare("INSERT INTO `message` (`user`, `datetime`, `messgae`, `id`) VALUES (?, current_timestamp(),?, NULL);");
- $stmt->bind_param("ss", $_SESSION['login'], $_POST[message]);
- $stmt->execute();
- $stmt->close();
- $conn->close();
- header("Location: index.php");
- */
- ?>
|