Skip to content

Instantly share code, notes, and snippets.

/Post.php
Created Mar 5, 2017

Embed
What would you like to do?
<?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
You can’t perform that action at this time.