我要用php读取 C:\phpStudy\PHPTutorial\WWW\user_info 文件夹里面的图片并显示在页面上去
$.ajax({type:"post",
url:"blogs_showpics_href.php",
data:datas,
dataType:"json",
success:function(result){
alert(result);
},
error:function(){
alert("内部服务器错误");
}
});
<?php
$a = $_POST['ids'];
$hostdir = dirname(__FILE__)."phpStudy\PHPTutorial\WWW\user_info\photo\ $a";
$url = "phpStudy\PHPTutorial\WWW\user_info\photo\ $a";
$filesnames = scandir($hostdir);
print_r ($filesnames);
// $www = 'http://www.***.com/';
// foreach($filesnames as $name){
// $aurl= "<img width='100' height='100' src='"$url."10.jpg"."' alt = '".$name."'>"
// }
// echo $filesnames;
echo json_encode($hostdir);
?>
为什么老是执行不成功啊