douzhanlai4671 2013-05-14 00:50
浏览 108
已采纳

PHP脚本mkdir“没有错误,但没有目录”

I am currently learning and messing around with some HTML and PHP on my personal website. I need to create a "New Directory" using PHP.

I am currently using, http://dummycode.com/projects/projectform/form.html in order to try and make this happen. It is running the PHP script but it is not creating a new directory under /projects/projectform/dir

Here is the code for the form.php file:

    <?php
$result = mkdir("http://dummycode.com/projects/projectform/dir", 0700);
if ($result == 1) {
    echo "Success creating directory!";
} else {
    echo "Error creating directory!";
}

?>

I cannot seem to find the issue because every time it says "Error creating directory!" but the PHP is not throwing any errors.

Is there something simple I am missing, or am I just being stupid?

Thanks, Henry Harris

  • 写回答

2条回答 默认 最新

  • dongpan1871 2013-05-14 01:00
    关注

    Have you tried using a relative path rather then a url?

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题