-
Posts
151 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by Daron
-
alright i'll look into finding that script & umm raven i think u misunderstood me, i know how to change the colors using hex colors, i wanted to make it look better like have the text appear in a nice table
-
Putting limits on names that users can sign up with
Daron replied to Daron's topic in Modification Support
this worked! Thank you! -
Hey can anyone help me or point me in the right direction to putting limits on my register.php so that i can limit what people can sign up with? i already have this if(strlen($_POST['username']) < 3) { die("Sorry, the username is too short.<br /> ><a href='register.php'>Back</a>"); } which obviously stops names from being less than 3 characters. But call me a strictler but is it possible to prevent the following things; 1. Names in all caps 2.Names that are all numbers 3. symbols such as the @ symbol and both back slashes and forward slashes and also in yall opinion whats a good a good limit on max characters for a name? i hate when people sign up for games with dumb long names like mnomonomnomon and yes i've seen a name like that b4
-
Hey everyone i have an shoutbox that works cool BUT it looks extremely ugly like when you post the text just there, out in the open like its no table or lines or nothing to make it look better. So i know this may sound noobish but would someone feel like but would someone feel like editing the code to make it look better? It works fine like everything is cool how i want it, i just dont like the way it looks. Here is the code and screen shot. Screen Shot: Screen Shot <?php session_start(); include "globals.php"; ?> <style> body { background-color: black; scrollbar-base-color: white scrollbar-arrow-color: #000000; scrollbar-DarkShadow-Color: #000000; bgbackground: black; bgcolor: black; } a:visited,a:active,a:hover,a:link { color:white;text-decoration: none; } table,tr,td { font-size: 11.1; } img { border:none; } .button { font-family:helvetica, arial, geneva, sans-serif; font-size:12; color:#000000; background-color: white; } input,textarea,dropdown{ font-family:helvetica, arial, geneva, sans-serif; font-size:12; color:#000000; background-color: white; border: 1px solid; } textarea,.submit input{ font-family:helvetica, arial, geneva, sans-serif;font-size:12;color:#000000; } textarea { font-family:helvetica, arial, geneva, sans-serif;font-size:11;color: #000000; } a:hover { color: blue;text-decoration: blink; text-decoration: underline; background: none; } </style> <center> <a href="<?php echo $_SERVER['PHP_SELF']; ?>">-> <b>Refresh Shout Box</b> <-</a> <?php if($ir['user_level']>1) { echo"<br><a href='?action=banlist'>-> <b>Ban List</b> <-</a>"; } ?> <br><a href='?action=shoutbox'></a> </center> <?php if($ir['banshout']==1) { echo"You cannot access the shout box while being banned."; exit; } if($_GET['action']==del) { if($ir['user_level']>1) { $id=$_GET['id']; $db->query("DELETE FROM shoutbox WHERE id='{$id}'") or die(mysql_error()); echo""; } else { echo""; } } if($_GET['action']==shoutbox) { global $ir,$c,$userid,$h; echo "Your Shoutbox is now "; if($ir['shoutbox']==1) { echo "hidden"; $db->query("UPDATE users SET shoutbox=0 WHERE userid=$userid",$c); } if($ir['shoutbox']==0) { echo "showing"; $db->query("UPDATE users SET shoutbox=1 WHERE userid=$userid",$c); } exit; } if($_GET['action']==ban) { if($ir['user_level']>1) { $id=$_GET['id']; $db->query("UPDATE users SET banshout=1 WHERE userid='{$id}'") or die(mysql_error()); echo""; } else { echo""; } } if($_GET['action']==banlist) { echo"<table border=1 width=50%><th>User</th><th>Actions</th><tr>"; $d=$db->query("SELECT * FROM users WHERE banshout=1") or die(mysql_error()); while($t=$db->fetch_row($d)) { echo"<td>{$t['username']}</td><td><a href='?action=unban&id={$t['userid']}'>Unban</td><tr>"; } echo"</table>"; exit; } if($_GET['action']==unban) { if($ir['user_level']>1) { $id=$_GET['id']; $db->query("UPDATE users SET banshout=0 WHERE userid='{$id}'") or die(mysql_error()); echo""; } else { echo""; } } if ($_GET['action']=='1') { $newmsg = strip_tags($_POST['msg'],""); $string = "$newmsg"; $new_string = str_replace($replace, $search, $string); $new_string = str_replace($search, $replace, $string); print "</form>"; if ($_POST['msg']) { $starter = "<font color=white>{$ir['username']}</font>"; if ($ir['userid']==1) { $starter = "<font color=purple>{$ir['username']}</font>"; } if ($ir['title']=='Captain') { $starter = "<font color=blue>{$ir['username']}</font>"; } if ($ir['title']=='Lieutenant') { $starter = "<font color=red>{$ir['username']}</font>"; } if ($ir['race']=='Hollow') { $starter = "<font color=black>{$ir['username']}</font>"; } $id=$ir['userid']; $db->query("INSERT INTO shoutbox VALUES ('', unix_timestamp(),'<a href=user.php?ID=$id target=_blank>$starter</a>','$userid', '$new_string')"); } } $bk = $db->query("select * from shoutbox order by id desc limit 15"); while ($chat = $db->fetch_row($bk)) { $time=date('g:i a',$chat['time']); print "</center>"; if($ir['user_level']>1){echo"<a href='?action=del&id={$chat['id']}'><font color=red>[D]</font></a><a href='?action=ban&id={$chat[userid]}'><font color=lime>[b]</font></a>";}echo"<font color=990099>[$time]</font></b><b>$chat[user]</b></font></font></font></font></a></a></a></a></a><font color=red>:</font> <font color=white>$chat[chat]</font><br>"; } ?> <center> <form method=post action=shoutbox.php?action=1> <font color=white>Enter Message:</font> <input type=text name=msg size=20><br /> </form> </center> </body>
-
this is lines 250-265 if ($db->num_rows($warq) > 0) { $war=$db->fetch_row($warq); $db->query("UPDATE squads SET squadPOINTS=squadPOINTS+1 WHERE squadID={$r['squad']}"); $db->query("UPDATE squads SET squadPOINTS=squadPOINTS-1 WHERE squadID={$ir['squad']}"); } echo "<center><font color=white>You need to train harder.You were defeated.</center>"; } } //UPDATE USERS $result = mysql_query("UPDATE users SET hp = $r['hp'] WHERE userid=$r['userid']", $c) or die(mysql_error()); $result = mysql_query("UPDATE users SET hp = $ir['hp'] WHERE userid=$userid", $c) or die(mysql_error()); echo "</td></tr>"; ?>
-
Hey i was working on modifying a one click attack system and i fixed alot of the errors myself but i just cannot fix this error Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/kaname/public_html/attack2.php on line 262 here is the code starting from line 262 $result = mysql_query("UPDATE users SET hp = $r['hp'] WHERE userid=$r['userid']", $c) or die(mysql_error()); $result = mysql_query("UPDATE users SET hp = $ir['hp'] WHERE userid=$userid", $c) or die(mysql_error()); echo "</td></tr>"; ?>
-
okay thanx, i'll give it a shot
-
All right last couple days my hosting account has been getting temporary disabled due to hru(High Resource Usage) i just couldnt figure it out, i made a crappy low quality layout, used external cron jobs and etc but they kept shutting me down saying i reach the resources limit -_- so i decided to disbaled shoutbox.php and sure nuff no more hru problems ^^ BUT now i have to global way for my players to chat with each other =/ anybody know any alternative mccodes chat like system because shoutbox screwed me over. If anybody was curious here is the code <?php session_start(); include "globals.php"; ?> <style> body { background-color: black; scrollbar-base-color: white scrollbar-arrow-color: #000000; scrollbar-DarkShadow-Color: #000000; bgbackground: black; bgcolor: black; } a:visited,a:active,a:hover,a:link { color:white;text-decoration: none; } table,tr,td { font-size: 11.1; } img { border:none; } .button { font-family:helvetica, arial, geneva, sans-serif; font-size:12; color:#000000; background-color: white; } input,textarea,dropdown{ font-family:helvetica, arial, geneva, sans-serif; font-size:12; color:#000000; background-color: white; border: 1px solid; } textarea,.submit input{ font-family:helvetica, arial, geneva, sans-serif;font-size:12;color:#000000; } textarea { font-family:helvetica, arial, geneva, sans-serif;font-size:11;color: #000000; } a:hover { color: blue;text-decoration: blink; text-decoration: underline; background: none; } </style> <center> <a href="<?php echo $_SERVER['PHP_SELF']; ?>">-> <b>Refresh Shout Box</b> <-</a> <?php if($ir['user_level']>1) { echo"<br><a href='?action=banlist'>-> <b>Ban List</b> <-</a>"; } ?> <br><a href='?action=shoutbox'></a> </center> <?php if($ir['banshout']==1) { echo"You cannot access the shout box while being banned."; exit; } if($_GET['action']==del) { if($ir['user_level']>1) { $id=$_GET['id']; $db->query("DELETE FROM shoutbox WHERE id='{$id}'") or die(mysql_error()); echo""; } else { echo""; } } if($_GET['action']==shoutbox) { global $ir,$c,$userid,$h; echo "Your Shoutbox is now "; if($ir['shoutbox']==1) { echo "hidden"; $db->query("UPDATE users SET shoutbox=0 WHERE userid=$userid",$c); } if($ir['shoutbox']==0) { echo "showing"; $db->query("UPDATE users SET shoutbox=1 WHERE userid=$userid",$c); } exit; } if($_GET['action']==ban) { if($ir['user_level']>1) { $id=$_GET['id']; $db->query("UPDATE users SET banshout=1 WHERE userid='{$id}'") or die(mysql_error()); echo""; } else { echo""; } } if($_GET['action']==banlist) { echo"<table border=1 width=50%><th>User</th><th>Actions</th><tr>"; $d=$db->query("SELECT * FROM users WHERE banshout=1") or die(mysql_error()); while($t=$db->fetch_row($d)) { echo"<td>{$t['username']}</td><td><a href='?action=unban&id={$t['userid']}'>Unban</td><tr>"; } echo"</table>"; exit; } if($_GET['action']==unban) { if($ir['user_level']>1) { $id=$_GET['id']; $db->query("UPDATE users SET banshout=0 WHERE userid='{$id}'") or die(mysql_error()); echo""; } else { echo""; } } if ($_GET['action']=='1') { $newmsg = strip_tags($_POST['msg'],""); $string = "$newmsg"; $search = array( ':behind:', ':tagteam:', ':blow:', ':smack:', ':bumsmack:', ':whip:', ':69:', ':kiss:', ':wedgie:', ':]', ':D', ':oo:', 'O.o', ':/', ':angry:', ':?:', ':lol:', ':-:', ':O', ':(', 'O.O', ':roll:', ':zzz:', ':)', ':P', ':S', ':nut:', ';)', ':heart:', 'XD', '[b]', '[/b]', '[i]', '[/i]', '[u]', '[/u]', '[s]', '[/s]', '[url', '[', ']', '/url', '[font color', '[/font]', '[right]', '/right', '[center]', '/center', '[left]', '/left', ' ' ); $replace = array( '<img src="/images/smileys/fuckher.gif">', '<img src="/images/smileys/tagteam.gif">', '<img src="/images/smileys/blowme.gif">', '<img src="/images/smileys/slap.gif">', '<img src="/images/smileys/smiley_ass.gif">', '<img src="/images/smileys/whip.gif">', '<img src="/images/smileys/69.gif">', '<img src="/images/smileys/kiss.gif">', '<img src="/images/smileys/wedgie.gif">', '<img src="/images/happy.gif">', '<img src="/images/biggrin.gif">', '<img src="/images/cool.gif">', '<img src="/images/blink.gif">', '<img src="/images/dry.gif">', '<img src="/images/angry.gif">', '<img src="/images/huh.gif">', '<img src="/images/laugh.gif">', '<img src="/images/mellow.gif">', '<img src="/images/ohmy.gif">', '<img src="/images/sad.gif">', '<img src="/images/ph34r.gif">', '<img src="/images/rolleyes.gif">', '<img src="/images/sleep.gif">', '<img src="/images/smile.gif">', '<img src="/images/tongue.gif">', '<img src="/images/unsure.gif">', '<img src="/images/wacko.gif">', '<img src="/images/wink.gif">', '<img src="/images/wub.gif">', '<img src="/images/XD.gif">', ' <b>', '</b>', ' <i>', '</i>', ' <u>', '</u>', ' <s>', '</s>', '<a href', '<', '>', '/a', '<font color', '/font', '<font align=right>', '/font', '<font align=center>', '/font', '<font align=left>', '/font', '<br>' ); $new_string = str_replace($replace, $search, $string); $new_string = str_replace($search, $replace, $string); print "</form>"; if ($_POST['msg']) { $starter = "<font color=white>{$ir['username']}</font>"; if ($ir['userid']==1) { $starter = "<font color=purple>{$ir['username']}</font>"; } if ($ir['title']=='Captain') { $starter = "<font color=blue>{$ir['username']}</font>"; } if ($ir['title']=='Lieutenant') { $starter = "<font color=red>{$ir['username']}</font>"; } if ($ir['race']=='Hollow') { $starter = "<font color=black>{$ir['username']}</font>"; } $id=$ir['userid']; $db->query("INSERT INTO shoutbox VALUES ('', unix_timestamp(),'<a href=user.php?ID=$id target=_blank>$starter</a>','$userid', '$new_string')"); } } $bk = $db->query("select * from shoutbox order by id desc limit 15"); while ($chat = $db->fetch_row($bk)) { $time=date('g:i a',$chat['time']); print "</center>"; if($ir['user_level']>1){echo"<a href='?action=del&id={$chat['id']}'><font color=red>[D]</font></a><a href='?action=ban&id={$chat[userid]}'><font color=lime>[b]</font></a>";}echo"<font color=990099>[$time]</font></b><b>$chat[user]</b></font></font></font></font></a></a></a></a></a><font color=red>:</font> <font color=white>$chat[chat]</font><br>"; } ?> <center> <form method=post action=shoutbox.php?action=1> <font color=white>Enter Message:</font> <input type=text name=msg size=20><br /> </form> </center> </body>
-
ah okay dave i will look out for that. & ah not bad i guess i could try find a cheap one
-
Anybody know a really good free web host? i currently use x10 free server, BUT i keep hitting a resource limit and my site keeps being blocked, i run a text based mmorpg and it sux to keep being temp shutdown due to high traffic -_- anybody know any other good free host? i love x10 because of their awesome cPanel VPS Optimized 3. But i just cant deal with the constant resource limit hit thing :confused:
-
Thanx soooo much its perfect!
-
looks nice ^_^ but its not transparent though, the background is just white now
-
Hey would someone be so kind as to make or customize me a logo/banner? there are only 2 requirements i need, 1. i need it to be the dimensions 421x167 and 2. i need it to say Bleach RPG. Here is the one i currently have; i like this one alot but the problem is just that it says Bleach Desu then i have another one the problem with this one is that the background is not transparent. If somebody could do that for me i would be ever so grateful, make one like one of the 2 i just showed
-
hey sounds interesting can you post or pm me a link to sign up? i been looking for a fresh new game to play
-
way to expand if you could get it to respond based on keywords that would be really EPIC & useful.
-
ohhh see i knew i was suppose to use that, a friend told me that i had to use ajax.
-
is it possible to use ajax on a link? i wanted to "attempt" to try get ajax incorporated into inventory.php i tried making only the itemuse.php link ajax but it doesent work, i tried doing this <script type="text/javascript"> function loadXMLDoc() { var xmlhttp; if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("myDiv").innerHTML=xmlhttp.responseText; � } } xmlhttp.open("GET","itemuse.php?ID={$i['inv_id']}",true); xmlhttp.send(); } </script>
-
Hey MWG community i was just working on my register.php & started wondering would it be possible to substitute that super long query in register.php by just setting default values for all those columns. for example instead of using $db->query("INSERT INTO userstats VALUES($i, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10)"); couldnt i just set the default value for all those as 10 then remove the query? if so i would do this to all the queries :cool: except ones like userid, name, & password.
-
oh yea i forgot to remove that, i wont be using random times, the times will be absolute based off $ir['agility']
-
hey i was altering the travel time mod a bit, to make it so normal travel time is 30 minutes and decreases based off your agility by incremnents of 5. but i get this error QUERY ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE userid=1' at line 1 Query was UPDATE users SET location=11, traveltime= WHERE userid=1 here is code: <?php include "globals.php"; include "travellingglobals.php"; if($ir['agility']>=500) { $rantime = rand(30); } else if($ir['agility']>=1000) { $rantime = rand(25); } else if($ir['agility']>=1500) { $rantime = rand(20); } else if($ir['agility']>=2000) { $rantime = rand(15); } else if($ir['agility']>=2500) { $rantime = rand(10); } else if($ir['agility']>=3000) { $rantime = rand(5); } else if($ir['agility']>=5000) { $rantime = rand(0); } $_GET['to'] = abs((int) $_GET['to']); if(!$_GET['to']) { print "You set out to travel. Where are you travelling to? "; $q=$db->query("SELECT * FROM villages WHERE villageID != {$ir['location']} AND villageminlevel <= {$ir['level']}"); print "<table width=75% cellspacing=1 class='table'><tr style='background:gray'><th>Name</th><th>Description</th><th>Min Level</th><th> </th></tr>"; while($r=$db->fetch_row($q)) { print "<tr><td>{$r['villageNAME']}</td><td>{$r['villageDESC']}</td><td>{$r['villageminlevel']}</td><td><a href='travel.php?to={$r['villageID']}'>Go</a><br /></td></tr>"; } print "</table>"; } else if( ((int) $_GET['to']) != $_GET['to']) { print "Invalid city ID"; } else { $q=$db->query("SELECT * FROM villages WHERE villageID = {$_GET['to']} AND villageminlevel <= {$ir['level']}"); if(!$db->num_rows($q)) { print "Error, this city either does not exist or you cannot go there."; } else { $db->query("UPDATE users SET location={$_GET['to']}, traveltime=$rantime WHERE userid=$userid"); $r=$db->fetch_row($q); print "You are now travelling to {$r['villageNANE']} on foot! It will take $rantime minutes to arrive."; } } $h->endpage(); ?>
-
hey this is for people who may be new to coding an rpg or veterans who need an test server, here is an good reliable FREE web host i came across http://api.hostchicken.co.cc/redir/159524 they dont put you through a bunch of lame obligations & the owner/admin is very friendly & not hard to get in contact with. here is link again http://api.hostchicken.co.cc/redir/159524
-
i fixed it, funny part is im not exactly sure what was wrong, i just got frustrated & decided to start over & take my time.
-
Hey i been working on this register.php for some time now & cant figure out how to solve this query error QUERY ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 Query was INSERT INTO users (username, login_name, userpass, level, money, crystals, donatordays, user_level, energy, maxenergy, will, maxwill, brave, maxbrave, hp, maxhp, location, gender, signedup, bankmoney, lastip, lastip_signup, elements, villages) VALUES( 'demo', 'demo', md5('demo'), 1, 100, 0, 0, 1, 12, 12, 100, 100, 5, 5, 100, 100, 1, 'Male', unix_timestamp(), -1, '209.124.166.34', '209.124.166.34','2', '13 here is some of the code <?php include "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']; } session_start(); print <<<EOF <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>W.O.T.S</title> <script type="text/javascript"> var xmlHttp // xmlHttp variable function GetXmlHttpObject(){ // This function we will use to call our xmlhttpobject. var objXMLHttp=null // Sets objXMLHttp to null as default. if (window.XMLHttpRequest){ // If we are using Netscape or any other browser than IE lets use xmlhttp. objXMLHttp=new XMLHttpRequest() // Creates a xmlhttp request. }else if (window.ActiveXObject){ // ElseIf we are using IE lets use Active X. objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP") // Creates a new Active X Object. } // End ElseIf. return objXMLHttp // Returns the xhttp object. } // Close Function function CheckPasswords(password){ // This is our fucntion that will check to see how strong the users password is. xmlHttp=GetXmlHttpObject() // Creates a new Xmlhttp object. if (xmlHttp==null){ // If it cannot create a new Xmlhttp object. alert ("Browser does not support HTTP Request") // Alert Them! return // Returns. } // End If. var url="check.php?password="+escape(password) // Url that we will use to check the password. xmlHttp.open("GET",url,true) // Opens the URL using GET xmlHttp.onreadystatechange = function () { // This is the most important piece of the puzzle, if onreadystatechange = equal to 4 than that means the request is done. if (xmlHttp.readyState == 4) { // If the onreadystatechange is equal to 4 lets show the response text. document.getElementById("passwordresult").innerHTML = xmlHttp.responseText; // Updates the div with the response text from check.php } // End If. }; // Close Function xmlHttp.send(null); // Sends NULL insted of sending data. } // Close Function. function CheckUsername(password){ // This is our fucntion that will check to see how strong the users password is. xmlHttp=GetXmlHttpObject() // Creates a new Xmlhttp object. if (xmlHttp==null){ // If it cannot create a new Xmlhttp object. alert ("Browser does not support HTTP Request") // Alert Them! return // Returns. } // End If. var url="checkun.php?password="+escape(password) // Url that we will use to check the password. xmlHttp.open("GET",url,true) // Opens the URL using GET xmlHttp.onreadystatechange = function () { // This is the most important piece of the puzzle, if onreadystatechange = equal to 4 than that means the request is done. if (xmlHttp.readyState == 4) { // If the onreadystatechange is equal to 4 lets show the response text. document.getElementById("usernameresult").innerHTML = xmlHttp.responseText; // Updates the div with the response text from check.php } // End If. }; // Close Function xmlHttp.send(null); // Sends NULL insted of sending data. } // Close Function. function PasswordMatch() { pwt1=document.getElementById('pw1').value; pwt2=document.getElementById('pw2').value; if(pwt1 == pwt2) { document.getElementById('cpasswordresult').innerHTML="<font color='green'>OK</font>"; } else { document.getElementById('cpasswordresult').innerHTML="<font color='red'>Not Matching</font>"; } } </script> <style> body { font-family:Verdana;font-size:9pt;color: white; background-color:#C3C3C3; background-image:url(/images/hfmainback.jpg);) scrollbar-base-color: #005B70; scrollbar-arrow-color: #F3960B; scrollbar-DarkShadow-Color: #000000; } a:visited,a:active,a:hover,a:link { color: white;text-decoration: none; } table,tr,td { font-size:9pt; } img { border:none; } </style> </head> <body> <center><h3>W.O.T.S Registration</h3><form action=register.php method=post> <table width='75%' class='table' cellspacing='1'> <tr> <td class="lgrad"></td> <td class="center"><img src="images/banner.png" alt="W.O.T.S Test Side" /><br /> <!-- Begin Main Content --> EOF; $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>"); } if($_POST['username']) { if($set['regcap_on']) { if(!$_SESSION['captcha'] or $_SESSION['captcha'] != $_POST['captcha']) { unset($_SESSION['captcha']); die("Captcha Test Failed<br /> ><a href='register.php'>Back</a>"); } unset($_SESSION['captcha']); } if(strlen($_POST['username']) < 4) { die("Sorry, the username is too short.<br /> ><a href='register.php'>Back</a>"); } $sm=100; if($_POST['promo'] == "Your Promo Code Here") { $sm+=100; } $username=$_POST['username']; $username=str_replace(array("<", ">"), array("<", ">"), $username); $q=$db->query("SELECT * FROM users WHERE username='{$username}' OR login_name='{$username}'"); if($db->num_rows($q)) { print "Username already in use. Choose another.<br /> ><a href='register.php'>Back</a>"; } else if($_POST['password'] != $_POST['cpassword']) { print "The passwords did not match, go back and try again.<br /> ><a href='register.php'>Back</a>"; } else { $_POST['ref'] = abs((int) $_POST['ref']); $IP = ($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; $q=$db->query("SELECT * FROM users WHERE lastip='$IP' AND userid={$_POST['ref']}"); if($db->num_rows($q)) { die("No creating referral multies. Bad dog.<br /> ><a href='register.php'>Back</a>"); } if($_POST['ref']) { $q=$db->query("SELECT * FROM users WHERE userid={$_POST['ref']}"); $r=$db->fetch_row($q); } $db->query("INSERT INTO users (username, login_name, userpass, level, money, crystals, donatordays, user_level, energy, maxenergy, will, maxwill, brave, maxbrave, hp, maxhp, location, gender, signedup, bankmoney, lastip, lastip_signup, elements, villages) VALUES( '{$username}', '{$username}', md5('{$_POST['password']}'), 1, $sm, 0, 0, 1, 12, 12, 100, 100, 5, 5, 100, 100, 1, '{$_POST['gender']}', unix_timestamp(), -1, '$IP', '$IP','{$_POST['elements']}', '{$_POST['villages']}'"); $i=$db->insert_id(); $db->query("INSERT INTO userstats VALUES($i, 10, 10, 10, 10, 10)"); if($_POST['ref']) { require "global_func.php"; $db->query("UPDATE users SET crystals=crystals+2 WHERE userid={$_POST['ref']}"); event_add($_POST['ref'],"For refering $username to the game, you have earnt 2 valuable crystals!",$c); $db->query("INSERT INTO referals VALUES('', {$_POST['ref']}, $i, unix_timestamp(),'{$r['lastip']}','$IP')"); } print "You have signed up, enjoy the game.<br> > <a href='login.php'>Login</a>"; } } else { if($set['regcap_on']) { $chars="123456789abcdefghijklmnpqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!?\\/%^"; $len=strlen($chars); $_SESSION['captcha']=""; for($i=0;$i<6;$i++) $_SESSION['captcha'].=$chars[rand(0, $len - 1)]; } print "<h3>Way Of The Shinobi</h3>"; print "<form action=register.php method=post> <center><h3>W.O.T.S Registration</h3><form action=register.php method=post> <table width='75%' class='table' cellspacing='1'> <tr> <td width='30%'>Username</td> <td width='40%'><input type=text name=username onkeyup='CheckUsername(this.value);'></td> <td width='30%'><div id='usernameresult'></div></td> </tr> <tr> <td>Password</td> <td><input type=password id='pw1' name=password onkeyup='CheckPasswords(this.value);PasswordMatch();'></td> <td><div id='passwordresult'></div></td> </tr> <tr> <td>Confirm Password</td><td><input type=password name=cpassword id='pw2' onkeyup='PasswordMatch();'></td> <td><div id='cpasswordresult'></div></td> </tr> <tr> <td>Gender</td> <td> <select name='gender' type='dropdown'> <option value='Male'>Male <option value='Female'>Female</select></td> </tr> <td>Element</td> <td> <select name='elements' type='dropdown'> <option value='3'>Lighting <option value='1'>Fire <option value='5'>Water <option value='2'>Wind <option value='4'>Earth </select></td> </tr> <tr> <td>Villages</td> <td> <select name='villages' type='dropdown'> <option value='1'>Amegakure <option value='2'>Getsugakure <option value='3'>Hoshigakure <option value='4'>Ishigakure <option value='5'>Iwagakure <option value='6'>Jomae <option value='7'>Kiragakure <option value='8'>Konohagakure <option value='9'>Kumogakure <option value=10'>Kusagakure <option value='11'>Otogakure <option value='12'>Shimogakure <option value='13'>Sunagakure <option value='14'>Takigakure <option value='15'>Takumi </select></td> </tr> <tr> <input type=hidden name=ref value='' /> <tr> <tr><td colspan=3 align=center><input type=submit value=Submit></td></tr> </tr> </table> </form><br /><br /> > <a href='login.php'>Go Back</a>";
-
ah ok thnx i will check it out.