douiwn6941 2013-06-25 05:18
浏览 89
已采纳

php mkdir()无法正常工作

I can't seem to figure this out. I realize at this point that this just must be a simple syntax issue that is throwing me off, I'm fairly new to PHP so I am going to thank my noobiness for this one.

I am trying to create subdirectories ($slugTitle) within already existing directories ($w_type), yet the directories are failing to be created.

This is my code:

        $path1 = "/".$w_type."/".$slugTitle;
        $path2 = "/".$w_type."/".$slugTitle."/images";
        $mode = 0777;

        mkdir($path1);
        mkdir($path2);

I've also tried:

        $path1 = "/".$w_type."/".$slugTitle;
        $path2 = "/".$w_type."/".$slugTitle."/images";
        $mode = 0777;

        mkdir($path1,$mode,TRUE);
        mkdir($path2,$mode,TRUE);

and still now luck. Instead, I get directories that are named " instead of creating a directory within an already existing directory.

Please help! Thank you!

-Joshie

  • 写回答

3条回答 默认 最新

  • dongteng2534 2013-06-25 06:18
    关注

    Try This,

    $path1 = "./".$w_type."/".$slugTitle; 
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度