Hello guys ,
I am getting crazy with this html thing , i just don't know why its not working as expected.
Basically i need to display php variable in html
Let see the code....
Suppose i have this
<?php
for($x = 0;$x <count($_FILES['image']['name']);$x++) {
$url = something;
}
//The value of $url changes at every instance of loop(i.e for each value of $x)
?>
Now i want to output each instance of $url in html below
<?php for($x = 0;$x <count($_FILES['image']['name']);$x++) : ?>
<center><td><input type="text" size="50" value="<?php echo $url ?>"/></td><center>
<?php endfor; ?>
The problem with this code is that **only the FIRST** value of `$url` get output. say the first value of $url is
`$url = 'http://www.daniweb.com'`
I get output
<center><td><input type="text" size="50" value="http://www.daniweb.com"/></td><center>
This is good but now imagine the value of $url become `http://www.daniweb.com` and `http://www.google.com` during the loop
I need to get an output as follows
<center><td><input type="text" size="50" value="http://www.daniweb.com"/></td><center>
<center><td><input type="text" size="50" value="http://www.google.com"/></td><center>
With my present code i get
<center><td><input type="text" size="50" value="http://www.daniweb.com"/></td><center>
<center><td><input type="text" size="50" value="http://www.daniweb.com"/></td><center>
Thanks for the help guys
Sorry for putting code tags everywhere but i keep getting
The code snippet in your post is formatted incorrectly. Please use the Code button in the editor toolbar when posting whitespace-sensitive text or curly braces.