Web Hosting Talk







View Full Version : PHP/MySQL: Results not populating hidden form field


fluffels
04-29-2008, 03:00 AM
I'm having some issues with a PHP/MySQL function on one of my pages.

This is the code:

while($row = mysql_fetch_array($result, MYSQL_NUM))
{
list($member_id, $firstname, $lastname) = $row;
$content .= "<li>
<a href=\"list-users.php?uid=$member_id\">$firstname $lastname</a>
<form action=\"exec-user-status.php\" method=\"post\">
<input type=\"hidden\" name=\"memact\" value=\"$member_id\" />
<input type=\"hidden\" name=\"action\" value=\"disable\" />
<a href=\"#\" onclick=\"document.forms[0].submit();\">Disable</a>
</form>
</li>\r\n";
}


The problem lies with the second instance of $member_id. It will output on the page without issue unless it's in the hidden input value shown above.

Anyone got any ideas? It is actually driving me nuts - I've never had any issues with this kind of thing before... :rolleyes:

Comments and solutions appreciated :)

kingaman
04-29-2008, 07:58 PM
try
".$member_id." within the value - it's a much better way of outputting the page variables.