You are here: Re: Getting the dynamic 'name' with $_REQUEST[] , Pls help « PHP Programming Language « IT news, forums, messages
Re: Getting the dynamic 'name' with $_REQUEST[] , Pls help

Posted by Rami Elomaa on 06/27/07 07:03

Jerry Stuckle kirjoitti:
> Rami Elomaa wrote:
>> sathyashrayan kirjoitti:
>>>
>>> print "More Url $i:<input type='text' name='url_comp_'.$i><br>";
>>>
>>
>> The line above is producing malformed html, it will print:
>>
>> More Url 1:<input type='text' name='url_comp_'.1><br>
>> This is just wrong. The browser will take the name as url_comp_ and
>> wonder what the heck the .1 is doing there but not taking them into
>> account.
>>
>> I assume you wanted:
>> More Url 1:<input type='text' name='url_comp_1'><br>
>>
>> To get that, change the code like this:
>> print "More Url $i:<input type='text' name='url_comp_$i'><br>";
>>
>>
>
> Actually, it will print:
>
> More Url 1:<input type='text' name='url_comp_1'><br>"
>
> Which is correct.
>

Nope, the script _is_ incorrect and here's an easy way to test it:

Here is my test script:
<?php
$i = 1;
print "More Url $i:<input type='text' name='url_comp_'.$i><br>";
?>

Here is my output:
More Url 1:<input type='text' name='url_comp_'.1><br>

See what I mean?

--
Rami.Elomaa@gmail.com

"Wikipedia on vähän niinq internetin raamattu, kukaan ei pohjimmiltaan
usko siihen ja kukaan ei tiedä mikä pitää paikkansa." -- z00ze

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация