My webserver has been crashing ALOT over the past couple of days and the monkey's over @ the hosting company say it is because of one of my scripts. They will not however tell me what script it is, or give me access to there logs. Maybe someone on here can help me...
Here are the only 2 documents I have modified in a month
FIRST
<?
$start_time=microtime();
$direct = "pictures/$dir/images";
$i=0;
$handle=opendir($direct);
while (false!=($file = readdir($handle))) {
if ($file != "." && $file != "..") {
print "<td><a href=# onClick=\"imgWindow=window.open('pictures/$dir/images/$file', 'image','width=660,height=500')\"><img src=pictures/$dir/thumbnails/$file border=0 width=100 height=75></a><br></td>";
++$i;
if($i == $columns) { print "</tr><tr>";
$i = 0;
}
}
}
closedir($handle);
printf("</tr></table>");
$end_time=microtime();
$a=split(' ',$start_time.' '.$end_time);
$time=number_format((($a[2]+$a[3])-($a[0]+$a[1])),5);
printf(" <div align=center><font face=\"arial\" size=\"1\">Page Generated in: $time seconds</font></div> ");
?>
That script simply generates a thumbnail gallery for $dir.
SECOND
<?
$start_time=microtime();
/*--------- DATABASE CONNECTION INFO ---------*/
include("login.inc");
$i=0;
$c=1;
$color=cccccc;
$align=right;
$result = mysql_query("select * from pictures where year = '$year' order by date desc",$db);
while ($myrow = mysql_fetch_row($result)) {
$NAME=mysql_result($result,$i,"name");
$DATE=mysql_result($result,$i,"date");
$VENUE=mysql_result($result,$i,"venue");
$PROMOTER=mysql_result($result,$i,"promoter");
$TALENT=mysql_result($result,$i,"talent");
$DIRECTORY=mysql_result($result,$i,"directory");
$YEAR=mysql_result($result,$i,"year");
$IMAGE=mysql_result($result,$i,"image");
//// OPEN TABLE CELLS ////
if ($c == 1) {
printf("<tr><td valign=top bgcolor=$color>");
}
else {
if ($c == 2) {
printf("<td valign=top bgcolor=$color>");
}
else {
printf("<td valign=top bgcolor=$color>");
}
}
//// CONTENT OF THE TABLE CELLS ////
printf("<a href=\"eventimages.php3?dir=$YEAR/$DIRECTORY\"><img src=\"pictures/$YEAR/$DIRECTORY/thumbnails/$IMAGE\" align=\"$align\" border=\"0\" width=\"100\" height=\"75\"><font face=\"arial\" size=\"2\"><b>$NAME</b></font></a><font face=\"arial\" size=\"1\"><br>$DATE<br>$VENUE<br>$PROMOTER<br>$TALENT</font>");
//// CLOSE TABLE CELLS & ROTATE VARIABLES ////
if ($c == 1) {
printf("</td>");
$c=2; }
else {
if ($c == 2) {
printf("</td>");
$c=3; }
else {
printf("</td></tr>");
$c=1;
if ($align == right) { $align=left; }
else { $align=right; }
}
}
if ($color == cccccc) { $color=ffffff; }
else { $color=cccccc; }
++$i;
}
?>
<tr>
<td width="33%"> </td>
<td width="33%" align="center">
<?
//// PAGE GENERATION TIME ////
$end_time=microtime();
$a=split(' ',$start_time.' '.$end_time);
$time=number_format((($a[2]+$a[3])-($a[0]+$a[1])),5);
printf(" <font face=\"arial\" size=\"1\">Page Generated in: $time seconds</font> ");
?>
this one simply generates a page based on my query...
any help is greatly appreciated....
thanks.
-m