DJRobThaMan
11-21-2005, 12:53 AM
Hi,
So I have a website that has code like this example (straight excerpt):
<table cellspacing=0 cellpadding=0 border=0 width="100%">
<tr>
<td style="width:55%;">
<input type="checkbox" name="name31"id="31" onClick="check('3', 1);">
<input type="hidden" name="31" value="thisisatest.doc,Homework #1,">  Homework #1
</td>
<td>thisisatest.doc</td>
</tr>
</table>
This code is within a form and when the submit button is clicked I try to figure out whether the checkbox is checked:
$i = 1;
while($i <= $amount[0])
{
$temp = "name3$i";
if(param($temp) == "on")
{
$temp = "3$i";
substr($stuff, 0, 0) = param($temp);
}
$i = $i + 1;
}
amount just has the value of how many checkboxes there are and as you can see the name of the checkboxes are in the form "name3x" where x is some integer.
Is there some reason why the param($temp) where $temp = "name3$i" isn't recognized as having any value (at least when I try to print it nothing appears) but once I change $temp to "3$i" param($temp) returns a value (as you can see that's the hidden value?
Also, if I substitute $temp with "name31" or any constant value in string form that isn't a variable being passed into the param it works fine. I don't know if that would help in diagnosing the problem.
Anyway, any help would be greatly appreciated.
Thanks,
Douglas
So I have a website that has code like this example (straight excerpt):
<table cellspacing=0 cellpadding=0 border=0 width="100%">
<tr>
<td style="width:55%;">
<input type="checkbox" name="name31"id="31" onClick="check('3', 1);">
<input type="hidden" name="31" value="thisisatest.doc,Homework #1,">  Homework #1
</td>
<td>thisisatest.doc</td>
</tr>
</table>
This code is within a form and when the submit button is clicked I try to figure out whether the checkbox is checked:
$i = 1;
while($i <= $amount[0])
{
$temp = "name3$i";
if(param($temp) == "on")
{
$temp = "3$i";
substr($stuff, 0, 0) = param($temp);
}
$i = $i + 1;
}
amount just has the value of how many checkboxes there are and as you can see the name of the checkboxes are in the form "name3x" where x is some integer.
Is there some reason why the param($temp) where $temp = "name3$i" isn't recognized as having any value (at least when I try to print it nothing appears) but once I change $temp to "3$i" param($temp) returns a value (as you can see that's the hidden value?
Also, if I substitute $temp with "name31" or any constant value in string form that isn't a variable being passed into the param it works fine. I don't know if that would help in diagnosing the problem.
Anyway, any help would be greatly appreciated.
Thanks,
Douglas