Well iam not a expert on mssql or php like some of u here i am trying to make a php or asp script to do the following ....
here is a example ....this will create what i need in a txt file but i need it to access mssql sa using a password ....
<?
Error_reporting(0);
$dir = 'C:\hbnew\Account';
if(!$POST){
echo '<form action='.$SERVER['PHP_SELF'].' method=post>
<body bgcolor="#E1E1E1"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Account Name:
<input name=account type=text maxlength=10>
<br>
Password:
<input name=password type=password maxlength=10>
<br>
Password Confirm:
<input name=confirm type=password maxlength=10>
<br>
E-Mail Address:
<input name=email type=text>
<br>
Secret Question:
<input name=question type=text>
<br>
Answer:
<input name=answer type=text>
<br>
<input name=submit type=submit value=Register>
<p>
</font><font face="Verdana, Arial, Helvetica, sans-serif" size="1">blablabla
';
}
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';
$lines = file('accountlog.txt');
foreach($lines as $b){
if(trim($b) == $ip){ $ipflag=TRUE; }
}
if($ipflag){ echo '<body bgcolor="#E1E1E1"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Account creation failed. You\'ve already registered an account.'; }
else{
if($account == '') { echo '<body bgcolor="#E1E1E1"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Account creation failed. Please fill out all fields.'; }
elseif(file_exists($filename)) { echo '<body bgcolor="#E1E1E1"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Account creation failed. Account name already exists.';}
elseif($email == '') { echo '<body bgcolor="#E1E1E1"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">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 '<body bgcolor="#E1E1E1"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Account creation dailed. Please enter a valid E-Mail.'; }
elseif($password != $confirm) { echo '<body bgcolor="#E1E1E1"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">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 = blabla\'s Account Generator';
$write = fputs($fp, $string);
fclose($fp);
$moo = fopen('accountlog.txt', 'a');
fwrite($moo, ''.$ip.'
');
fclose($moo);
echo '<body bgcolor="#E1E1E1"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Account created successfully. You may now login and play!';
}
}
}
?>
Then i need it to insert the values to this dbase mainlogin and then this table ACCOUNT_T......using colums cAccountID(Name) postion 1, cPasswd(XXXXX) postion 2 , iAccountID(start with 1001-UP) postion 3 but postion 3 must add +1 from the IaccountID in from the past user so if some loged on signed up they would be like 1001 and then another one login and signed up they would 1002 and so on ? and the final value would be on colum 16 ValidDate this could be a High Value but is also need to be inserted ......like i said i dont know php that well and if someone could help me please that would be cool ......i hope this is not to big of a chalange for any of u if u do try ....also here is what i have in that ACCOUNT_T ....
Example :
Account[cAccountID] XXXXX[cPasswd] 1001[iAccountID] <NULL>[cLoginIpAddress] <NULL>[IsGMAccount] <NULL>[CreatDate] <NULL>[LoginDate] <NULL>[LogoutDate] <NULL>[BlockDate] CDWriter[cRealName] <NULL>[SSN] me@home.com[cEmail] <NULL>[cCharRecord] <NULL>[cQuiz] <NULL>[cAnswer] <SetDateValidatesAccount>[ValidDate] <SetTimeValidatesAccountByTime>[iValidTime] <KEYCODE-?>[cKEYCODE]
Thanks
🙂