|
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]
|