Jump to content
MakeWebGames

peterisgb

Members
  • Posts

    727
  • Joined

  • Last visited

  • Days Won

    40

Everything posted by peterisgb

  1. yay an update, however your site is not open, just coming soon :( can i get a direct link so i can get the update please. thanks
  2. lol, funny. they dont do contracts.. can download all those mods for free on the free section of here.....
  3. the code i put didnt work. $db->query("INSERT INTO userstats VALUES($i, '', '', '', '', '')"); //Personal Details $db->query("INSERT INTO pdetails VALUES($i, '', '', 0, '', '', '', '', '', '')") or die(mysql_error()); This worked lol. and as to the if on the mail part, if its not there it dont work.
  4. both been done ty, te if (mail thing was already there when i got it lol.
  5. i'm not much of a coder but i can kinda read whats there and it looks good,
  6. ok cool, before i set the database to auto can you check theses 2 lines to make sure i got it right $db->query("INSERT INTO userstats VALUES($i)"); //Personal Details $db->query("INSERT INTO pdetails VALUES($i)") or die(mysql_error());
  7. for me all the main user info, id, username and login name worked, it stopped working when inputting stats and player details, and i;ve had reports that the e-mail dont send either.
  8. he also posted it here http://makewebgames.io/showthread.php/32076-mccode-v2-Shops-item-stock-as-requested-%28Not-Tested%29?p=288139#post288139 bloody scammers.
  9.   I've Posted the whole code and token out the database info.   <?php session_start(); include "config.php"; include "language.php"; include "rfunctions.php"; if (filesize("config.php") <= 150) { header("Location: install.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']; } $q=$db->query("SELECT userid FROM users"); $membs=$db->num_rows($q); $q=$db->query("SELECT userid FROM users WHERE bankmoney>-1"); $banks=$db->num_rows($q); $q=$db->query("SELECT userid FROM users WHERE gender='Male'"); $male=$db->num_rows($q); $q=$db->query("SELECT userid FROM users WHERE gender='Female'"); $fem=$db->num_rows($q); $total=0; //thx to http://www.phpit.net/code/valid-email/ for valid_email function 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; } 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>Infamous-Wars Register</title> <meta property="og:title" content="Infamous-wars" /> <meta property="og:description" content=" Infamous-Wars - Online Space Game, fight other players, war with planets, racing, build your own weapons and loads more. " /> <meta name="author" content="Peter Greenacre" /> <meta name="copyright" content="Copyright World-wars 2010-2013" /> <meta property="og:image" content="http://www.infamous-wars.com/title.png" /> <link rel="SHORTCUT ICON" href="favicon.ico" /> <link href="css/login.css" rel="stylesheet" type="text/css"> <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 CheckEmail(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="checkem.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("emailresult").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> <!-- 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(!valid_email($_POST['email'])) { die("Sorry, the email is invalid.<br /> ><a href='register.php'>Back</a>"); } if(strlen($_POST['username']) < 4) { die("Sorry, the username is too short.<br /> ><a href='register.php'>Back</a>"); } $sm=100; if($_POST['ref'] == "Referer ID 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}'"); $q2=$db->query("SELECT * FROM users WHERE email='{$_POST['email']}'"); if($db->num_rows($q)) { print "Username already in use. Choose another.<br /> ><a href='register.php'>Back</a>"; } else if($db->num_rows($q2)) { print "E-Mail 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); } $zom2=$db->query("SELECT * FROM hvzstats"); $hvz=$db->fetch_row($zom2); if($hvz['hvz'] ==1) { $zom=1; } else { $zom=0; } $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, email, bankmoney, lastip, lastip_signup, humanorzombie, Random_key) VALUES( '{$username}', '{$username}', md5('{$_POST['password']}'), 1, $sm, 1000, 0, 1, 12, 12, 100, 100, 5, 5, 100, 100, 1, '{$_POST['gender']}', unix_timestamp(), '{$_POST['email']}', -1, '$IP', '$IP', $zom, '".random_string('alnum', 32)."')"); $i=$db->insert_id(); $db->query("INSERT INTO userstats VALUES($i, 1500, 1500, 1500, 1500, 1500)"); //Personal Details $db->query("INSERT INTO pdetails VALUES($i, 'N/A', 'N/A', 0, 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'OFF')") or die(mysql_error()); if($_POST['ref']) { require "global_func.php"; $db->query("UPDATE users SET crystals=crystals+20000 WHERE userid={$_POST['ref']}"); event_add($_POST['ref'],"For refering $username to the game, you have earnt 20000 valuable Gold Coins!",$c); $db->query("INSERT INTO referals VALUES('$ia', {$_POST['ref']}, $i, unix_timestamp(),'{$r['lastip']}','$IP')"); $ia=$db->insert_id(); } // get data just entered $getUser = $db->query("SELECT userid, login_name, email, Random_key FROM users WHERE login_name = '{$username}'") or die(mysql_error()); $row = mysql_fetch_assoc($getUser); // Send rego email $stamp = unix_timestamp; $to = $_POST['email']; $subject = "GAME Account Activation"; $body = "Hello " . $username . ",\n\nThank you for registering at GAME!\n\nClick this link to activate your account: http://www.infamous-wars.com/activate.php?ID=".$row['userid']."&key=".$row['Random_key']." \n\n -Lord Kernow"; $headers = "Infamous-Wars"; if (mail($to, $subject, $body, $headers)) {} $link = mysql_connect("localhost", "**********", "**********"); mysql_select_db("***********", $link) or die(mysql_error()); $passwd = sha1(strtolower($username) . $_POST['password']); mysql_query("INSERT INTO infamou1_forums.`smf_members` (`member_name`,`date_registered`,`real_name`,`email_address`,`passwd`) VALUES ('{$username}',unix_timestamp(),'{$username}','{$email}', '{$password}')"); mysql_close($link); print "You have signed up, enjoy the game.<br> > <a href='login.php'>Login</a> "; } } else { if($set['regcap_on']) { $chars="123456789"; $len=strlen($chars); $_SESSION['captcha']=""; for($i=0;$i<6;$i++) $_SESSION['captcha'].=$chars[rand(0, $len - 1)]; } print " <img src='title.jpg' height='0' width='0'> <!-- Begin Main Content --> <body> <table width='982' border='0' align='center' cellpadding='0' cellspacing='0' class='bg1'> <tr> <td><table width='982' border='0' align='center' cellpadding='0' cellspacing='0' class='bg2'> <tr> <td><table width='950' border='0' align='center' cellpadding='0' cellspacing='0'> <tr> <td width='677'><center><img src='images/title.png' alt='' width='677' height='141'></center></td> </tr> <tr> <td colspan='2' class='bg3' style='height:50px;'> <table width='950' border='0' cellspacing='0' cellpadding='0' style='height:50px;'> <tr> <td width='33'> </td> <td valign='middle' class='text2'> <a href='#.' class='link1'></a><a href='#' class='link1'></a><img src='images/spacer.gif' alt='' width='1' height='1' hspace='15'><a href='#' class='link1'></a><img src='images/spacer.gif' alt='' width='1' height='1' hspace='15'><a href='#' class='link1'></a><img src='images/spacer.gif' alt='' width='1' height='1' hspace='15'><a href='#' class='link1'></a><img src='images/spacer.gif' alt='' width='1' height='1' hspace='15'><a href='#' class='link1'></a> <table border='0' cellspacing='0' cellpadding='0'> <tr> <td><a href='login.php' class='link1'>$home</a></td> <td><img src='images/subpage1_02.jpg' alt='' width='2' height='16' hspace='15'></td> <td><a href='register.php' class='link1'>$register</a></td> <td><img src='images/subpage1_02.jpg' alt='' width='2' height='16' hspace='15'></td> </tr> </table></td> <td width='108' align='right' class='text1'><script language='JavaScript' type='text/javascript' src='date.js'></script></td> <td width='32'> </td> </tr> </table></td> </tr> </table> <table width='950' border='0' align='center' cellpadding='0' cellspacing='0'> <tr valign='top'> <td width='181'><table width='181' border='0' cellspacing='0' cellpadding='0'> <tr> <td class='text2' style='background-image:url(images/homepage09.jpg); height:40px;'><table width='181' border='0' cellspacing='0' cellpadding='0'> <tr> <td width='15'><img src='images/spacer.gif' alt='' width='15' height='40'></td> <td width='166' class='text2'>$nav</td> </tr> </table></td> </tr> <tr> <td style='background-image:url(images/homepage10.jpg); height:29px;'><table width='100%' border='0' cellspacing='0' cellpadding='0'> <tr> <td width='8%'><img src='images/spacer.gif' alt='' width='15' height='29'></td> <td width='92%'><a href='login.php' class='link1'>$login</a></td> </tr> </table></td> </tr> <tr> <td style='background-image:url(images/homepage10.jpg); height:29px;'><table width='100%' border='0' cellspacing='0' cellpadding='0'> <tr> <td width='8%'><img src='images/spacer.gif' alt='' width='15' height='29'></td> <td width='92%'><a href='register.php' class='link1'>$register</a></td> </tr> </table></td> </tr> <tr> <td style='background-image:url(images/homepage10.jpg); height:29px;'><table width='100%' border='0' cellspacing='0' cellpadding='0'> <tr> <td width='8%'><img src='images/spacer.gif' alt='' width='15' height='29'></td> <td width='92%'><a href='advertise.php' class='link1'>$adv</a></td> </tr> </table></td> </tr> <tr> <td style='background-image:url(images/homepage10.jpg); height:29px;'><table width='100%' border='0' cellspacing='0' cellpadding='0'> <tr> <td width='8%'><img src='images/spacer.gif' alt='' width='15' height='29'></td> <td width='92%'><a href='faq.php' class='link1'>$faq</a></td> </tr> </table></td> </tr> <tr> <td style='background-image:url(images/homepage10.jpg); height:29px;'><table width='100%' border='0' cellspacing='0' cellpadding='0'> <tr> <td width='8%'><img src='images/spacer.gif' alt='' width='15' height='29'></td> <td width='92%'><a href='tos.php' class='link1'>$tos</a></td> </tr> </table></td> </tr> <tr> <td style='background-image:url(images/homepage10.jpg); height:29px;'><table width='100%' border='0' cellspacing='0' cellpadding='0'> <tr> <td width='8%'><img src='images/spacer.gif' alt='' width='15' height='29'></td> <td width='92%'><a href='privacy_policy.php' class='link1'>$prvp</a></td> </tr> </table></td> </tr> <tr> <td style='background-image:url(images/homepage10.jpg); height:29px;'><table width='100%' border='0' cellspacing='0' cellpadding='0'> <tr> <td width='8%'><img src='images/spacer.gif' alt='' width='15' height='29'></td> <td width='92%'><a href='safety_tips.php' class='link1'>$saftip</a></td> </tr> </table> </td> </tr> <tr> <td style='background-image:url(images/homepage10.jpg); height:29px;'><table width='100%' border='0' cellspacing='0' cellpadding='0'> <tr> <td width='8%'><img src='images/spacer.gif' alt='' width='15' height='29'></td> <td width='92%'><a href='contact_us.php' class='link1'>$contus</a></td> </tr> </table></td> </tr> <tr/> <td style='background-image:url(images/homepage10.jpg); height:29px;'><table width='100%' border='0' cellspacing='0' cellpadding='0'> <tr> <td width='8%'><img src='images/spacer.gif' alt='' width='15' height='29'></td> <td width='92%'><a href='http://ividen.toolbar.fm' class='link1' target='_blank'>Our Toolbar</a></td> </tr> </table> <tr> <td><img src='images/homepage11.jpg' alt='' width='181' height='8'></td> </tr> </table> <table width='181' border='0' cellspacing='0' cellpadding='0'> <tr> <td style='background-image:url(images/); height:40px;'><table width='181' border='0' cellspacing='0' cellpadding='0'> <tr> <td width='15'><img src='images/spacer.gif' alt='' width='15' height='40'></td> </tr> </table></td> </tr> </table></td> <td width='589'><table width='589' border='0' cellspacing='0' cellpadding='0'> <tr> <td style='background-image:url(images/homepage13.jpg); height:40px;'><table width='181' border='0' cellspacing='0' cellpadding='0'> <tr> <td width='15'><img src='images/spacer.gif' alt='' width='26' height='40'></td> <td width='166' class='text2'><h2><legend>Infamous-Wars</legend></h2> </td> </tr> </table></td> </tr> <tr> <td><img src='images/spacer.gif' alt='' width='30' height='25'></td> </tr> <tr> <td><table width='535' border='0' align='center' cellpadding='0' cellspacing='0'> <tr> <td> "; print "<center><h3>{$set['game_name']} Registration</h3></center>"; print "<form action=register.php method=post><center> <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> <th colspan='3'>E-Mail Address Must be Real And Valid to play this game.</th> </tr> <tr> <td>Email</td><td><input type=text name=email onkeyup='CheckEmail(this.value);'></td> <td><div id='emailresult'></div></td> </tr> <tr> <th colspan='3'><small>Verification Link will be E-mailed to your E-mail Address</small></th> </tr> <tr> <td>Gender</td> <td colspan='2'><select name='gender' type='dropdown'> <option value='Male'>Male <option value='Female'>Female</select></td> </tr> <tr> <td>Referer ID</td><td colspan=2><input type=text name=promo></td> </tr> <input type=hidden name=ref value='"; if($_GET['ref']) { print $_GET['ref']; } print "' />"; if($set['regcap_on']) { print "<tr> <td colspan=3><img src='captcha_verify.php?bgcolor=C3C3C3' /><br /> <input type='text' name='captcha' /></td> </tr>"; } print " <tr> <td colspan=3 align=center><input type=submit value=Submit></td> </tr> </table> </form><br /> > <a href='login.php'>Go Back</a>"; } print <<<OUT </td> </tr> </table></td> </tr> <tr> <td><img src='images/spacer.gif' alt='' width='30' height='25'></td> </tr> <tr> <td style='background-image:url(images/homepage13.jpg); height:40px;'><table width='181' border='0' cellspacing='0' cellpadding='0'> <tr> <td width='15'><img src='images/spacer.gif' alt='' width='26' height='40'></td> <td width='166' class='text2'><h2></h2></td> </tr> </table></td> </tr> <tr> <td><img src='images/spacer.gif' alt='' width='30' height='25'></td> </tr> <tr> <td><table width='535' border='0' align='center' cellpadding='0' cellspacing='0'> <tr> <td width='218'><p class='text2'> </td> </table></td> </tr> </table> <br> <br></td> <td width='180'><table width='180' border='0' cellspacing='0' cellpadding='0'> <tr> <td width='180' style='background-image:url(images/homepage20.jpg); height:40px;'><table width='180' border='0' cellpadding='0' cellspacing='0'> <tr> <td width='15'><img src='images/spacer.gif' alt='' width='15' height='40'></td> <td width='166' class='text2'>$sitelog</td> </tr> </table></td> </tr> <tr> <td><form action='authenticate.php' method='post' name='login' onsubmit='return saveme();' > <table width='155' border='0' align='center' cellpadding='0' cellspacing='0'> <tr> <td colspan='2'> </td> </tr> <tr> <td colspan='2' class='text1' style='height:25px;'>$usname</td> </tr> <tr> <td colspan='2'><input type='text' name='username' ></td> </tr> <tr> <td colspan='2' class='text1' style='height:25px;'>$passv</td> </tr> <tr> <td colspan='2'><input type='password' name='password' ></td> </tr> <tr> <td colspan='2'> </td> </tr> <tr> <td width='115'><a href='forgot_password.php'>$passfg</a> </td> <td width='43' align='center'><input type='submit' value='$login' align='right' ></td> </tr> <tr> <td colspan='2'> <br /><br /></td> </tr> </table> </form> </td> </tr> </table> <table width='180' border='0' cellspacing='0' cellpadding='0'> <tr> <td width='180' style='background-image:url(images/homepage20.jpg); height:40px;'><table width='180' border='0' cellpadding='0' cellspacing='0'> <tr> <td width='15'><img src='images/spacer.gif' alt='' width='15' height='40'></td> <td width='165' class='text2'>$gameinfo</td> </tr></td> </table></td> </table> <table width='180' border='0' cellspacing='0' cellpadding='0'> <tr> <br /> <style type='text/css'> .style1 { text-align: center; } </style> <div class='style1'> $players $membs <br> $mal $male <br> $fems $fem</div> <br /> <center> <img src='and.png' height='20' width='20'> Get our Android App <img src='and.png' height='20' width='20'> <br /> <a href='http://www.appsgeyser.com/getwidget/WorldWars'><img src='android.png'></a> </center> </td></tr> </table></td> </tr> </table></td> </tr> <tr> <td> </td> </tr> <tr> <td class='style2' style='height:40px;'> </td> </tr> </table></td> </tr> </table> <table width='982' border='0' align='center' cellpadding='0' cellspacing='0'> <tr> <td class='style2'><i><center>Infamous-Wars. Game Copyright ©2011-2012 Peter Greenacre.({$db->num_queries}) queries. </center></i></td> </tr> <tr> <td class='style2'> </td> </tr> <tr> <td class='style2'> </td> </tr> <tr> <td class='style2'> </td> </tr> </table> <td colspan="3 <div class='dotted_faded_box_home'>"> <table cellpadding="0" cellspacing="0" border="0" width="100%"> <tr> <div class='dotted_faded_box_home'> <td class="dgradl"> </td> <td class="dgrad"><center><strong> <td class="dgradr"> <div class='dotted_faded_box_home'></td> </tr> </table> </td> </tr> </table> </div> </div> </div> </div> </body> </html> </body> </html> EOF; OUT; ?>
  10. I've added a few things into register but for some reason its not putting the Stats and playerinfo into the database and doesnt send the verfication e-mail either. For the Verification the random key is generated and put into the database. could i have some help or pointers in the right direction, below is the clipit of the area in question. Thanks   $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, email, bankmoney, lastip, lastip_signup, humanorzombie, Random_key) VALUES( '{$username}', '{$username}', md5('{$_POST['password']}'), 1, $sm, 1000, 0, 1, 12, 12, 100, 100, 5, 5, 100, 100, 1, '{$_POST['gender']}', unix_timestamp(), '{$_POST['email']}', -1, '$IP', '$IP', $zom, '".random_string('alnum', 32)."')"); $i=$db->insert_id(); $db->query("INSERT INTO userstats VALUES($i, 1500, 1500, 1500, 1500, 1500)"); //Personal Details $db->query("INSERT INTO pdetails VALUES($i, 'N/A', 'N/A', 0, 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'OFF')") or die(mysql_error()); if($_POST['ref']) { require "global_func.php"; $db->query("UPDATE users SET crystals=crystals+20000 WHERE userid={$_POST['ref']}"); event_add($_POST['ref'],"For refering $username to the game, you have earnt 20000 valuable Gold Coins!",$c); $db->query("INSERT INTO referals VALUES('$ia', {$_POST['ref']}, $i, unix_timestamp(),'{$r['lastip']}','$IP')"); $ia=$db->insert_id(); } // get data just entered $getUser = $db->query("SELECT userid, login_name, email, Random_key FROM users WHERE login_name = '{$username}'") or die(mysql_error()); $row = mysql_fetch_assoc($getUser); // Send rego email $stamp = unix_timestamp; $to = $_POST['email']; $subject = "GAME Account Activation"; $body = "Hello " . $username . ",\n\nThank you for registering at GAME!\n\nClick this link to activate your account: http://www.infamous-wars.com/activate.php?ID=".$row['userid']."&key=".$row['Random_key']." \n\n -Lord Kernow"; $headers = "Infamous-Wars"; if (mail($to, $subject, $body, $headers)) {} $link = mysql_connect("localhost", "", ""); mysql_select_db("", $link) or die(mysql_error()); $passwd = sha1(strtolower($username) . $_POST['password']); mysql_query("INSERT INTO infamou1_forums.`smf_members` (`member_name`,`date_registered`,`real_name`,`email_address`,`passwd`) VALUES ('{$username}',unix_timestamp(),'{$username}','{$email}', '{$password}')"); mysql_close($link); print "You have signed up, enjoy the game.<br> > <a href='login.php'>Login</a>
  11. yeah i used that and it worked a charm, thanks for replpost it lol, its a good code. i'll have to look into it, if i get anywhere i'll post here.
  12. This mod works perfect, is there an auto login into the forums when going from the game?
  13. this would be my way, Delete the db info you put into users, get the db sql and set default to 1. send that. then go to users in the database and change the default back to 0, making all current users be sorted and new users will get default 0. There is definably an easier way but that's mine.
  14. Fixed. Fiddled around with it.   <?php include "globals.php"; $_GET['ID'] = (isset($_GET['ID']) AND !ereg('[^0-9]', $_GET['ID'])) ? abs(@intval($_GET['ID'])) : FALSE ; $_GET['shop'] = (isset($_GET['shop']) AND !ereg('[^0-9]', $_GET['shop'])) ? abs(@intval($_GET['shop'])) : FALSE ; $_GET['qty'] = (isset($_GET['qty']) AND !ereg('[^0-9]', $_GET['qty'])) ? abs(@intval($_GET['qty'])) : FALSE ; if(!$_GET['ID'] || !$_POST['qty']) { echo "Invalid use of file"; } else if($_POST['qty'] <= 0) { echo "You have been added to the delete list for trying to cheat the game."; } else { $q = $db->query(sprintf("SELECT `itmid`,`itmtype`,`itmname`,`itmbuyprice`,`itmbuyable` FROM items WHERE itmid=('%d')", $_GET['ID'])); $b = $db->query(sprintf("SELECT sitemID,sitemQTY FROM shopitems WHERE sitemITEMID = ('%d')", $_GET['ID'])); if(mysql_num_rows($q) == 0) { echo "Invalid item ID"; } else { $itemd = mysql_fetch_assoc($q); $qty = mysql_fetch_assoc($b); if($ir['money'] < $itemd['itmbuyprice']*$_POST['qty']) { echo "You don't have enough money to buy this item!"; $h->endpage(); exit; } if($itemd['itmbuyable'] == 0) { echo "This item can't be bought!"; $h->endpage(); exit; } if($qty['sitemQTY'] <= 0) { echo "This item is out of stock, you will have to wait for a new shipment"; $h->endpage(); exit; } if($qty['sitemQTY'] < $_POST['qty']) { echo "There isn't enough items in stock to purchase that quantity"; $h->endpage(); exit; } $price = ($itemd['itmbuyprice'] * $_POST['qty']); item_add($userid, $_GET['ID'], $_POST['qty']); $db->query("UPDATE `users` SET `money` = money - ('%d') WHERE `userid` = ('%d')", $price, $userid); $db->query("UPDATE shopitems SET sitemQTY=sitemQTY-{$_POST['qty']} WHERE sitemITEMID='{$_GET['ID']}' "); echo "You bought {$_POST['qty']} {$itemd['itmname']}(s) for \$$price"; } } $h->endpage(); ?>
  15. i dont even know how to debug, how to you print a qty array?
  16. This still presents the same error. you can still buy 50 of X item when there is only 20 stock ending total stock being -30 <- it shouldnt go negative nor should it allow to be negative.
  17. i know this is old but its good, i;m having a little problem, it all works except to the point where you cant buy no more items as there aint none, well it dont happen, it just lets you buy more making the Shop qty into negative, This is what i have so far.   <?php include "globals.php"; $_GET['ID'] = (isset($_GET['ID']) AND !ereg('[^0-9]', $_GET['ID'])) ? abs(@intval($_GET['ID'])) : FALSE ; $_GET['shop'] = (isset($_GET['shop']) AND !ereg('[^0-9]', $_GET['shop'])) ? abs(@intval($_GET['shop'])) : FALSE ; $_GET['qty'] = (isset($_GET['qty']) AND !ereg('[^0-9]', $_GET['qty'])) ? abs(@intval($_GET['qty'])) : FALSE ; if(!$_GET['ID'] || !$_POST['qty']) { echo "Invalid use of file"; } else if($_POST['qty'] <= 0) { echo "You have been added to the delete list for trying to cheat the game."; } else { $q = $db->query(sprintf("SELECT `itmid`,`itmtype`,`itmname`,`itmbuyprice`,`itmbuyable` FROM items WHERE itmid=('%d')", $_GET['ID'])); $b = $db->query(sprintf("SELECT sitemID,sitemQTY FROM shopitems WHERE sitemITEMID = ('%d')", $_GET['ID'])); if(mysql_num_rows($q) == 0) { echo "Invalid item ID"; } else { $itemd = mysql_fetch_assoc($q); $qty = mysql_fetch_assoc($b); if($ir['money'] < $itemd['itmbuyprice']*$_POST['qty']) { echo "You don't have enough money to buy this item!"; $h->endpage(); exit; } if($itemd['itmbuyable'] == 0) { echo "This item can't be bought!"; $h->endpage(); exit; } if($qty['sitemQTY'] < 0) { echo "This item is out of stock, you will have to wait for a new shipment"; $h->endpage(); exit; } if($qty['sitemQTY'] < $_GET['qty']) { echo "There isn't enough items in stock to purchase that quantity"; $h->endpage(); exit; } $price = ($itemd['itmbuyprice'] * $_POST['qty']); item_add($userid, $_GET['ID'], $_POST['qty']); $db->query("UPDATE `users` SET `money` = money - ('%d') WHERE `userid` = ('%d')", $price, $userid); $db->query("update shopitems set sitemQTY=sitemQTY-{$_POST['qty']} WHERE sitemITEMID='{$_GET['ID']}' "); echo "You bought {$_POST['qty']} {$itemd['itmname']}(s) for \$$price"; } } $h->endpage(); ?>
  18. wrong thread mate.
  19. this is pretty good, for me i didnt let the users choose what team they could join as they would all join one team which would make it unfair on the other team so i didnt let the user choose. makes it more fair
  20. well i didnt know anyway of dividing all the users into 2 groups.
  21. Now just need to get this thread deleted, dont want to many people to steal my idea lol
  22. ok it does work, i was doing it wrong, lol, thanks so much for this, great help guys. spent about 2 weeks trying to get this to work, my final option was to seek help here lol, thanks
  23.   so if i am right it should be like   if (isset ($_GET["buy"]) && $_GET["buy"] == "odd") $db->query("SELECT * FROM users WHERE MOD( userid, 2 ) =1"); else $q=$db->query('SELECT * FROM `users` WHERE ( `userid` % 2 = '.( array_key_exists ( 'odd', $_GET ) ? 1 : 0 ).' )');   because if its this it shows evens either way
  24. yeah, it sounds like an idea, however, my coding skills are quite limited at the moment, haven't quite got the nak of switch functions yet.
  25. figured it out, i just looked at it.   $q=$db->query('SELECT `username` FROM `users` WHERE ( `userid` % 2 = '.( array_key_exists ( 'odd', $_GET ) ? 1 : 0 ).' )'); changed that to this   $q=$db->query('SELECT * FROM `users` WHERE ( `userid` % 2 = '.( array_key_exists ( 'odd', $_GET ) ? 1 : 0 ).' )');   now how would i go about making it show only odd id's
×
×
  • Create New...