cnelson
02-10-2006, 01:59 AM
heres my code;
if(!isset($mode)) { $mode = 'index'; }
switch($mode) {
case 'index':
?>
<FORM ACTION="<?PHP ECHO "$PHP_SELF"; ?>?mode=process" METHOD="post">
<TABLE cellspacing="3" cellpadding="3" border="1" bordercolor="#000000" WIDTH="100%">
<TR><TD WIDTH="20%"><STRONG>Item Name:</STRONG> </TD><TD WIDTH="80%"><INPUT TYPE="text" SIZE="50" NAME="itemname"> </TD></TR>
<TR><TD WIDTH="20%" valign="top"><STRONG>Item Desc:</STRONG> </TD><TD WIDTH="80%"><TEXTAREA COLS="50" ROWS="4" name="itemdesc"></TEXTAREA> </TD></TR>
</TABLE></FORM>
<?PHP
break;
case 'process':
$itemname = strip_tags($_POST["itemname"]);
$itemdesc = strip_tags($_POST["itemdesc"]);
$query="insert into `item` (itemid,itemname,itemdesc) VALUES ('','$itemname','$itemdesc')";
$result = mysql_query($querycon) or die (mysql_error());
if ($result) {
echo "Item Added";
}
break;
}
?>
heres my error; www.visionstudios.be/ratedata/add.php
could someone please help? thanks. -cnelson. :)
the page is offline right now, but it said it was a pharse error, on line 22?
if(!isset($mode)) { $mode = 'index'; }
switch($mode) {
case 'index':
?>
<FORM ACTION="<?PHP ECHO "$PHP_SELF"; ?>?mode=process" METHOD="post">
<TABLE cellspacing="3" cellpadding="3" border="1" bordercolor="#000000" WIDTH="100%">
<TR><TD WIDTH="20%"><STRONG>Item Name:</STRONG> </TD><TD WIDTH="80%"><INPUT TYPE="text" SIZE="50" NAME="itemname"> </TD></TR>
<TR><TD WIDTH="20%" valign="top"><STRONG>Item Desc:</STRONG> </TD><TD WIDTH="80%"><TEXTAREA COLS="50" ROWS="4" name="itemdesc"></TEXTAREA> </TD></TR>
</TABLE></FORM>
<?PHP
break;
case 'process':
$itemname = strip_tags($_POST["itemname"]);
$itemdesc = strip_tags($_POST["itemdesc"]);
$query="insert into `item` (itemid,itemname,itemdesc) VALUES ('','$itemname','$itemdesc')";
$result = mysql_query($querycon) or die (mysql_error());
if ($result) {
echo "Item Added";
}
break;
}
?>
heres my error; www.visionstudios.be/ratedata/add.php
could someone please help? thanks. -cnelson. :)
the page is offline right now, but it said it was a pharse error, on line 22?