Help with register script!
I“m using this script:
<li><h1>Fill Out All Fields</h1></li>
<?php
$MD5Code = "kikugalanet"; // Your Neuz MD5 Code
$dbAddr = 'MYPCNAME\SQLEXPRESS'; // Your MSSQL Host IP The Sql Works For Me
$dbUser = 'sa'; // Your Database user
$dbPass = 'MYPASSWORD'; // Your Database User password
$dbName = "ACCOUNT_DBF"; // Your Account Database
$server_name = "MYFLYFFSERVERNAME"; // Define your Servername here
$reg_allow = 1; // To turn on registering a write "1"
if(!extension_loaded("mssql")) {
echo "The required module is not enabled on your MSSQL server. Please enable it.";
exit();
}
$link = mssql_connect($dbAddr, $dbUser, $dbPass) or die ("Could not connect to the
database. Please check your settings.");
mssql_select_db($dbName, $link);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en">
<head>
<title><?php echo ('..:: '.$server_name.' - Registration ::..'); ?></title>
</head>
<body>
<?php
if ($reg_allow == 1) {
function cleanFormData($text) {
$data = strtolower($text);
$data = trim($text);
$data = htmlentities($text);
$data = strip_tags($text);
return $data;
}
if(isset($_POST['submit'])) {
$userName = cleanFormData($_POST['user']); // Username
$userPass = cleanFormData($_POST['pass']); // Password non-encrypted
$userPass2 = cleanFormData($_POST['pass2']); // Password non-encrypted
$captcha = cleanFormData($_POST['captcha']); // Password non-encrypted
$checkUserName = mssql_query("SELECT account FROM ACCOUNT_TBL WHERE
account='".$userName."'");
if(empty($userName) || empty($userPass) || empty($userPass2) || empty($captcha)) {
echo "Please complete all fields!";
exit();
}elseif(mssql_num_rows($checkUserName) >= 1) {
echo "The username <b>".$_POST['user']."</b> is already in use.";
exit();
}elseif($_POST['pass'] != $_POST['pass2']) {
echo "Passwords do not match.";
exit();
}elseif($_POST['captcha'] != $_POST['captcha_check']) {
echo "Captcha is not true.";
exit();
} else {
$passHash = md5($MD5Code . $userPass);
// Create a new stored prodecure
$stmt = mssql_init("createaccount", $link);
// Bind the field names
mssql_bind($stmt, '@account', $userName, SQLVARCHAR, false, false, 15);
mssql_bind($stmt, '@password', $passHash, SQLVARCHAR, false, false, 15);
// Execute
mssql_execute($stmt) or die ("Something is wrong on the execution");
// Free statement
mssql_free_statement($stmt);
echo "The Account <b>".$_POST['user']."</b> was successfully created!<br><br>We
wish you much fun playing.";
}
} else {
$zahl1 = rand(10,20); //First Number 10-20
$zahl2 = rand(1,10); //Second number 1-10
$operator = rand(1,2); // + Or --
if($operator == "1"){
$operatorzeichen = " + ";
$ergebnis = $zahl1 + $zahl2;
}else{
$operatorzeichen = " - ";
$ergebnis = $zahl1 - $zahl2;
}
$rechnung = $zahl1.$operatorzeichen.$zahl2." = ?";
echo'
<form method="post">
<table border="0" cellpadding="0" cellspacing="0" >
<tr><td width="75">Username:</td><td><input type="text" name="user" size="15"
maxlenght="15" /></td></tr>
<tr><td>Password:</td><td><input type="password" name="pass" size="15" /></td></tr>
<tr><td><font size="-2">Password<br>(repeat)<font></td><td><input type="password"
name="pass2" size="15" /></td></tr>
<tr><td>'.$rechnung.'</td><td><input type="text" name="captcha" size="15"
/></td></tr>
<input type="hidden" name="captcha_check" value="'.$ergebnis.'">
</table>
<br>
<tr><td></td><td><input type="submit" name="submit" value="Register" /></td></tr>
</form>';
}
}
else
{
echo 'Currently, no registrations are available!';
exit();
}
?>
</body>
</html>
And i get this error: "The required module is not enabled on your MSSQL server. Please enable it." Please help me1 :(
Re: Help with register script!
Did you enable php extensions for MSSQL?
Re: Help with register script!
Quote:
Originally Posted by
xGrave
Did you enable php extensions for MSSQL?
No he did not. There is no other reason why this would've occurred.
edit: /300th post :> <3 ragezone
Re: Help with register script!
Re: Help with register script!
Quote:
Originally Posted by
isma4ever
How can i enable it?
by using the search button. This has been answered at least 10 times. Probably more
Re: Help with register script!
3 times xD...but i dont find nothing :(
Re: Help with register script!
Quote:
Originally Posted by
isma4ever
3 times xD...but i dont find nothing :(
Go into php.ini [somewhere in your xampp/wamp folder. it's there, so don't ask for help finding it, just keep looking...]
Remove the ";" on these 2 lines:
Code:
;extension=php_mssql.dll
;extension=php_pdo_mssql.dll
They should now be
Code:
extension=php_mssql.dll
extension=php_pdo_mssql.dll
PS: These wont be side by side, they'll be a bit apart.
2nd PS: I dunno if the 2nd one is necessary, but do it anyways. Won't harm anything.
Re: Help with register script!
Re: Help with register script!
Follow this guide by Alexsh.
Re: Help with register script!
Ty it actually working :D