<form action='index.php' method='post'> <input type='submit' name='show' value='Make a post!'> </form>
if ($_POST['show']) { //echoing out another button with the name, submit echo "<form action='index.php' method='POST'> <input type='submit' style='width: 175px;' name='submit' value='post'> </form>"; //and some text boxes!
if ($_POST['submit']) { $name = $_POST['name']; $email = $_POST['email']; $message = $_POST['message']; $date = date("Y-m-d"); $time = date("H:i:S"); if ($name&&$email&&$message) { $querypost = mysql_query("INSERT INTO blog VALUES ('','$name','$email','$message','$date','$time')"); echo "Please wait... <meta http-equiv='refresh' content='2'>"; } else echo 'Please fill out all fields'; }
isset
if (isset($_POST['submit']))
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)