This is what I have.
This is add.php (without all the setup code and stuff to make it smaller)
Code: Select all
<?php
$tag = $_GET['tag'];
if($tag == "shop")
{
echo "<br>
<form method ='post' action='verify.php?tag=shop'>
Shop type: <input type='text' name='name' size='32'><br>
Value: <input type='text' name='value' size '12'><br>
Level: <input type='text' name='level' size '3'><br>
Image: <input type='text' name='image' size '32'><br>
<center>
<input type='submit' value='Create Shop'><br>
<A href='index.php'>Back to panel.</a>
</center>";
}
if($tag == "harvest")
{
echo "<br>
<form method ='post' action='verify.php?tag=harvest'>
Name: <input type='text' name='name' size='32'><br>
Type: <input type='text' name='type' size='32'><br>
Modifier: <input type='text' name='mod' size='32'><br>
Modifier Adds: <input type='text' name='modadd' size='3'><br>
Value: <input type='text' name='value' size '12'><br>
Location: <input type='text' name='location' size='32'><br>
Level: <input type='text' name='level' size '3'><br>
Description: <input type='text' name='descrip' size '160'><br>
<center>
<input type='submit' value='Create Harvest'><br>
<A href='index.php'>Back to panel.</a>
</center>";
}
if($tag == "hunt")
{
echo "<br>
<form method ='post' action='verify.php?tag=hunt'>
Name: <input type='text' name='name' size='32'><br>
Animal: <input type='text' name='animal' size='32'><br>
Type: <input type='text' name='type' size='32'><br>
Modifier: <input type='text' name='mod' size='32'><br>
Modifier Adds: <input type='text' name='modadd' size='3'><br>
Value: <input type='text' name='value' size '12'><br>
Location: <input type='text' name='location' size='32'><br>
Level: <input type='text' name='level' size '3'><br>
Description: <input type='text' name='descrip' size '160'><br>
<center>
<input type='submit' value='Create Animal'><br>
<A href='index.php'>Back to panel.</a>
</center>";
}
if($tag == "mineral")
{
echo "<br>
<form method ='post' action='verify.php?tag=mineral'>
Name: <input type='text' name='name' size='32'><br>
Type: <input type='text' name='type' size='32'><br>
Modifier: <input type='text' name='mod' size='32'><br>
Modifier Adds: <input type='text' name='modadd' size='3'><br>
Value: <input type='text' name='value' size '12'><br>
Location: <input type='text' name='location' size='32'><br>
Level: <input type='text' name='level' size '3'><br>
Description: <input type='text' name='descrip' size '160'><br>
<center>
<input type='submit' value='Create Mineral'><br>
<A href='index.php'>Back to panel.</a>
</center>";
}
?>
Code: Select all
<?php
$tag = $_GET['tag'];
if($tag == "shop")
{
$name=$_POST['name'];
$value=$_POST['value'];
$level=$_POST['level'];
$image=$_POST['image'];
$SQL = "INSERT into build_shops(name, price, level, image) VALUES('$name','$value','$level','$image')";
mysql_query($SQL) or die("could not create shop");
}
if($tag == "harvest")
{
$name=$_POST['name'];
$type=$_POST['type'];
$mod=$_POST['mod'];
$modadd=$_POST['modadd'];
$value=$_POST['value'];
$location=$_POST['location'];
$level=$_POST['level'];
$descrip=$_POST['descrip'];
$SQL = "INSERT into harvests(name, type, mod) VALUES('$name','$type','$mod')";
mysql_query($SQL) or die("could not create harvest");
}
if($tag == "hunt")
{
$name=$_POST['name'];
$animal=$_POST['animal'];
$type=$_POST['type'];
$mod=$_POST['mod'];
$modadd=$_POST['modadd'];
$value=$_POST['value'];
$location=$_POST['location'];
$level=$_POST['level'];
$descrip=$_POST['descrip'];
$SQL = "INSERT into hunting(name, animal, type, mod, modadd, value, location, level, descrip) VALUES('$name','$animal','$type','$mod','$modadd','$value','$location','$level','$descrip')";
mysql_query($SQL) or die("could not create animal");
}
if($tag == "mineral")
{
$name=$_POST['name'];
$type=$_POST['type'];
$mod=$_POST['mod'];
$modadd=$_POST['modadd'];
$value=$_POST['value'];
$location=$_POST['location'];
$level=$_POST['level'];
$descrip=$_POST['descrip'];
$SQL = "INSERT into minerals(name, type, mod, modadd, value, location, level, descrip) VALUES('$name','$type','$mod','$modadd','$value','$location','$level','$descrip')";
mysql_query($SQL) or die("could not create mineral");
}
echo "Successfully created.<br>";
echo "<A href='index.php'>Back to panel.</a>";
?>
harvest is setup with these fields: item_id, name, type, mod, modadd, value, location, level, and descrip.
minerals is exactly the same. So is hunting except it has an additional animal field.
I have checked and rechecked everything I can think of. Does anyone else see anything I am missing? Thanks for your time.