Jump to content

[SOLVED] Creating a directory


shank888

Recommended Posts

For sumreason it refuses to do wha ti want it to do and that is create a new directory in the subdomain.

 


<?php
ini_set ('display_errors', 1);
error_reporting (E_ALL & ~E_NOTICE);

if (isset ($_POST['submit'])) {
$problem = FALSE; // no problems so far

if (empty ($_POST['username'])) {
	$problem = TRUE;
	print "<p>Please enter a username.</p>";
	}

if (empty ($_POST['password'])) {
	$problem = TRUE;
	print "<p>Please enter a password</p>";
	}

if ($_POST['password'] != $_POST['cpassword']) {
	$problem = TRUE;
	print "<p>Your Passwords did not match.</p>";
	}

if (!problem) { // If no problems occured

mkdir("../users.domain.com/$username"); // this should create a new folder for the user in the users.babble-net.com subdomain


//print register message
print "<p>You have now been registered!</p>";

} else { 
	print "<p>You could not be registed due to an internal system error.</p>";
}

} 



// Displaying HTML form below
print "
<form action='register.php' method='post'>
Username: <input type='text' name='username' size='20' />
<br />
Password: <input type='password' name='password' size='20' />
<br />
Confirm Password: <input type='password' name='cpassword' size='20' />
<br />
<input type='submit' name='submit' value='register' />
</form>
";


?>

Link to comment
https://forums.phpfreaks.com/topic/102202-solved-creating-a-directory/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.