mkdir()说没有这样的目录并且失败? [英] mkdir() says theres no such directory and fails?
本文介绍了mkdir()说没有这样的目录并且失败?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我可能做的是非常简单的错误,但是当我尝试建立目录(使用刚刚执行的插入变量作为最后一个文件夹名称)时,出现错误:
Im likely doing something very simply wrong, but when I try to make a directory (using a variable of an insert just performed as the last folder name), I get the error:
警告:mkdir()[function.mkdir]:/home/blah/blah中没有这样的文件或目录
Warning: mkdir() [function.mkdir]: No such file or directory in /home/blah/blah
代码:
if (!is_dir("images/listing-images/rent/'.$insertID.")) {
//make new directory with unique id
mkdir("images/listing-images/rent/'.$insertID.");
}
当然该目录不存在..我现在正在尝试建立它吗?糊涂了!
of course the directory doesn't exist.. I'm trying to make it now? confused!
推荐答案
您的字符串有错误:
mkdir("images/listing-images/rent/'.$insertID.");
应为:
mkdir("images/listing-images/rent/$insertID");
这篇关于mkdir()说没有这样的目录并且失败?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文