PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?php
// START MAIN MAKEDIR FUNCTION
if ($makedir == "MakeDir") {
$content = "$direct";
$dirmake = mkdir("$content", 0777);
// DISPLAY LINK TO DIRECTORY AFTER MAKING IT
PRINT "<center>
";
PRINT "<a href="$content">CLICK HERE TO VIEW YOUR NEW DIRECTORY</a>
";
PRINT "</center>
";
}
// MAIN FORM TO INPUT INFORMATION
PRINT "<form action="$PHP_SELF?action=direct">
";
PRINT "<INPUT TYPE="text" NAME="direct" SIZE="15">
";
PRINT "<br>
";
PRINT "<INPUT TYPE="submit" NAME="makedir" VALUE="MakeDir">
";
PRINT "</FORM>
";
?>
so when i want to use this script i get notice about ERROR (Warning: mkdir() failed (Permission denied) in /mnt/host-users/xexexexe/nothing.php3 on line 11).. What should i do?
P.S. If u know some free php hosting, please post reply to this topic with hosting URL.
Be certain that the directory inside which you make the new directory allows you to do so. Try to chmod a directory to 777 and then let the script make a new one inside that one.
Notice: The webserver is running as a diffrent user. Often www, http, www-data or nobody. This means that everyone has to have write permission to the parent directory ($dirpath). Change the permissions with "chmod 777 /home/user/public_html" (on the commandline).