Jump to content
xisto Community
Sign in to follow this  
Variablez

Mccodes Registration Edit New Mod??

Recommended Posts

Im so confused! I dont know where to add the code for:

$username=$_POST['username'];$username=str_replace(array("<", ">"), array("<", ">"), $username);$q=mysql_query("SELECT * FROM users WHERE username='{$username}'",$c);$ipcheak=mysql_query("SELECT * FROM `users` WHERE lastip='$ip'",$c);if(mysql_num_rows($ipcheak)){die("Someone is already using this computer's address for London Wars! Please contact Variablez and ask him to make you an account if you need to!");}

one ip per acount mod on this page:

<?phpinclude "config.php";global $_CONFIG;define("MONO_ON", 1);require "class/class_db_{$_CONFIG['driver']}.php";$db=new database;$db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']);$db->connect();$c=$db->connection_id;$set=array();$settq=$db->query("SELECT * FROM settings");while($r=$db->fetch_row($settq)){$set[$r['conf_name']]=$r['conf_value'];}//thx to [url=http://http://www.phpit.net/rg-erdr.php?_rpo=t; for valid_emailfunction valid_email($email) {  // First, we check that there's one @ symbol, and that the lengths are right  if (!ereg("^[^@]{1,64}@[^@]{1,255}$", $email)) {	// Email invalid because wrong number of characters in one section, or wrong number of @ symbols.	return false;  }  // Split it into sections to make life easier  $email_array = explode("@", $email);  $local_array = explode(".", $email_array[0]);  for ($i = 0; $i < sizeof($local_array); $i++) {	 if (!ereg("^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$", $local_array[$i])) {	  return false;	}  }    if (!ereg("^\[?[0-9\.]+\]?$", $email_array[1])) { // Check if domain is IP. If not, it should be valid domain name	$domain_array = explode(".", $email_array[1]);	if (sizeof($domain_array) < 2) {		return false; // Not enough parts to domain	}	for ($i = 0; $i < sizeof($domain_array); $i++) {	  if (!ereg("^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$", $domain_array[$i])) {		return false;	  }	}  }  return true;
and theres more but i think its somwhere in there? any idea? any help please?

Notice from rvalkass:

Code needs to be in code tags. Also moved to the PHP section of the forums.

Share this post


Link to post
Share on other sites

Looking at the 'SQL Data' configurations, looks like this code will probably have to go in your config.php file, or the variables will have to go in your register.php file. If that doesn't work, it probably goes into your login.php because of the "Someone is already using this computer's address...". It could be either. Plus, how did you find this code/error in the first place?

Share this post


Link to post
Share on other sites

$username=$_POST['username'];$username=str_replace(array("<", ">"), array("<", ">"), $username);$q=mysql_query("SELECT * FROM users WHERE username='{$username}'",$c);If(mysql_num_rows($q))

It is saying that the last line posted is wrong. I am 100% new at this and I am working little by little. I am not sure why it is wrong. The posted error msg is below:

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/jokers/public_html/register.Php on line 6

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/jokers/public_html/register.Php on line 75

Then when I login it says:

No database selected

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.