basic help needed
Posted: Sun Mar 16, 2003 9:56 pm
Im trying to write a script which retrives an image from a friends server and then puts them into a table, not all people have pictures though so the script has to be able to put in place a default image if theres dosent work, it also puts there name under the image.. heres what I have so far, I am aware there's probably easier ways of doing it..but im learning...the script partially works, the table wont format correctly and it seems to time out on the 8th try?? help anyone? thanks in advance.
<?php
print "<table border=1>\n";
for ( $y=1; $y<=6; $y++ )
{
print "<tr>\n";
for ( $x=1; $x<=6; $x++ )
{
$name = array(1 => 'john','ralph','help','test','fruit','loop','bacon','bacon', );
for ($i=1; $i<=8; $i++ ){
print "\t<td>";
{$url="http://specified url{$name[$i]}.gif";
$size = getimagesize ("{$url}");
$imagewd=$size[0];
$fp=fopen("{$url}" ,"rb");
if ($imagewd == 100)
{print "<img src={$url}>"; }
elseif ($imagewd < 100)
{print "<img src=http://default graphic/blank.gif>"; }//20
{print ("<br>");}
{print ("<a href=http://specified url{$name[$i]}>{$name[$i]}</a>"); } }
}
print "</td>\n";
}
print "</tr>\n";
}
print "</table>";
?>
<?php
print "<table border=1>\n";
for ( $y=1; $y<=6; $y++ )
{
print "<tr>\n";
for ( $x=1; $x<=6; $x++ )
{
$name = array(1 => 'john','ralph','help','test','fruit','loop','bacon','bacon', );
for ($i=1; $i<=8; $i++ ){
print "\t<td>";
{$url="http://specified url{$name[$i]}.gif";
$size = getimagesize ("{$url}");
$imagewd=$size[0];
$fp=fopen("{$url}" ,"rb");
if ($imagewd == 100)
{print "<img src={$url}>"; }
elseif ($imagewd < 100)
{print "<img src=http://default graphic/blank.gif>"; }//20
{print ("<br>");}
{print ("<a href=http://specified url{$name[$i]}>{$name[$i]}</a>"); } }
}
print "</td>\n";
}
print "</tr>\n";
}
print "</table>";
?>