[liphp] need help
Bhulipongsanon, Pinyo
[email protected]
Tue, 17 Jun 2003 15:25:26 -0400
My comment has ### in front of it.
-----Original Message-----
From: Venkatagiriyappa, Veena [mailto:[email protected]]
Sent: Tuesday, June 17, 2003 1:24 PM
To: '[email protected]'
Subject: [liphp] need help
Hi,
I have a HTML form with an input type radio button.
Code:
<form action="proposal_cancelled.php" name="cancelproposal" method="POST">
<?
### use $num_proposals = count($proposals);, then check agains
$num_proposals, so that you do not have to evaluate count() multiple times.
This make for better code.
for($i=0;$i<count($proposals);$i++)
{
?>
### missing </td> where I mark ***
<tr>
<td class="text"><b><input type="radio"
name="cancelproposalid" value="<?$proposals[$i]?>"> <?echo
$proposals[$i]?>: </b><?echo get_proposal_title($proposals[$i])?> ***
</tr>
<tr height="10"></tr>
<?}
?>
<tr>
<td align="center" valign="middle"><input type="submit"
name="submit" value="Submit">
<input type="reset" name="reset" value="Reset"></td>
</tr>
</form>
### did you mispelled the actual filename?
In proposal_cacelled.php
PHP:
### use $_POST['cancelproposalid'] instead of $_POST["cancelproposalid"].
Read somewhere that this is better. Not sure why.
<?php
echo "pid is" .$_POST["cancelproposalid"]?>
?>
gives no value. What am I doing wrong here. how do I send the proposalid to
another page in case of radio button? Does the $_POST act different for
radio buttons which has dynamically populated data?(like in this case
proposalid)
### your code should work, unless your PHP does not support $_POST variable.
Try other equivalent.
_______________________________________________
Liphp mailing list
[email protected]
https://www.liphp.org/mailman/listinfo/liphp