I'm new to PHP and I'm trying to create a directory (for a user) and I get a 500 Error when the script is launched.
<html>
<head>
<title>Login</title>
</head>
<body>
<?php
chdir("users");
mkdir($_POST["username"]);
?>
</body>
500 Internal ErrorHTTP response usually means a syntax error in the PHP code. The exact error message can be found on your server in a file usually namedphp-errors.logbut this exact location depends on the local configuration. The posted code looks valid, though.if(empty($_POST["username"]) { ... }I'd also recommend you escape the variable to void yourself of running any malicious code on the server, never trust user input!