|
Posted by AnrDaemon on 10/17/07 11:59
Greetings, dba.
In reply to Your message dated 17 октября 2007 г., 05:19:43,
d> Without giving a lot of script at this time, I am having a problem with
d> php and form input type="hidden". Problem is that the hidden variable
d> displays last line from database query.
d> Some code.
[snip]
d> produces this from form:
[snip]
d> after selection from form $_POST produces
d> correct name "Dant, Norbert" but grabs last number "0005" and not "0020".
First, to lower chance of messing with output, use templates.
Second... Don't forget to escape output.
That way, Your code may looks like this
<?php
if ($field_name=="member_lname")
{
$_name = htmlspecialchars($result['member_lname'] . ', ' . $result['member_fname']);
$_id = $result['member_id'];
echo "<input type='radio' name='selection' value='{$_name}'/>$_name<br />";
echo "<input type='hidden' name='member_id' value='{$_id}'/>";
}
?>
Good luck with this code :)
P.S.
Aside from that, I think You would be better with
echo "<input type='radio' name='selection' value='{$_id}'/>$_name<br />";
--
Sincerely Yours, AnrDaemon <anrdaemon@freemail.ru>
Navigation:
[Reply to this message]
|