if(isset($_POST['upload']))
{
$img4='';
$target4='';
echo uniqid();
echo date("Y-m-d-H-i-s");
if(isset($_FILES['img4']))
{
$file_name = uniqid().date("Y-m-d-H-i-s").$_FILES['img4']['name'];
$img4 = uniqid().date("Y-m-d-H-i-s").$_FILES['img4']['name'];
$target4 = "images/allimagesad/".$file_name;
}
echo"<img src='images/allimagesad/".$row['img1']."' style='max-height:82px; ; max-width:145px ;' title='' alt='' />";
&#13;
生成唯一名称正在运行...但无法显示图像。请帮帮我
答案 0 :(得分:0)
$uniqId = uniqid();
$file_name = $uniqId.date("Y-m-d-H-i-s").$_FILES['img4']['name'];
$img4 = $uniqId.date("Y-m-d-H-i-s").$_FILES['img4']['name'];
你需要将uniqid()的结果保存到变量中,因为每次调用uniqid()都会给你新值。