Problem with $_POST
Posted: Mon Mar 27, 2006 9:41 am
Hi all,
I'm trying to make a dynamically generated form sticky - successful in every way, except for the textfields generated with the following code:
The test always returns false and displays the defualt text for the textfields instead of the posted value. If I echo out "el_name_2" elsewhere i the page, it's fine. But when I try to do it using the "$i" variable, it doesn't work - even though "$i" is storing the numbers correctly.
Can anyone see what I've done wrong?
Thanks in advance!
I'm trying to make a dynamically generated form sticky - successful in every way, except for the textfields generated with the following code:
Code: Select all
$el_num = $_POST['el_menu'];
$i = 1;
$x = 5;
while($i <= $el_num){
echo "External link # $i<br><input type=\"text\" name=\"el_name_$i\" value=\""; if(isset($_POST['el_name_{$i}'])){ echo $_POST['el_name_{$i}'];}else{ echo "Label"; } echo "\" onFocus=\"MM_setTextOfTextfield('el_name_{$i}','','')\"> Example: Sponsor $i <input type\"text\" name=\"el_url_$i\" value=\""; if(isset($_POST['el_url_{$i}'])){ echo $_POST['el_url_{$i}'];}else{ echo "URL"; } echo "\" onFocus=\"MM_setTextOfTextfield('el_url_{$i}','','')\"><a href=\"help.php?context=el_urls\" target=\"_blank\"><img src=\"images/help.gif\" border=\"0\"></a><br>";
$i++;
}
}
}Can anyone see what I've done wrong?
Thanks in advance!