12-16-2009, 12:56 PM
Thanks
Updated: movie_add.php
added: validation rules
Updated: movie_add.php
added: validation rules
Code:
<?php
include("database/database.php");
include("config/config.php");
// Set variables
$movie = mysql_real_escape_string($_POST['movie']);
$descr = mysql_real_escape_string($_POST['descr']);
$stock = mysql_real_escape_string($_POST['stock']);
// Insert set values
if ($movie == "" or $descr == "" or $stock == "") {
echo "INPUT ERROR";
} else {
mysql_query("INSERT INTO movies
(movie, description, stock) VALUES ('$movie', '$descr', '$stock') ")
or die(mysql_error());
echo "<b>" . $movie . "</b>" . " Added";
}
echo "<br />" . $___adminlink;
?>