Register for your free account! | Forgot your password?

You last visited: Today at 18:50

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Register problem

Discussion on Register problem within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jan 2009
Posts: 74
Received Thanks: 3
Register problem

Hello,

I got a problem with my register script

Script:
PHP Code:

 <?php
    
if(isset($_POST['retpass']) && isset($_POST['id']) && isset($_POST['pass']))  {  
    if(!Empty(
$_POST['retpass']) && !Empty($_POST['id']) && !Empty($_POST['pass']))  {
          
$ok=false;
      if (
$requireCAPTCHA)  { if (PhpCaptcha::Validate($_POST['CheckCode'])) $ok=true; }
          else 
$ok=true;
          
            if(
$ok)    {
                
mysql_select_db($accdb);
                
$userid trim($_POST['id']);
                
$password=trim($_POST['pass']);
                
$passretype=trim($_POST['retpass']);
                
$hash=$_POST['hash'];
                
                
        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';
Tables in the accounts are called:

AccountID, Password, Status, Character, Email, SecretNumber

Got more info needed tell me then :3

Thx in advance x3
petje1 is offline  
Old 02/16/2011, 23:11   #2
 
elite*gold: 0
Join Date: Dec 2010
Posts: 85
Received Thanks: 0
Tell me if ya got it fixed got THE same prob
HackProvider is offline  
Old 02/16/2011, 23:15   #3
 
elite*gold: 0
Join Date: Jan 2009
Posts: 74
Received Thanks: 3
Some 1 had fixed it for me but then i accedently deleted it D:

So hope some 1 wil help xD
petje1 is offline  
Old 02/17/2011, 01:02   #4
 
Mr_PoP's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 759
Received Thanks: 285
Quote:
Originally Posted by petje1 View Post

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 " "

PHP Code:
 mysql_query('INSERT INTO accounts(AccountID,Password) VALUES ("'
                  
.$userid.'","'.($passhash $hash $password).'","'
                  
.$_SERVER['REMOTE_ADDR'].'", "'.'255.255.255.0")'); 
ur php is not even close to be right coded -.- well this may work:
PHP Code:
 mysql_query('INSERT INTO "accounts" SET "AccountID"="'.$userid.'","Password"="'.($passhash $hash $password).'","Email"="'.$mail.'" '
thats all ur table can hase u cant set $_SERVER['REMOTE_ADDR'] or 255.255.255.0 to it , my code should work for u test it
Mr_PoP is offline  
Old 02/17/2011, 13:04   #5
 
elite*gold: 0
Join Date: Jan 2009
Posts: 74
Received Thanks: 3
Im getting this error then

Code:
C:\AppServ\www\register.php on line 83
Code is now:

PHP Code:
<?php
    
if(isset($_POST['retpass']) && isset($_POST['id']) && isset($_POST['pass']))  {  
    if(!Empty(
$_POST['retpass']) && !Empty($_POST['id']) && !Empty($_POST['pass']))  {
          
$ok=false;
      if (
$requireCAPTCHA)  { if (PhpCaptcha::Validate($_POST['CheckCode'])) $ok=true; }
          else 
$ok=true;
          
            if(
$ok)    {
                
mysql_select_db($accdb);
                
$userid trim($_POST['id']);
                
$password=trim($_POST['pass']);
                
$passretype=trim($_POST['retpass']);
                
$hash=$_POST['hash'];
                
                
        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

edit:
this is what he says on line 83 o.o
Code:
								echo 'Success > Account registered successfully.';
petje1 is offline  
Old 02/17/2011, 17:50   #6
 
Mr_PoP's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 759
Received Thanks: 285
Quote:
Originally Posted by petje1 View Post
Im getting this error then

Code:
C:\AppServ\www\register.php on line 83
Code is now:

PHP Code:
<?php
    
if(isset($_POST['retpass']) && isset($_POST['id']) && isset($_POST['pass']))  {  
    if(!Empty(
$_POST['retpass']) && !Empty($_POST['id']) && !Empty($_POST['pass']))  {
          
$ok=false;
      if (
$requireCAPTCHA)  { if (PhpCaptcha::Validate($_POST['CheckCode'])) $ok=true; }
          else 
$ok=true;
          
            if(
$ok)    {
                
mysql_select_db($accdb);
                
$userid trim($_POST['id']);
                
$password=trim($_POST['pass']);
                
$passretype=trim($_POST['retpass']);
                
$hash=$_POST['hash'];
                
                
        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

edit:
this is what he says on line 83 o.o
Code:
								echo 'Success > Account registered successfully.';
upload ur php and a dumb of ur table
Mr_PoP is offline  
Old 02/18/2011, 12:22   #7
 
BioHazarxPaul's Avatar
 
elite*gold: 0
Join Date: Nov 2005
Posts: 548
Received Thanks: 93
Code:
mysql_query('INSERT INTO accounts(AccountID,Password) VALUES ("' . $userid . '","' . ($passhash ? $hash : $password) . '","' . $_SERVER['REMOTE_ADDR'] . '", "' . '255.255.255.0")');
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?
BioHazarxPaul is offline  
Old 02/18/2011, 14:42   #8
 
elite*gold: 0
Join Date: Jan 2009
Posts: 74
Received Thanks: 3
Its my account table

Where all the accounts are stored
anyway

here is the link to my config and register
petje1 is offline  
Old 02/18/2011, 15:06   #9
 
BioHazarxPaul's Avatar
 
elite*gold: 0
Join Date: Nov 2005
Posts: 548
Received Thanks: 93
$accdb='accounts'; - You need to fix that then it should be ur database not ur table.
BioHazarxPaul is offline  
Old 02/18/2011, 16:26   #10
 
elite*gold: 0
Join Date: Jan 2009
Posts: 74
Received Thanks: 3
Like i explained later on.
My account Table is called:"accounts" where all the accounts are stored?

My normal database where all the tables are in is called coserver
petje1 is offline  
Old 02/19/2011, 17:31   #11
 
BioHazarxPaul's Avatar
 
elite*gold: 0
Join Date: Nov 2005
Posts: 548
Received Thanks: 93
Quote:
Originally Posted by petje1 View Post
Like i explained later on.
My account Table is called:"accounts" where all the accounts are stored?

My normal database where all the tables are in is called coserver
okay so one of the problems i am seeing is
$accdb='accounts'; <- This need to be that -> $accdb='coserver';
in your config.php
BioHazarxPaul is offline  
Old 02/19/2011, 17:53   #12
 
elite*gold: 0
Join Date: Jan 2009
Posts: 74
Received Thanks: 3
You dont get it do you?

wait i'll make a screenshot



As you can see the config files are good...
petje1 is offline  
Old 02/19/2011, 20:33   #13
 
BioHazarxPaul's Avatar
 
elite*gold: 0
Join Date: Nov 2005
Posts: 548
Received Thanks: 93
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
BioHazarxPaul is offline  
Old 02/20/2011, 00:54   #14
 
elite*gold: 0
Join Date: Jan 2009
Posts: 74
Received Thanks: 3
What it does it first connects to the database then it needs the name of the Account table to get the accounts i'll think o.o

But could you make yours so it works on mine? cause i can't figure out the prob o.o

edit:

I tried changeing the config file but it does the same
There must be something wrong in the register script o.o
petje1 is offline  
Old 02/20/2011, 02:23   #15
 
stealarcher's Avatar
 
elite*gold: 0
Join Date: Apr 2006
Posts: 231
Received Thanks: 94
#problem solved. Column count didnt match value count on the mysql insert.
stealarcher is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
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?



All times are GMT +2. The time now is 18:50.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.