<?php
error_reporting(0);
$title='New Account'; /*This is a page that creates new account*/
include('header.php'); /*header file included*/
extract($_POST);
if(isset($r9)) /*$r9 is submit */
{
if(!empty($r1) && !empty($r2) && !empty($r3) && !empty($r4) && !empty($r5) && !empty($r6) && !empty($r7) && !empty($r8) )
{
if(is_dir("user/$r3")) //$r3 is the email the person is providing
{
echo "User already registered";
}
else
{
mkdir("user/$r3"); /*directory creation*/
file_put_contents("user/$r3/details.txt","$r1'n$r2'n$r4'n$r5'n$r6'n$r7'n$r8");
header("location:welcome.php"); /*the next page it must go after this*/
}
}
}
?>
这是我的PHP代码,它没有创建目录。请帮帮我。
请打开错误报告以查看错误消息,这将帮助您解决此问题。请检查您的 Web 服务器是否有权创建新目录。如果您的 Web 服务器已经具有在文件夹用户中写入的权限,请尝试编辑以下代码:
mkdir("user/$r3");
自
mkdir("/THE_HOLE_URL_TO_THIS_FOLDER/user/$r3");
例如 mkdir("/opt/lampp/htdocs/myhomespace/user/$r 3");