<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>THANTAB</title>
<style>
body {font-family: Helvetica; }
</style>
</head>
<body>
<?php
$photo = $_FILES['photo']['tmp_name'];
$photo_name = $_FILES['photo']['name'];
$photo_size = $_FILES['photo']['size'];
$photo_type = $_FILES['photo']['type'];
$name_last = explode(".",$photo_name);
$n = count($name_last)-1;
$lastname= strolower($name_last[$n]); error บรรทัดนี้เพราะอ่ะไรครับ ขอบคุณครับ
if($lastname=="gif"or $lastname == "jpg"or $lastname == "jpeg"){
$set_photo=explode(".",$photo_name);
$pfname = "photo_".$POST['txtUsername'];
$plname= $set_photo[1];
$photoname=$pfname.".".$plname;
coppy ($photo,"photo1/".$photoname);
echo"รูปภาพ :$pfname";
echo"<img src='photo/$photoname'>";
unlink($photo);
}else{ echo"ไม่สามารถอัพโหลดไฟล์ได้";
}
?>
</form>
</body>
</html>
php โค้ดอัพโหลดภาพไม่ขึ้น
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>THANTAB</title>
<style>
body {font-family: Helvetica; }
</style>
</head>
<body>
<?php
$photo = $_FILES['photo']['tmp_name'];
$photo_name = $_FILES['photo']['name'];
$photo_size = $_FILES['photo']['size'];
$photo_type = $_FILES['photo']['type'];
$name_last = explode(".",$photo_name);
$n = count($name_last)-1;
$lastname= strolower($name_last[$n]); error บรรทัดนี้เพราะอ่ะไรครับ ขอบคุณครับ
if($lastname=="gif"or $lastname == "jpg"or $lastname == "jpeg"){
$set_photo=explode(".",$photo_name);
$pfname = "photo_".$POST['txtUsername'];
$plname= $set_photo[1];
$photoname=$pfname.".".$plname;
coppy ($photo,"photo1/".$photoname);
echo"รูปภาพ :$pfname";
echo"<img src='photo/$photoname'>";
unlink($photo);
}else{ echo"ไม่สามารถอัพโหลดไฟล์ได้";
}
?>
</form>
</body>
</html>