السلام عليكم
كهذا كود تحميل الصور لا يعمل معي
علما اني قد حاولت استفيذ من المواضيع المطروحة سابقا ولكن لم تحل المشكلة (حيث يرفع اسم الصورة الى db ولكن لايرفع الملف الى السيرفر)
صفحة الكود imageuplaod.php
<?php
//session_start();
// Upload File
$dirname = "nimages";
define(PATH, "../");
$filename = $myfile_name;
$dtypes = "image/gif|image/jpeg|image/pjpeg";
$dtype=explode("|",$dtypes);
$fsize=50000;
$pres="";
$imgdim=200;
$checku=1;
if ($filename != "")
{
if ($myfile_type == $dtype[0] || $myfile_type == $dtype[1] || $myfile_type == $dtype[2])
{
$gimgdim = getimagesize ($myfile);
if ($gimgdim[0] <= $imgdim && $gimgdim[1] <= $imgdim)
{
if ($myfile_size < $fsize)
{
$m_Path=PATH.$dirname."/$filename";
$testExists=file_exists($m_Path);
if ($testExists)
{
$unid=uniqid(rand(1,5));
$Nfilename=$unid.$filename;
$filename=$Nfilename;
copy($myfile, $dirname) or die('<input type="button" name="back" value="BACK" onclick="window.history.back()">');
}
unlink($myfile) or die("<b>Error:</b> could not delete uploaded file.");
$pres="uploading image Successfully";
}
else
{
$fsize1=$fsize/1000;
$pres="Maximum Image size $fsize1 KB";
$checku=0;
include "history.php";
}
} else
{
$pres="Dimensions must be less than 145 X 145";
$checku=0;
include "history.php";
}
} else
{
$pres="Image Type must be ( JPG or GIF )";
$checku=0;
include "history.php";
}
$HTTP_POST_VARS['myfile'] = $filename;
}
?>
