if (!Empty($mail)) if (!ereg("^[0-9a-zA-Z]{4,128}$", (strtr($mail, Array('@'=>'','.'=>''))))) {
$mail='';
echo 'mail > Only letters a to z and special chars @ . are allowed';
}
if(!ereg("^[0-9a-z]{4,12}$",$userid)) {
echo 'login > Only letters from "a" to "z" and numbers, lenght of 4 to 12 characters';
}
else {
if($password == $passretype) {
if(!ereg("^[0-9a-zA-Z]{4,22}$",$password)) {
echo 'password > Only letters or numbers, lenght of 4 to 22 characters';
}
else {
$res = mysql_query('SELECT * FROM accounts WHERE AccountID = "'.$userid.'" ORDER BY AccountID DESC');
if(mysql_num_rows($res) == 0) {
mysql_query('INSERT INTO accounts(AccountID,Password) VALUES ("'
.$userid.'","'.($passhash ? $hash : $password).'","'
.$_SERVER['REMOTE_ADDR'].'", "'.'255.255.255.0")');
echo 'Success > Account registered successfully.';
}
else echo 'Error > Account Already exists.';
}
}
else echo 'Passwords did not match.';
}
}
else echo 'Check Code is Wrong.';
}
else echo ' umm why there is empty <b>required</b> areas in register form????';
}
?>
This is the script somehow it says registration succes but it doesn't put anything in the database
Config file:
Code:
<?php
$myhost='localhost'; // MySQL database address
$mypass='lol'; // MySQL server login
$myuser='root'; // MySQL server pass
$accdb='accounts'; //your server account database
$gamedb='coserver';
This is the script somehow it says registration succes but it doesn't put anything in the database
Tables in the accounts are called:
AccountID, Password, Status, Character, Email, SecretNumber
you said it's AccountID, Password, Status, Character, Email, SecretNumber then why in ur php is (AccountID,Password) only?!! where is the tables name to set the new value to? also u forgot the " "
if (!Empty($mail)) if (!ereg("^[0-9a-zA-Z]{4,128}$", (strtr($mail, Array('@'=>'','.'=>''))))) { $mail=''; echo 'mail > Only letters a to z and special chars @ . are allowed'; } if(!ereg("^[0-9a-z]{4,12}$",$userid)) { echo 'login > Only letters from "a" to "z" and numbers, lenght of 4 to 12 characters'; } else { if($password == $passretype) { if(!ereg("^[0-9a-zA-Z]{4,22}$",$password)) { echo 'password > Only letters or numbers, lenght of 4 to 22 characters'; } else { $res = mysql_query('SELECT * FROM accounts WHERE AccountID = "'.$userid.'" ORDER BY AccountID DESC'); if(mysql_num_rows($res) == 0) { mysql_query('INSERT INTO "accounts" SET "AccountID"="'.$userid.'","Password"="'.($passhash ? $hash : $password).'","Email"="'.$mail.'" ') .$userid.'","'.($passhash ? $hash : $password).'","' .$_SERVER['REMOTE_ADDR'].'", "'.'255.255.255.0")'); echo 'Success > Account registered successfully.'; } else echo 'Error > Account Already exists.'; } } else echo 'Passwords did not match.'; } } else echo 'Check Code is Wrong.'; } else echo ' umm why there is empty <b>required</b> areas in register form????'; } ?>
sorry lawl but i took this from a other dude hes register script o.o
and why you should import the character if they register an account? o.o i thougth it wasn't realy needed
if (!Empty($mail)) if (!ereg("^[0-9a-zA-Z]{4,128}$", (strtr($mail, Array('@'=>'','.'=>''))))) {
$mail='';
echo 'mail > Only letters a to z and special chars @ . are allowed';
}
if(!ereg("^[0-9a-z]{4,12}$",$userid)) {
echo 'login > Only letters from "a" to "z" and numbers, lenght of 4 to 12 characters';
}
else {
if($password == $passretype) {
if(!ereg("^[0-9a-zA-Z]{4,22}$",$password)) {
echo 'password > Only letters or numbers, lenght of 4 to 22 characters';
}
else {
$res = mysql_query('SELECT * FROM accounts WHERE AccountID = "'.$userid.'" ORDER BY AccountID DESC');
if(mysql_num_rows($res) == 0) {
mysql_query('INSERT INTO "accounts" SET "AccountID"="'.$userid.'","Password"="'.($passhash ? $hash : $password).'","Email"="'.$mail.'" ')
.$userid.'","'.($passhash ? $hash : $password).'","'
.$_SERVER['REMOTE_ADDR'].'", "'.'255.255.255.0")');
echo 'Success > Account registered successfully.';
}
else echo 'Error > Account Already exists.';
}
}
else echo 'Passwords did not match.';
}
}
else echo 'Check Code is Wrong.';
}
else echo ' umm why there is empty <b>required</b> areas in register form????';
}
?>
sorry lawl but i took this from a other dude hes register script o.o
and why you should import the character if they register an account? o.o i thougth it wasn't realy needed
I would of kept it that way but it looks like u need more then just AccountID and Password because you are storing data values into more then thos 2 sections.
Also just wondering but wouldn't accounts be your table and not your database?
correct me if im wrong but accounts is just a table its in no way a database.
your $accdb needs to be coserver so it can connect to ur database then select accounts from the database maybe im just miss understanding ur php script wrong though Iv done mine a bit different
Web register problem 08/07/2016 - Shaiya PServer Development - 4 Replies Hey everyone
So I've got a problem with the web register.
1. Call me a newbie but I tried probably every host and such so I can put the files and make a registering page, but I don't know exactly how and which host to use.
2. I don't know exactly what to change in both index.php and processor.php
3. I know there's a way to register someone through the MSQL but I searched everywhere and can't find a proper way.
I followed the guide but still don't know what to do. Any help would be...
Register Problem 10/06/2010 - EO PServer Hosting - 10 Replies Here the problem:
Warning: mysql_connect() : Access denied for user: 'test@localhost' (Using password: YES) in C:\xampp\htdocs\config.php on line 16
please help
Register Problem 11/01/2009 - Metin2 Private Server - 12 Replies Meine Regi geht nicht mehr alles ist an alles läuft super dann kommt das
Warning: mysql_real_escape_string() : Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\xampp\htdocs\reg.php on line 7
Warning: mysql_real_escape_string() : A link to the server could not be established in C:\xampp\htdocs\reg.php on line 7
Warning: mysql_real_escape_string() : Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\xampp\htdocs\reg.php on line 8
Warning:...
PROBLEM ON THE REGISTER 07/25/2009 - SRO Private Server - 2 Replies The credential number must be bigger than 6, be smaller than 20! Please fill in
wth I need to do ther
register problem 06/18/2008 - Cabal Online - 1 Replies whenever I try to register, comes that
ImageShack - Hosting :: cabalfehlerkp8.png
can someone help me?