Anyone have any thoughts on this one?

Code: Select all
$obj = $db->Execute("select id from objects where name like %$name%");
Code: Select all
line 15 = echo "<form method='post' name=$item_name>";
line 33 = echo "<input type='hidden' value='ok' name=$item_name>";
line 40 = if (isset($_POST[$item_name]))
Code: Select all
line 15 = echo "<form method='post' name='$item_name'>";
line 33 =echo "<input type='hidden' value='ok' name='$user'>";
line 40 = if (isset($_POST[$user]))
Code: Select all
Uncaught TypeError: Cannot read property 'submit' of undefined
Code: Select all
<a href="#" onclick="document.forms['item_name'].submit();return false;" id="btn_i_have_the_item" class="linkButton">I have the item</a>
Code: Select all
<input type="hidden" value="ok" name="CheeseBurger">
Code: Select all
while(!$result->EOF)
{
$item = $result->fields[3]."<br>";
$b = $db->Execute("select name from objects where id = ?", $item);
$item_name = $b->fields[0];
$field = $result->fields[0];
echo "<form method='post' name='$item_name'>";
$name = strip_tags($result->fields[1])."<br>";
$user = $result->fields[2]."<br>";
$quest =strip_tags($result->fields[4])."<br>";
$wage = $result->fields[5];
$b = $db->Execute("select name from objects where id = ?", $item);
$item_name = $b->fields[0];
global $item_name;
$result->MoveNext();
echo "<b>$name</b>";
echo $quest;
$b = $db->Execute("select name from objects where id = ?", $item);
$item_name = $b->fields[0];
echo "Look for item:<b>$item_name</b>";
echo "<br/>";
echo "I'm willing to pay<b>\n<span style='color:#8A4B08'>$wage Gold</></b>";
echo "<input type='hidden' value='ok' name='$user'>";
echo "<br/>";
SubmitButton("I have the item","$item_name");
echo "<br/>";
echo "<br/>";
echo "</form>";