مشكور اخي طريقة الدمج رائعة لكن ما يقبل يرفع الملفات
يقلك غير مسموح بالامتداد .jpg او .gif او حتى اي امتداد ارفعه
كود PHP:
<?PHP
$url ="http://q83gp.com/up/";
$dir ="up";
$exten = array("zip",".rar",".psd",".jpg",".jpeg",".gif",".rm",".swf",".psd",".3gp");
$size ="10000000"; // أقصى حجم للملفات 100 كيلو بايت ... يمكنك تغييره ان شئت
$max_size =$size *1024;
$size2 =($max_size /1024)." كيلو بايت";
$space = eregi(" ",$file_name);
$substr = substr_count("$file_name", ".") ;
$ext =strrchr($file_name,'.');
#####################
?>
<html>
<head>
<title>المجموعة الكويتية : مركز تحميل الملفات</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- ImageReady Slices (Untitled-1) -->
<div align="center">
<center>
<?
if ( !isset($step) )
{
$step = "1";
}
if ( $step == "1" ) {
?>
<form action ="up.php" method =post enctype=multipart/form-data >
<table id="Table_01" width="505" height="235" border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111">
<tr>
<td colspan="5">
<img src="images/index_01.jpg" width="505" height="81" alt=""></td>
</tr>
<tr>
<td colspan="5">
<img src="images/index_02.jpg" width="505" height="1" alt=""></td>
</tr>
<tr>
<td>
<img src="images/index_03.jpg" width="189" height="88" alt=""></td>
<td colspan="3" background="images/index_04.jpg">
<p align="center">
<input type="file" name="file" size="23" style="color: #333333; border: 1px solid #333333; background-color: #EEEEEE"></td>
<td rowspan="3">
<img src="images/index_05.jpg" width="10" height="152" alt=""></td>
</tr>
<tr>
<td colspan="2" rowspan="2">
<img src="images/index_06.jpg" width="204" height="64" alt=""></td>
<td>
<input type ="hidden" name ="step" value ="2" >
<input type="image" src="images/index_07.jpg" alt="تحميل"></td>
<td rowspan="2">
<img src="images/index_08.jpg" width="183" height="64" alt=""></td>
</tr>
<tr>
<td>
<img src="images/index_09.jpg" width="108" height="35" alt=""></td>
</tr>
<tr>
<td>
<img src="images/spacer.gif" width="189" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="15" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="108" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="183" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="10" height="1" alt=""></td>
</tr>
</table>
</form>
<?
}
if ($step == "2") {
?>
<table id="Table_01" width="505" height="235" border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111">
<tr>
<td colspan="5">
<img src="images/index_01.jpg" width="505" height="81" alt=""></td>
</tr>
<tr>
<td colspan="5">
<img src="images/index_02.jpg" width="505" height="1" alt=""></td>
</tr>
<tr>
<td>
<img src="images/index_03.jpg" width="189" height="88" alt=""></td>
<td colspan="3" background="images/index_04.jpg">
<p align="center">
<?php
if ($file_name == ""){
echo "<font face =tahoma size =1>لم تقم باختيار ملف حتى يتم رفعه !</font><br><a href=\"javascript:history.back()\"><font face =\"tahoma\" size =\"1\" color =\"0066FF\">
عــودة</font></a>";
}elseif (file_exists("$dir/$file_name")){
echo "<font face =tahoma size =1>عفواً ... هذا الملف موجود مسبقاً</font><br><a href=\"javascript:history.back()\"><font face =\"tahoma\" size =\"1\" color =\"0066FF\">
عــودة</font></a>";
}elseif ($space) {
echo "<font face =tahoma size =1>لايمكن رفع صورة يحتوي اسمها على مسافة !<br><a href=\"javascript:history.back()\"><font face =\"tahoma\" size =\"1\" color =\"0066FF\">
عــودة</font></a>";
}elseif ((!$substr)) {
echo "<font face =tahoma size =1>عفواً ... لايمكن رفع ملف بامتداد غريب !<br><a href=\"javascript:history.back()\"><font face =\"tahoma\" size =\"1\" color =\"0066FF\">
عــودة</font></a>";
}elseif (($file_size > $max_size)) {
echo "<font face =tahoma size =1>حجم الصورة اكبر من الحجم المسموح به .... اقصى حجم متاح هو : $size2</font><br><a href=\"javascript:history.back()\"><font face =\"tahoma\" size =\"1\" color =\"0066FF\">
عــودة</font></a>";
}elseif ((!in_array( $file_type , $exten ))){
echo "<font face =tahoma size =1>الامتداد $ext غير مسموح به</font><br><a href=\"javascript:history.back()\"><font face =\"tahoma\" size =\"1\" color =\"0066FF\">
عــودة</font></a>";
}else {
move_uploaded_file($file, "$dir/$file_name") or ($res ="خطأ ما أثناء رفع الصورة .... نرجو المحاولة فى وقت لاحق<br><a href=\"javascript:history.back()\"><font face =\"tahoma\" size =\"1\" color =\"0066FF\">
عــودة</font></a>");
?>
<p align="center"><font face="Tahoma" size="1" color="#333333">تم تحميل الملف
بنجاح</font>
<font face="Tahoma" size="1" color="#0066FF">نسخ الرابط</font></p>
<p align="center">
<input type="text" name="T1" size="56" value="<? echo "$url$dir/$file_name"; ?>" style="color: #333333; font-family: Verdana; font-size: 10px; border: 1px solid #0066FF; background-color: #DAF4FE" dir="ltr"></p>
<?
}
?>
</td>
<td rowspan="3">
<img src="images/index_05.jpg" width="10" height="152" alt=""></td>
</tr>
<tr>
<td colspan="2" rowspan="2">
<img src="images/index_06.jpg" width="204" height="64" alt=""></td>
<td>
<img src="images/index_07.jpg" alt="تحميل"></td>
<td rowspan="2">
<img src="images/index_08.jpg" width="183" height="64" alt=""></td>
</tr>
<tr>
<td>
<img src="images/index_09.jpg" width="108" height="35" alt=""></td>
</tr>
<tr>
<td>
<img src="images/spacer.gif" width="189" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="15" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="108" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="183" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="10" height="1" alt=""></td>
</tr>
</table>
<?
}
?>
</center>
</div>
<!-- End ImageReady Slices -->
</body>
</html>