这个PHP脚本有什么问题?

The following script does not execute:

<?php

    $year = date(Y);
    $month = date(M);
    $dirloc = "/images/".$year."/".$month;
    mkdir($dirloc, 0700);

?>

Why?

Thank you

You forgot quotes:

<?php

$year = date("Y");
$month = date("M");
$dirloc = "/images/".$year."/".$month;
mkdir($dirloc, 0700);

?>

Use quotes for the date() function:

$year = date("Y");
$month = date("M");

The path you provide is absolute and you probably don't have the rights to create directories or files there. If you want to create the directory in the current work directory (the one you run the script from), try

$dirloc = "images/".$year."/".$month;

Also it seems, that you want to create more than one folder. If the parent folder doesn't exists, mkdir fails, if you don't allow it to create the parents recursively.

mkdir($dirloc, 0700, true);
                  // = recursive