PHP没有写入文件

I'm making a registration form, but can't seem to write to text file. In this code, I'm putting a person's real name in their file in acc/pplid/[name].txt The file isn't writing at all - the echo doesn't output anything. I'm running off of Microsoft Webmatrix on my computer. Thanks in advance!

        $irlname = $_POST["irlname"];
        $name = $_POST["username"];
        $email = $_POST["email"];
        $password = $_POST["password"];
        $name = htmlentities($name);

        echo $name;
        file_put_contents("acc/pplid/".name.".txt", $irlname);
        echo file_get_contents("acc/pplid/".$name.".txt");
file_put_contents("acc/pplid/".name.".txt", $irlname);

Should be

file_put_contents("acc/pplid/".$name.".txt", $irlname);

unless name is defined else where, otherwise I'd say check the write permissions. Check the status of the folder with file_exists or is_dir prior to file_put_contents.

Example

if(is_dir("acc/pplid") && is_writable("acc/pplid")){
    file_put_contents("acc/pplid/".$name.".txt", $irlname);
} else echo "A problem with the folder occurred";