Created
March 5, 2017 06:31
-
-
Save anonymous/aabd55f232f53a60b831d49cc53ff140 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php include 'db.php'; ?> | |
<?php | |
if (isset($_POST['submit'])) { | |
$name = $_POST['name']; | |
$body = $_POST['body']; | |
$date = date('Y-m-d'); | |
$query = mysql_query("INSERT INTO post (name,body,postedon) VALUES('$name','$body','$date')"); | |
if ($query) { | |
echo "<script>alert('Posted Successfully!')</script>"; | |
echo "<script>window.open('index.php','_self')</script>"; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment