<html>
<body>
<form method="post" action="additem.php">
<p>NAME :
<input type="Text" name="name">
<br>
DESCRIPTION:
<input type="Text" name="description">
<br>
IMAGE :
<input type="file" name="image">
<br>
CATEGORY :
<input type="Text" name="catagory">
<br>
GUEST PRICE :
<input type="Text" name="guest_price">
<br>
MEMBER PRICE :
<input type="Text" name="member_price">
<br>
STOCK LEVEL :
<input type="Text" name="stock_level">
<br>
</p>
<input type="Submit" name="enter" value="Confirm Details">
</p>
</form>
<?php
include ("constants.inc");
$name = $POST['name'];
$description = $POST['description'];
$image = $POST['image'];
$catagory = $POST['catagory'];
$guest_price = $POST['guest_price'];
$member_price = $POST['member_price'];
$stock_level = $_POST['stock_level'];
$connection = mysql_connect($GLOBALS['host'],$GLOBALS['user'],$GLOBALS['pass']) or die ("couldn't connect to server");
$db = mysql_select_db ($GLOBALS['db_name'], $connection) or die ("Unable to select the database");
$query = "INSERT INTO stock (name, description, image, catagory, guest_price, member_price, stock_level)
VALUES ('$name', '$description', '$image', '$catagory', '$guest_price', '$member_price', '$stock_level')";
$result = mysql_query($query);
if ($result) {echo ("Item $name has been inserted into the database" );}
mysql_close();
?>
</body>
</html>
new file constants.php
<?php
$GLOBALS['db_name'] = 'dhstshop';
$GLOBALS['host'] = 'localhost';
$GLOBALS['user'] = 'root';
$GLOBALS['pass'] = 'password';
$GLOBALS['thumbw'] = 100; //The Width Of The Thumbnails
$GLOBALS['thumbh'] = 100; //The Height Of The Thumbnails
$GLOBALS['imagepath'] = "/shop/admin/images/"; //Path To Place Where Images Are Uploaded. No Trailing Slash
$GLOBALS['thumbpath'] = "/shop/admin/images/thumbs/"; //Path To Place Where Thumbnails Are Uploaded. No Trailing Slash
?>