Skip to content

Instantly share code, notes, and snippets.

Created March 5, 2017 06:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/aabd55f232f53a60b831d49cc53ff140 to your computer and use it in GitHub Desktop.
Save anonymous/aabd55f232f53a60b831d49cc53ff140 to your computer and use it in GitHub Desktop.
<?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