我试图从 tmp 文件夹中获取名为用户 submits.png 的图像,并将其放入 Business_Names/用户输入的文件夹中。我无法在 php 中连接它给我的错误是文件不存在
$filename = str_replace(" ","_", trim($username) );
mkdir("Business_Pages/". $filename."/");
if( $fp = fopen("Business_Pages/". $filename . "/" . $filename . ".php", "w") )
{
fwrite($fp,"<?php session_start();");
fwrite($fp,"if(isset(\$_SESSION['id'])) { ?>");
fwrite($fp, $doctype.$htmlOpen.$head.$bodyOpen.$header.$wcImage.$accountTable.$linksTable.$bodyClose.$htmlClose);
fwrite($fp,"<?php } else { echo \"User not logged in\";} ?>");
fclose($fp);
}
$tmpdir = "tmp/";
$userdir = "Business_Pages/ . $filename . '/' ";
rename("$tmpdir . $filename . '/' . '.png'",
"$userdir . $filename . '/' '.png'");