<?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