I've searched the forum and didn't understand what to do. When I go to my php page by just typing the page it adds a blank row to my database. When I refresh my php page it adds a blank row to my database. How can I prevent this?
<?php
include("../db/db_connect.php");
include("templates/header.php");
mysql_query("INSERT INTO categories (name) VALUE ('$_POST[name]')");
if (isset($_POST['submit'])) {
echo $_POST['name'];
echo ' have been added to the category section';
}
?>
<br />
<br />
<form action="category.php" method="post">
Add Category <input type="text" name="name" size="50" /> <input type="submit" name="submit" value="Submit" />
</form>
<?php
include("templates/footer.php");
?>