Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help cleaning up code
#5
Thanks Smile

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


Messages In This Thread
Help cleaning up code - by Gonzo - 12-16-2009, 11:49 AM
RE: Help cleaning up code - by Gaijin - 12-16-2009, 12:20 PM
RE: Help cleaning up code - by Gonzo - 12-16-2009, 12:30 PM
RE: Help cleaning up code - by Gaijin - 12-16-2009, 12:49 PM
RE: Help cleaning up code - by Gonzo - 12-16-2009, 12:56 PM
RE: Help cleaning up code - by Omniscient - 12-16-2009, 02:13 PM
RE: Help cleaning up code - by wat - 12-21-2009, 02:55 PM

Forum Jump:


Users browsing this thread: 5 Guest(s)