tags:

views:

30

answers:

2

Here is my code:

echo "<table class='forum'>
<tr>
<td class='forum'><b>Enter Response Here:</b></td>
</tr>
<form action='a_insert.php?id=" . $answerid . " method=post>
<tr class='forum'>
<td class='forum'><textarea rows='5' cols='80' name='cBody'></textarea></td>
</tr>
<tr class='forum'>
<td><input type='submit' value='submit'></td></tr>
</form></table><br><br>";

It's currently passing "cBody" instead of $answerid like I want it to. How do I fix this?

Thanks everyone for their help.

+5  A: 

You should add that id as an input in the form, not part of a query string when the form is being sent by POST.

<input type="hidden" name="id" value="<?php echo $answerid; ?>" />

Dan Grossman
Perfect, thanks so much!
BigMike
A: 

You're missing a closing quote here:

<form action='a_insert.php?id=" . $answerid . " method=post>

It should be:

<form action='a_insert.php?id=" . $answerid . "' method=post>

However you should be using code like this:

<table class="forum">
<tr>
<td class="forum"><b>Enter Response Here:</b></td>
</tr>
<form action="a_insert.php?id=<?php echo $answerid?>" method="post">
<tr class="forum">
<td class="forum"><textarea rows="5" cols="80" name="cBody"></textarea></td>
</tr>
<tr class="forum">
<td><input type="submit" value="submit"></td></tr>
</form></table><br><br>
mellowsoon