ช่วยทีคร๊าบบบ..เกี่ยวกับรูปภาพ Fatal error: Maximum execution time of 30 seconds exceeded
Fatal error: Maximum execution time of 30 seconds exceeded in
c:\AppServ\www\newsuannan\admin\images_add.php on line 66
=========================================================
============= file images_add.php ===========================
<? include("session_admin.php"); ?>
<?php include('../connections/connectdb.php'); ?>
<html>
<head>
<title></title>
<link href="../css/styles.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="798" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC">
<tr>
<td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3"><?php include "admin_headder.php";?></td>
</tr>
<tr>
<td width="185" valign="top"><?php include "admin_menu.php";?></td>
<td width="4" background="images_admin/line2.gif"> </td>
<td width="609" valign="top">
<center><h3>
<?php
echo"<br><br><br><br><br><br>";
echo"<center><h3>";
echo"<img src=\"images_admin/progress.gif\"><br>";
echo"<font color=#0000CC>Please Wait ...</font>";
echo"</center>";
for ($x = 1; $x <=10; $x++) {
/*=================ก็อบปี้รูปภาพ นักศึกษา===================*/
$pic="pic".$x;
$description="de".$x;
$desc=$_POST[$description];
$today=date("YMd" );
$totime=date("his");
$pic_name =$group_id.$today.$totime.$x;
$photo_tmp=$HTTP_POST_FILES[$pic]['tmp_name'];
$photo_name=$HTTP_POST_FILES[$pic]['name'];
$photo_type=$HTTP_POST_FILES[$pic]['type'];
$photo_size=$HTTP_POST_FILES[$pic]['size'];
if($photo_tmp<>""){
//move_uploaded_file($photo_tmp,"./photo/".$photo_name);
if($HTTP_POST_FILES[$pic]['type']=="image/gif"){ $ftype="gif"; }
if($HTTP_POST_FILES[$pic]['type']=="image/pjpeg"){ $ftype="jpg"; }
if($HTTP_POST_FILES[$pic]['type']=="image/x-png"){ $ftype="png"; }
if ($ftype=="gif") {
$imgc=ImageCreateFromGIF;
$imgj=ImageGIF; }
if ($ftype=="png") {
$imgc=ImageCreateFromPNG;
$imgj=ImagePNG; }
if ($ftype=="jpg") {
$imgc=ImageCreateFromJPEG;
$imgj=ImageJPEG; }
//----------------------------------- Resize --------------------------------------/
$images = $photo_tmp;
//กำหนดความสูงของรูปใหม่
$height=768;
$size=GetimageSize($images);
$width=round($height*$size[0]/$size[1]);
$images_orig = $imgc($images);
$photoX = ImagesX($images_orig);
$photoY = ImagesY($images_orig);
$images_fin = ImageCreateTrueColor($width, $height);
ImageCopyResampled($images_fin, $images_orig, 0, 0, 0, 0, $width+1, $height+1, $photoX, $photoY);
$imgj($images_fin,"../images_upload/gallery_activities_big/".$pic_name.".".$ftype);
ImageDestroy($images_orig);
ImageDestroy($images_fin);
$pic_name2=$pic_name.".".$ftype;
//-------------------------------------------------------------------------------------------/
#เริ่มสร้างภาพขนาดเล็กหรือใหญ่ตามต้องการ
$ThumbPhoto="../images_upload/gallery_activities_big/";
$ThumbFile=$ThumbPhoto.$pic_name2;
$ThumbH=130;
$Quality=100;
List($SourceW,$SourceH)=GetImageSize($ThumbFile);
$Percent=$ThumbH/$SourceH ;
$ThumbW=$SourceW*$Percent;
$ImgTarget=ImageCreateTrueColor($ThumbW,$ThumbH);
$ImgSource=$imgc($ThumbFile);
#ImageCopyResampled($ImgTarget,$ImgSource,0,0,0,0,$ThumbW,$ThumbH,$SourceW,$SourceH);
ImageCopyResampled($ImgTarget,$ImgSource,0,0,0,0,$ThumbW,$ThumbH,$SourceW,$SourceH);
$imgj($ImgTarget,"../images_upload/gallery_activities_small/".$pic_name2,$Quality);
ImageDestroy($ImgTarget);
ImageDestroy($ImgSource);
$sql="insert into gallery_activities values('','$group_id','$pic_name2','$desc','$valid_admin',now())";
$result=mysql_query($sql,$conn);
if (!$result)
{
// echo"Error : ".mysql_error();
// exit();
print "<script>";
print "alert('Error : Can't insert Detail into Database'); ";
print "location.href='javascript:history.back();'";
print "</script>";
exit();
}
}
}
print "<script>";
print "location.href='group_activities_show.php?id=$id&des=$des'";
print "</script>";
exit();
?></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
<? mysql_close($conn); ?>Tag : - - - -
Date :
2 ส.ค. 2550 09:00:05
By :
นายกระจอก
View :
1684
Reply :
1
code ผิดแล้วท่าน
Date :
2 ส.ค. 2550 09:30:06
By :
อิอิ
Load balance : Server 00