![]() |
![]() |
![]() |
![]() |
![]() |
روابط مفيدة : للإعلان بالموقع | استرجاع كلمة المرور| طلب كود تفعيل العضوية | تفعيل العضوية
|
|
رقم المشاركه : 1 |
|
|
<div>السلام عليكم ورحة الله وبراته اخواني اعضاء ورواد معهد ترايدنت عندي كود class ويوجد به خطأ علي ما اظن من المفروض ان آليه همله هي ان يقوم برفع الصورة وتصغيرها ويقوم بحفظ الصورة الاصلية + الصورة الصغيرة في المجلدات حسب تحديد المستخدم الكود كالتالي رمز PHP: class upload { var $up ; var $error ; var $ext; function upload($code,$exts,$maxs,$path,$truepath,$thumb,$twidth,$theight) { /* Constants */ $sec_path=substr($path,3); /* Constants */ /* Config */ $vexts=explode('-',$exts) ; $msize= ($maxs*1024)*1024 ; $new_w=$twidth ; $new_h=$theight ; $dngr= array('text/html','text/plain','application/xhtml+xml','application/x-php','text/php', 'application/x-httpd-php','application/x-**********'); /* Config */ /* attributes */ $file_name=str_replace(" ","-",$_FILES['fileup']['name']); $filetype=$_FILES['fileup']['type']; $filesize=$_FILES['fileup']['size']; $error =$_FILES['fileup']['error']; $this->error = $error; $fileext=strtolower(strrchr($file_name,'.')) ; $this->ext = $fileext; /* attributes */ /* generate new files names */ $filename=$code.$fileext; $fpath=$path.$filename; if($thumb == "T" ) { $thname="thmb_".$code.$fileext; $tpath=$path."thumb/".$thname; } /* generate new files names */ if (!in_array($fileext,$vexts)){ $main .= " هذا الامتداد غير مسموح به ".$*******; } elseif (in_array($filetype,$dngr)){ $main .= " هذا الملف خطر ".$*******; } elseif ($filesize > $msize){ $main .= " الحجم اكبر من المسموح به ".$*******; } else { if(move_uploaded_file($_FILES['fileup']['tmp_name'],$fpath)) { $this->up = "T"; } else { $this->up = "F"; } } } } وهذا الكود الموجود في ملف الكونفيج الخاص بالمسارات رمز PHP: /* upload configuration */ $exts=".jpg-.gif-.jpeg-.bmp-.png"; // الامتدادات $maxs="2"; // اقصي حجم للمفات المرفوعة بالميجا بايت $path="../images/products/"; // مسار مجلد الصور الخاصة بالمنتجات اتركه ولا تعدله $truepath='D:\xampp\htdocs\ads\images\products/'; // مسار مجلد الصور الخاصة بالمنتجات اتركه ولا تعدله $Bpath="../images/banners/"; $Btruepath='D:\xampp\htdocs\ads\images\banners/'; // مسار مجلد الصور الخاصة بالإعلانات اتركه ولا تعدله وعلي ما عتقد ان هذا الكود تبع نفس الخاصية موجود في ملف اخر في نفس السكربت <div style="margin:20px; margin-top:5px"> رمز PHP: <div class="alt2"> <div dir="ltr" style="text-align:left;"> <span style="color: #000000">function Hawythumb($tpath,$fpath,$new_w,$new_h){ $system=explode('.',$tpath); if (preg_match('/jpg|jpeg/',$system[1])){ $src_img=imagecreatefromjpeg($tpath); }elseif(preg_match('/png/',$system[1])){ $src_img=imagecreatefrompng($tpath); }else{ $src_img=imagecreatefromgif($tpath); } $old_x=imageSX($src_img); $old_y=imageSY($src_img); if ($old_x > $old_y) { $thumb_w=$new_w; $thumb_h=$old_y*($new_h/$old_x); } if ($old_x <span style="color: #007700"> 'gf ju]dg class upload upload ju]dg |
|
![]() |
| مواقع النشر |
| العبارات الدلالية |
| class, upload, تعديل, طلب |
| أدوات الموضوع | |
|
|
أنت غير مشترك في حلم عابر. للتسجيل الرجاء اضغط هنـا