Variablez 0 Report post Posted October 21, 2008 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
Evolix 1 Report post Posted October 21, 2008 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
TheDisturbedOne 1 Report post Posted October 21, 2008 I think it would be best to contact mccodes for this. They will most likely give you better help, unless there are advanced mccodes users here... Share this post Link to post Share on other sites
iGuest 3 Report post Posted December 30, 2008 $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
iGuest 3 Report post Posted October 6, 2010 Wow you really shouln't even need to ask this question. Why are you playing around with this part? Share this post Link to post Share on other sites