- Impact
- 91
hi
as always please tell me what am i doing wrong in this?
out put of this http://www.champrock.uk.to/demo/list.php
this outputs the html code as
if i rearrange this code properly and run it as a html file then it works fine.
therefore i guess the problem is with these arrangement and the new lines that are being created before ' onclick
thanks
as always please tell me what am i doing wrong in this?
Code:
<?php
$list = file('list.txt');
srand((float)microtime() * 1000000);
shuffle($list);
echo '<html><br><select multiple name="crap" size="10">';
foreach ($list as $url) {
$u= "<option value='$url' onclick=\"window.location='$url'\"><b>$url</b></option>";
echo $u;
}
echo '</select>';
?>
this outputs the html code as
Code:
<html><br><select multiple name="crap" size="10"><option value='http://mail.yahoo.com
' onclick="window.location='http://mail.yahoo.com
'"><b>http://mail.yahoo.com
</b></option><option value='http://gmail.com
' onclick="window.location='http://gmail.com
'"><b>http://gmail.com
</b></option><option value='http://yahoo.com
' onclick="window.location='http://yahoo.com
'"><b>http://yahoo.com
</b></option><option value='http://airb.us.to
' onclick="window.location='http://airb.us.to
'"><b>http://airb.us.to
</b></option><option value='http://google.com
' onclick="window.location='http://google.com
'"><b>http://google.com
</b></option></select>
if i rearrange this code properly and run it as a html file then it works fine.
therefore i guess the problem is with these arrangement and the new lines that are being created before ' onclick
thanks
Last edited:














