درود بر شما.
1-من یه کدی دارم درمورد آپلود فایل کدشو براتون قرار میدم امکانش هست این کد رو برای من خط به خط توضیح بدید ممنون میشم.
<?php
if(isset($_POST['btn_upload']))
{
$error = $_FILES['user_file']['error'];
$name = $_FILES['user_file']['name'];
$tempFile = $_FILES['user_file']['tmp_name'];
if($error == 0)
{
$moveFile = move_uploaded_file($tempFile,"files/$name");
if($moveFile)
{
header("location:?msg=ok");
exit;
}
else
{
header("location:?msg=err2");
exit;
}
}
else
{
header("location:?msg=err1");
exit;
}
}
if(isset($_GET['msg']) && $_GET['msg'] == 'err1')
print "error file not upload !";
if(isset($_GET['msg']) && $_GET['msg'] == 'ok')
print "file ok upload";
if(isset($_GET['msg']) && $_GET['msg'] == 'err2')
print "file not upload!";
if(file_exists("files/a.txt"))
print "ok";
else
print "errr";
?>
<form method="post" action="" enctype="multipart/form-data">
File : <input type="file" name="user_file" />
<input type="submit" value="Upload" name="btn_upload" />
</form>
آخرین ویرایش: 21-05-2014 ???? 23:26، توسط Daniel