<?PHP
class couty{
public function write ($a,$b){
@session_start();
if(!(isset($_SESSION[`login`]) && $_SESSION[`login`] != ``)){
echo "you must Logged in to create a PHP file";
}
else{
file_put_contents($a,$b);
exit;
}
}
}
$c = `<!DOCTYPE HTML><HTML>
<head><title></title></head>
<body></body>
</HTML>`;
if($_SERVER[`REQUEST_METHOD`] == `POST`){
$new = trim($_POST[`coutyv`]);
$dir = (mkdir(`folder/$new`));
$d = new couty();
$d->write(`$dir/$new.php`,$c);
}
?>
<form method = `post` action = ``>
<input type = `text` name = `coutyv`/>
<input type = `submit` name = `submit`/>
</form>
答案 0 :(得分:2)
你的问题就在这里。检查您是否有这些文件夹。无论如何你的代码不好
$dir = (mkdir(`folder/$new`));
$d = new couty();
$d->write(`$dir/$new.php`,$c);
答案 1 :(得分:0)
我会做的事情很少
可能会,或将来可能会发生:
$dir = (mkdir(`folder/$new`)); <--- $new might be bad / folder might be bad / call might fail
$d->write(`$dir/$new.php`,$c); <--- maybe the $dir/$new.php generated a bad path.
// future potential errors:
$new = trim($_POST[`coutyv`]); <---- new might not exist, might be invalid, contain invalid