我是php程序员的初学者,所以遇到了各种问题,其中一个是在我制作了一个简单的上传系统之后,当我想查看我上传到服务器的图片时,没有显示。这是代码:
<?php
$target_path = "uploads/";
$target_path = $target_path . basename( $_FILES['file']['name']); //the target path that the file will move
/*Moving the picture,to the server if successed the condition will be true*/
if(move_uploaded_file($_FILES['file']['tmp_name'], $target_path))
{
echo"התמונה הועלתה בהצלחה!";
echo"</br></br>";
echo $target_path;
$show_photo = "<img src='$target_path' alt='Picture' class='photo' />";
function AddToAllPhotosList()
{
$myFile = "photosorder.php"; //ListOfAllPhotos
$fileHander = fopen($myFile,'a') or die ("אין אפשרות לפתוח את הקובץ");
}
}
else
echo "Error.";
?>
线- "<img src='$target_path' alt='Picture' class='photo' />"
,不显示照片,为什么?