Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //header('Location: Quastions2.php');
- include'inc.db.Answers.php';
- $conn = mysqli_connect($hostname, $username, $password, $dbname);
- mysqli_set_charset( $link, "utf8" );
- // Check connection
- if (!$conn) {
- die("Connection failed: " . mysqli_connect_error());
- }
- if(isset($_POST['submitComment'])){
- $qid = $_POST['qid'];
- //$date = $_POST['date'];
- //$client = $_POST['client'];
- $text = $_POST['text'];
- // $report = $_POST['Report'];
- $sql = "INSERT INTO Answers (qid, date, client, text)
- VALUES ('$qid', CURRENT_TIMESTAMP, '{$_SERVER['REMOTE_ADDR']}', '$text')";
- if (mysqli_query($conn, $sql)) {
- echo "New record created successfully";
- } else {
- echo "Error: " . $sql . "<br>" . mysqli_error($conn);
- }
- }
- mysqli_close($conn);
- header("Location: Questions.php");
- ?>
Advertisement
Add Comment
Please, Sign In to add comment