I'm using Windows XP Pro and have an ftp http and php server running on my machine. I have this php script which used to be working but not anymore and i can't figure out why 🙁
Please help me
Code:
<?
//Directory
$dir = 'C:\Account;
if(!$POST){
echo '<form action='.$SERVER['PHP_SELF'].' method=post>
Account-Name:
<input name=account type=text maxlength=10>
<br>
Password:
<input name=password type=password maxlength=10>
<br>
Password(Again):
<input name=confirm type=password maxlength=10>
<br>
E-Mail:
<input name=email type=text>
<br>
Security Question:
<input name=question type=text>
<br>
Answer:
<input name=answer type=text>
</font>
<br>
<input name=submit type=submit value=Submit>
';
}
else{
$account = $POST['account'];
$confirm = $POST['confirm'];
$date = date('F d, Y g:i A');
$password = $POST['password'];
$email = $POST['email'];
$question = $POST['question'];
$answer = $POST['answer'];
$ip = $SERVER['REMOTE_ADDR'];
$firstletter = substr($account, 0, 1);
$ascii = ord($firstletter);
$filename = $dir . '\ASCII'.$ascii.'\'.$account.'.txt';
if($account == '') { echo 'Account creation failed. Please fill out all fields.'; }
elseif(file_exists($filename)) { echo 'Account creation failed. Account name already exists.';}
elseif($email == '') { echo 'Account creation failed. Please fill out all fields.';}
elseif(!ereg("[a-zA-Z0-9-]+(.[_a-zA-Z0-9-]+)@[a-zA-Z0-9-]+(.[a-zA-Z0-9-]+)$", $email)){ echo 'Account Creation Failed. Please enter a valid E-Mail.'; }
elseif($password != $confirm) { echo 'Account creation failed. Password does not match confirmation password.';}
else{
$fp = fopen($filename, 'w+');
$string = 'Account Created: '.$date.' With the IP: '.$ip.'
[NAME]
account-name = '.$account.'
[PASSWORD]
account-password = '.$password.'
[ACCOUNT-STATUS]
account-valid-time = 0
account-valid-date = 2003 4 5
account-change-password = 2003 3 29
[ETC]
account-Gender = Male
account-Age =
account-Birth-Year = xxxx
account-Birth-Month = xx
account-Birth-Day = xx
account-RealName = a
account-SSN = aaaaa
account-Email = '.$email.'
account-Quiz = '.$question.'
account-Answer = '.$answer.'
account-created-by = ;
$write = fputs($fp, $string);
fclose($fp);
echo 'Account created successfully, you may now login.';
}
}
?>
What it's suppose to do is create a .txt file with some information in it like the account name and password and save it in a specified folder. But when i load the php page this is the error message i get:
Parse error: parse error, unexpected T_STRING in c:\inetpub\wwwroot\accountgenerator.php on line 79
Please help me