Reply
$_POST problem... can't figure it out!
Old 03-27-2006, 12:01 PM $_POST problem... can't figure it out!
Skilled Talker

Posts: 82
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:
PHP Code:
$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&nbsp;&nbsp;<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++; 



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. I am aware that variables can only be parsed when they're in double quotes, but can't get my head around this today for some reason!!

Can anyone tell me what I need to do?

Thanks in advance!
mattcooper is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 03-27-2006, 02:21 PM Re: $_POST problem... can't figure it out!
Super Talker

Posts: 144
$_POST['el_name_'. $i]
__________________
create.vibe
web development portfolio
createvibe.com is offline
Reply With Quote
View Public Profile Visit createvibe.com's homepage!
 
Old 03-27-2006, 02:28 PM Re: $_POST problem... can't figure it out!
Skilled Talker

Posts: 82
Perfect, simple. Thank you!
mattcooper is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to $_POST problem... can't figure it out!
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12904 seconds with 12 queries