- Joined
- Apr 18, 2011
- Messages
- 49
- Reaction score
- 9
when i register goes a blank page :/
i have the same problem when i register the page goes blank i already remove the ";" on php.ini both wamp and xammp still no registration.
i get this error when i will register me
Warning: mssql_execute () [function.mssql-execute]: message: For the procedure or function webCreateAcc too many arguments. (severity 16) in C: \ xampp \ htdocs \ Flyff Website \ register.php on line 78
Warning: mssql_execute () [function.mssql-execute]: stored procedure execution failed in C: \ xampp \ htdocs \ Flyff Website \ register.php on line 78
Something is wrong on the execution.
can someone help me??
sorry for my bad english :/
<?php
/* Copyright 2011 Aaron Roderigues */
require_once "captcha/securimage.php";
$securimage = new Securimage();
function doesUsernameExist($name){
$exit = FALSE;
$result = @mssql_query("SELECT * FROM dbo.ACCOUNT_TBL WHERE account='$name'");
if(mssql_num_rows($result) != 0){
$exit = TRUE;
}
return $exit;
}
function cl($info){
return strtolower(preg_replace("|[^\w]|", "", $info));
}
function check_email($email){
$exit = FALSE;
if(filter_var($email, FILTER_VALIDATE_EMAIL)){
return $exit = TRUE;
}
else {
return $exit;
}
}
if(isset($_POST['submit'])){
/* Start editing */
$salt = "PUT IT HERE";
$link = @mssql_connect("xxxx\SQLEXPRESS", "sa", "xxxxx") or die ("Server is down!");
$db = @mssql_select_db('ACCOUNT_DBF') or die ("Accout table is missing!");
/* */
$username = cl($_POST['username']);
$password = cl($_POST['password']);
$password_hashed = md5($salt.$password);
if(empty($username) || strlen($username) > 15){
echo "Problem with your username. Go back and try again.";
exit();
}
else if(empty($password) || strlen($password) > 36){
echo "Problem with your password. Go back and try again.";
exit();
}
else if(empty($_POST['email']) || !check_email($_POST['email'])){
echo "Problem with your email. Go back and try again.";
exit();
}
else if(doesUsernameExist($username)){
echo "Username already exists. Go back and try again.";
exit();
}
else if($securimage->check($_POST['captcha_code']) == false){
echo "The code you entered was incorrect. Go back and try again.";
exit();
}
/* Passed everything, so lets create the account. */
$stmt = mssql_init('dbo.webCreateAcc', $link);
mssql_bind($stmt, '@account', $username, SQLVARCHAR, false, false, 15);
mssql_bind($stmt, '@password', $password_hashed, SQLVARCHAR, false, false, 36);
mssql_bind($stmt, '@email', $_POST['email'], SQLVARCHAR, false, false, 120);
mssql_execute($stmt) or die ("Something is wrong on the execution.");
mssql_free_statement($stmt);
echo "User account created for: ".$username;
mssql_close($link);
exit();
}
?>
<!DOCTYPE html>
<html>
<body>
<div>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<table>
<tr>
<td>Username:</td>
<td><input size="20" name="username" maxlength="15" type="text" /></td>
<td>(A-Z, a-z, 0-9)</td>
</tr>
<tr>
<td>Password:</td>
<td><input size="20" name="password" maxlength="35" type="password" /></td>
<td>(A-Z, a-z, 0-9)</td>
</tr>
<tr>
<td>Email:</td>
<td><input size="20" name="email" maxlength="255" type="text" /></td>
</tr>
<tr>
<td>Security Code:</td>
<td><input type="text" name="captcha_code" size="10" maxlength="4" /></td>
</tr>
<tr>
<td colspan="3" align="center"><img id="captcha" src="captcha/securimage_show.php" alt="CAPTCHA Image" /></td>
</tr>
</table>
<input type="submit" name="submit" value="register" />
</form>
</div>
</body>
</html>
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[webCreateAcc]
@account VARCHAR(15),
@password VARCHAR(36),
@email VARCHAR(120)
AS
SET NOCOUNT ON
DECLARE @DateActivated AS CHAR(8)
IF NOT EXISTS (SELECT account FROM ACCOUNT_TBL WHERE account = @account) BEGIN
INSERT INTO ACCOUNT_TBL (account, [password], id_no2, isuse, member, realname)
VALUES (@account, @password, @password, 'T', 'A', 'F')
SET @DateActivated = CONVERT(CHAR(8), GETDATE()-1, 112 ) --Is the date today - 1
--UPDATE ACCOUNT_TBL_DETAIL SET BlockTime = @DateYesterday WHERE account = @userid
--INSERT INTO ACCOUNT_TBL_DETAIL (account, gamecode, tester, m_chLoginAuthority, regdate, BlockTime, EndTime, WebTime, isuse)
-- VALUES (@account, 'A000', '2', 'F', GETDATE(), '20990101', '20990101', '20050101', 'O')
INSERT INTO ACCOUNT_TBL_DETAIL (account, gamecode, tester, m_chLoginAuthority, regdate, BlockTime, EndTime, WebTime, isuse, email)
VALUES (@account, 'A000', '2', 'F', GETDATE(), @DateActivated, '20990101', '20050101', 'O', @email)
END
--ELSE BEGIN
--print '->Account exists = '
--print @account
--END
it wont work for me its gives query error
Msg 208, Level 16, State 6, Procedure webCreateAcc, Line 21
Invalid object name 'dbo.webCreateAcc'.
and where you edit ur salt in that php script
thanks but i did look and the ones i founf dint execute >.<you dont have the script excucuted for web create acc, you should find it somewhere in the release section.