Code: Select all
$username = md5($_GET["username"]);
$password = md5($_GET["password"]);
$filename = "$username.php";
if (!$handle = fopen($filename, 'a'))
{
die ("Error while connecting, please try again.");
}
else if (fwrite($handle, $password) === FALSE)
{
die("Error while writing.");
}
echo "Account Created to $filename";
fclose($handle);
for ($counter = 1; $counter <= 20; $counter++)
{
switch($counter)
{
case 1: $stat = "Attack";
case 2: $stat = "Cooking";
}
if (!$handle = fopen("$username$stat", 'a')) {
die ("Error while connecting, please try again.");
}
else if (fwrite($handle, 1) === FALSE)
{
die("Error while writing.");
}
}
echo "\r\n $stat level set at 1.";
fclose($handle);Jcart | I've edited your code for better indentation and whitespace, at least indent properly next time please