sevendet Posted November 16, 2006 Posted November 16, 2006 ok i have had to take out my register.php file because someone is able to make names like this a aa aaa aaaa aaaaaa aaaaaaaa how do i make it where you only get 1 signup through your ip? Quote
seanybob Posted November 16, 2006 Posted November 16, 2006 Re: Multi Account Issues $ip = ($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; $q=mysql_query("SELECT * FROM users WHERE lastip='$ip'",$c); if(mysql_num_rows($q)) { die("One acc per ip"); } should work... Quote
sevendet Posted November 16, 2006 Author Posted November 16, 2006 Re: Multi Account Issues do i replace this $ip = ($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; if(file_exists('ipbans/'.$ip)) { die("<font color=red size=+1>Your IP has been banned, there is no way around this.</font></body></html>"); } with what you posted then? thats in register.php Quote
sevendet Posted November 16, 2006 Author Posted November 16, 2006 Re: Multi Account Issues so i tried to replace that and this is what i got Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/game/public_html/register.php on line 27 Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/game/public_html/register.php on line 28 Quote
Decepti0n Posted November 16, 2006 Posted November 16, 2006 Re: Multi Account Issues $ip = ($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; $q=mysql_query("SELECT COUNT(*) FROM users WHERE lastip='$ip'"); $count = mysql_fetch_array($q); if($count[0] > 0) { die("One acc per ip"); } Quote
sevendet Posted November 16, 2006 Author Posted November 16, 2006 Re: Multi Account Issues Warning: mysql_query(): Access denied for user 'nobody'@'localhost' (using password: NO) in /home/game/public_html/register.php on line 27 Warning: mysql_query(): A link to the server could not be established in /home/game/public_html/register.php on line 27 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/game/public_html/register.php on line 28 Quote
seanybob Posted November 16, 2006 Posted November 16, 2006 Re: Multi Account Issues aye caramba... you need to include mysql.php :cry: Quote
spellbyte ® Posted November 16, 2006 Posted November 16, 2006 Re: Multi Account Issues fixed this, he was calling the mysql after the query for lastip Quote
sevendet Posted November 18, 2006 Author Posted November 18, 2006 Re: Multi Account Issues it doesnt let anyone sign up at all period its telling people who have never signed up before that only 1 account per ip Quote
rfw2003 Posted November 19, 2006 Posted November 19, 2006 Re: Multi Account Issues need to change this if($count[0] > 0) to this if($count[0] > 1) Quote
sevendet Posted November 19, 2006 Author Posted November 19, 2006 Re: Multi Account Issues now it lets you register but doesnt stop the multi account this is what the section looks like  require "mysql.php"; $sd = ($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; $q=mysql_query("SELECT COUNT(*) FROM users WHERE lastip='$ip'"); $count = mysql_fetch_array($q); if($count[0] > 1) { die("<center></center><center><h1>One account per ip</h1></center>  <center>If you wish to create an account for a family member then plase contact me <a href='mailto:[email protected]?subject=Multiple%20Account'> <font color='red'>HERE</font></a></center>"); } if(file_exists('ipbans/'.$sd)) { die("<font color=red size=+1>Your IP has been banned, there is no way around this.</font></body></html>"); } global $c; Quote
sevendet Posted November 20, 2006 Author Posted November 20, 2006 Re: Multi Account Issues i really do think this should be something put out there i mean we work hard on our game and to let people sit there and create 600 accounts back to back is ridiculous Quote
rfw2003 Posted November 20, 2006 Posted November 20, 2006 Re: Multi Account Issues o.k. I have tested this, and it seems to work just fine.  It won't even let them type in thier info, if thier IP is the same as one that is already registered. require "mysql.php"; global $c; $q=mysql_query("SELECT * FROM users WHERE lastip='{$ip}'",$c); if(mysql_num_rows($q)) { die ("IP already in use. If you would like to register a Family member plz email the owners at owner@#######"); } R.F. Quote
sevendet Posted November 20, 2006 Author Posted November 20, 2006 Re: Multi Account Issues its not letting anyone sign up still ive been testing different things and i cant seem to get this either Quote
rfw2003 Posted November 20, 2006 Posted November 20, 2006 Re: Multi Account Issues its not letting anyone sign up still ive been testing different things and i cant seem to get this either Did you take out all you had before and put what I suggested in it's place Also if you are trying to test with you own computer you will not be able to register with it. You will need to use another computer that has a different IP Quote
sevendet Posted November 21, 2006 Author Posted November 21, 2006 Re: Multi Account Issues im trying it on my own server lol here look for yourself www.axis-of-power.net Quote
UCC Posted November 21, 2006 Posted November 21, 2006 Re: Multi Account Issues It doesnt work. It wont let me register but I've never been to your site Quote
sevendet Posted November 21, 2006 Author Posted November 21, 2006 Re: Multi Account Issues yea we gotta keep trying to find this thing and make it work right someone said this would work too but i was getting errors } $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("Someones Already Using This IP"); } Quote
R!der Posted November 21, 2006 Posted November 21, 2006 Re: Multi Account Issues $ip = ($_SERVER['HTTP_X_FORWARDED_FOR'])   ? $_SERVER['HTTP_X_FORWARDED_FOR']   : $_SERVER['REMOTE_ADDR']; $q=mysql_query("SELECT COUNT(*) FROM users WHERE lastip='$ip'"); $count = mysql_fetch_array($q); if($count[0] > 0) { die("One acc per ip"); } This worked for me. with no problems Quote
rfw2003 Posted November 21, 2006 Posted November 21, 2006 Re: Multi Account Issues Not sure what's going on with yours sevendet, but I had no problems with the script I posted, but then again there may be a few diffs, between our setups. On another note, I tried the link above for you game, when I click register I get a 404 page not found error. Quote
solar Posted June 10, 2007 Posted June 10, 2007 Re: Multi Account Issues Simple :-D open register.php and replace with this <?php session_start(); print "<html> <head> <title>Crime-city</title> <style> body { font-family:Verdana;font-size:9pt;color: white; background-color:#000000; scrollbar-base-color: #005B70; scrollbar-arrow-color: #F3960B; scrollbar-DarkShadow-Color: #000000; } a:visited,a:active,a:hover,a:link { color: blue;text-decoration: none; } table,tr,td { font-size:9pt; } img { border:none; } </style> </head> <body><table width='100%' border='1' bgcolor='#000000'> <tr> <th scope='col'>[img=logo.png]</th> </tr> </table> <center> "; $ip = ($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; if(file_exists('ipbans/'.$ip)) { die("[b]<font color=red size=+1>Your IP has been banned, there is no way around this.</font>[/b]</body></html>"); } require "mysql.php"; global $c; if($_POST['username']) { $sm=100; if($_POST['promo'] == "908") { $sm+=100; } $username=$_POST['username']; $username=str_replace(array("<", ">"), array("<", ">"), $username); $q=mysql_query("SELECT * FROM users WHERE username='{$username}'",$c); if(mysql_num_rows($q)) { print "Username already in use. Choose another."; } else if($_POST['password'] != $_POST['cpassword']) { print "The passwords did not match, go back and try again."; } else { $_POST['ref'] = abs((int) $_POST['ref']); $ip = ($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; $q=mysql_query("SELECT * FROM users WHERE lastip='$ip' AND userid={$_POST['ref']}",$c); $a=mysql_query("SELECT * FROM users WHERE lastip='$ip'",$c); if(mysql_num_rows($a) > 0) { die("No multi's! Your not trying to make another account are you! Sorry! Not Allowed!"); } if(mysql_num_rows($q)) { die("Creating Referral Multies Is Not Aloud."); } if($_POST['ref']) { $q=mysql_query("SELECT * FROM users WHERE userid={$_POST['ref']}",$c); $r=mysql_fetch_array($q); } mysql_query("INSERT INTO users (username, login_name, userpass, level, money, user_level, energy, maxenergy, will, maxwill, brave, maxbrave, hp, maxhp, location, gender, signedup, email, lastip) VALUES( '{$username}', '{$username}', md5('{$_POST['password']}'), 1, $sm, 1, 12, 12, 100, 100, 5, 5, 100, 100, 1, '{$_POST['gender']}', unix_timestamp(), '{$_POST['email']}', '$ip')", $c); $i=mysql_insert_id($c); mysql_query("INSERT INTO userstats VALUES($i, 10, 10, 10, 10, 10)", $c); if($_POST['ref']) { require "global_func.php"; mysql_query("UPDATE users SET crystals=crystals+2 WHERE userid={$_POST['ref']}",$c); event_add($_POST['ref'],"For refering $username to the game, you have earnt 2 valuable crystals!",$c); mysql_query("INSERT INTO referals VALUES('', {$_POST['ref']}, $i, unix_timestamp(),'{$r['lastip']}','$ip')", $c); } print "Thank You For Registering! Please Login. > [url='login.php']Login[/url]"; } } else { print "<style type='text/css'> <!-- #Layer2 { position:absolute; width:200px; height:115px; z-index:1; left: 354px; top: 356px; } #Layer6 { position:absolute; width:182px; height:202px; z-index:2; left: 10px; top: 204px; } #Layer7 { position:absolute; width:200px; height:115px; z-index:3; left: 350px; top: 201px; } #Layer8 { position:absolute; width:1081px; height:33px; z-index:4; left: 71px; top: 590px; } --> </style> <body bgcolor='#000000'> <div id='Layer7'> <table width='530' height='109' border='1' bgcolor='#000000'> <tr> <th scope='col'> Crime-city Registration</th> </tr> <td> <center> <form action=register.php method=post> <table width='530' border='1'> <td><div align='center'>Username:</div></td> <td><div align='center'> <input type='text' name='username' /> </div></td> </tr> <tr> <td><div align='center'>Password:</div></td> <td><div align='center'> <input type='password' name='password' /> </div></td> </tr> <tr> <td><div align='center'>Confirm Password: </div></td> <td><div align='center'> <input type='password' name='cpassword' /> Gender: <select type='dropdown' name='gender'><option value='male'>Male</option><option value='female'>Female</option></select> </div></td> </tr> <tr> <td><div align='center'>Email Address: </div></td> <td><div align='center'> <input type='text' name='email' /> </div></td> </tr> <tr> <td><div align='center'>Promo Code: </div></td> <td><div align='center'> <input type=text name=promo /> </div></td> </tr> <tr> </tr> </table> <input type=hidden name=ref value='"; if($_GET['REF']) { print $_GET['REF']; } print "'> <input type=submit value=Submit></form><form name=tos> <input type='checkbox' name=mybox value='1'>I Agree To The Terms Of Service </form> </center></td> </tr> </table> </div> <div id='Layer6'> <table width='181' height='203' border='1' bgcolor='#000000'> <tr> <th height='39' scope='col'>Navigation</th> </tr> <tr> <td height='30'>[url='login.php']Login[/url]</td> </tr> <tr> <td height='28'>[url='register.php']Register[/url]</td> </tr> <tr> <td height='30'>[url='#']Lost Password?[/url]</td> </tr> <tr> <td height='30'>[url='#']Screenshots[/url]</td> </tr> <tr> <td height='30'>[url='tos.php']Terms Of Service[/url]</td> </tr> </table> </div> <div id='Layer8'> table width='98%' border='1' bgcolor='#000000'> <tr> <th scope='col'><center> | This Game Is Brought To You By solar! | </center>"; } print "</body></html>"; ?> Make sure you change "Crime-city" to your game name :-P That register page has a great look and u can select gender woooo plus no multis Quote
deathknight90 Posted June 16, 2007 Posted June 16, 2007 Re: Multi Account Issues the reason this is not working... My gues sthat your using v. 2 codes. This codes is for v.1 and v. 1.1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.