
andyt_2005
Members-
Posts
21 -
Joined
-
Last visited
Never
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
andyt_2005's Achievements
Newbie (1/14)
0
Reputation
-
Re: urgent question yeah it was the forums! wasnt it nick :) lucky i only messed with my stats lol
-
Re: Fatal error: Cannot redeclare :) thank you for that!! but now iv taken that out im getting another error, this time invalid email. its not !! lol i cant see why it wont accept the email address, iv tried several and keep getting the same error.
-
Re: Fatal error: Cannot redeclare glo func <?php function ValidEmail1($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; } function orgcrime_dropdown($connection,$ddname="orgcrime",$selected=-1) { global $db; $ret="<select name='$ddname' type='dropdown'>"; $q=$db->query("SELECT * FROM orgcrimes ORDER BY ocID ASC"); if($selected == -1) { $first=0; } else { $first=1; } while($r=$db->fetch_row($q)) { $ret.="\n<option value='{$r['ocID']}'"; if ($selected == $r['ocID'] || $first == 0) { $ret.=" selected='selected'";$first=1; } $ret.= ">{$r['ocNAME']}</option>"; } $ret.="\n</select>"; return $ret; } function business_alert($business, $text) { mysql_query(sprintf("INSERT INTO `businesses_alerts` (`alertId`, `alertBusiness`, `alertText`, `alertTime`) VALUES ('NULL', '%u', '%s', '%d')", $business, $text, time())); } function gang_dropdown($connection,$ddname="gang",$selected=-1) { global $db; $ret="<select name='$ddname' type='dropdown'>"; $q=$db->query("SELECT * FROM gangs ORDER BY gangID ASC"); if($selected == -1) { $first=0; } else { $first=1; } while($r=$db->fetch_row($q)) { $ret.="\n<option value='{$r['gangID']}'"; if ($selected == $r['gangID'] || $first == 0) { $ret.=" selected='selected'";$first=1; } $ret.= ">{$r['gangNAME']}</option>"; } $ret.="\n</select>"; return $ret; } function money_formatter($muny,$symb='$') { return $symb.number_format($muny); } function respect_formatter($respt,$ressymb='$') { return $ressymb.number_format($respt); } function itemtype_dropdown($connection,$ddname="item_type",$selected=-1) { global $db; $ret="<select name='$ddname' type='dropdown'>"; $q=$db->query("SELECT * FROM itemtypes ORDER BY itmtypename ASC"); if($selected == -1) { $first=0; } else { $first=1; } while($r=$db->fetch_row($q)) { $ret.="\n<option value='{$r['itmtypeid']}'"; if ($selected == $r['itmtypeid'] || $first == 0) { $ret.=" selected='selected'";$first=1; } $ret.=">{$r['itmtypename']}</option>"; } $ret.="\n</select>"; return $ret; } function item_dropdown($connection,$ddname="item",$selected=-1) { global $db; $ret="<select name='$ddname' type='dropdown'>"; $q=$db->query("SELECT * FROM items ORDER BY itmname ASC"); if($selected == -1) { $first=0; } else { $first=1; } while($r=$db->fetch_row($q)) { $ret.="\n<option value='{$r['itmid']}'"; if ($selected == $r['itmid'] || $first == 0) { $ret.=" selected='selected'";$first=1; } $ret.=">{$r['itmname']}</option>"; } $ret.="\n</select>"; return $ret; } function item2_dropdown($connection,$ddname="item",$selected=-1) { global $db; $ret="<select name='$ddname' type='dropdown'>"; $q=$db->query("SELECT * FROM items ORDER BY itmname ASC"); if($selected < 1) { $ret.="<option value='0' selected='selected'>-- None --</option>"; } else { $ret.="<option value='0'>-- None --</option>"; } while($r=$db->fetch_row($q)) { $ret.="\n<option value='{$r['itmid']}'"; if ($selected == $r['itmid']) { $ret.=" selected='selected'";$first=1; } $ret.=">{$r['itmname']}</option>"; } $ret.="\n</select>"; return $ret; } function location_dropdown($connection,$ddname="location",$selected=-1) { global $db; $ret="<select name='$ddname' type='dropdown'>"; $q=$db->query("SELECT * FROM cities ORDER BY cityname ASC"); if($selected == -1) { $first=0; } else { $first=1; } while($r=$db->fetch_row($q)) { $ret.="\n<option value='{$r['cityid']}'"; if ($selected == $r['cityid'] || $first == 0) { $ret.=" selected='selected'";$first=1; } $ret.= ">{$r['cityname']}</option>"; } $ret.="\n</select>"; return $ret; } function shop_dropdown($connection,$ddname="shop",$selected=-1) { global $db; $ret="<select name='$ddname' type='dropdown'>"; $q=$db->query("SELECT * FROM shops ORDER BY shopNAME ASC"); if($selected == -1) { $first=0; } else { $first=1; } while($r=$db->fetch_row($q)) { $ret.="\n<option value='{$r['shopID']}'"; if ($selected == $r['shopID'] || $first == 0) { $ret.=" selected='selected'";$first=1; } $ret.= ">{$r['shopNAME']}</option>"; } $ret.="\n</select>"; return $ret; } function user_dropdown($connection,$ddname="user",$selected=-1) { global $db; $ret="<select name='$ddname' type='dropdown'>"; $q=$db->query("SELECT * FROM users ORDER BY username ASC"); if($selected == -1) { $first=0; } else { $first=1; } while($r=$db->fetch_row($q)) { $ret.="\n<option value='{$r['userid']}'"; if ($selected == $r['userid'] || $first == 0) { $ret.=" selected='selected'";$first=1; } $ret.= ">{$r['username']}</option>"; } $ret.="\n</select>"; return $ret; } function challengebot_dropdown($connection,$ddname="bot",$selected=-1) { global $db; $ret="<select name='$ddname' type='dropdown'>"; $q=$db->query("SELECT cb.*,u.* FROM challengebots AS cb LEFT JOIN users AS u ON cb.cb_npcid=u.userid ORDER BY u.username ASC"); if($selected == -1) { $first=0; } else { $first=1; } while($r=$db->fetch_row($q)) { $ret.="\n<option value='{$r['userid']}'"; if ($selected == $r['userid'] || $first == 0) { $ret.=" selected='selected'";$first=1; } $ret.= ">{$r['username']}</option>"; } $ret.="\n</select>"; return $ret; } function fed_user_dropdown($connection,$ddname="user",$selected=-1) { global $db; $ret="<select name='$ddname' type='dropdown'>"; $q=$db->query("SELECT * FROM users WHERE fedjail=1 ORDER BY username ASC"); if($selected == -1) { $first=0; } else { $first=1; } while($r=$db->fetch_row($q)) { $ret.="\n<option value='{$r['userid']}'"; if ($selected == $r['userid'] || $first == 0) { $ret.=" selected='selected'";$first=1; } $ret.= ">{$r['username']}</option>"; } $ret.="\n</select>"; return $ret; } function mailb_user_dropdown($connection,$ddname="user",$selected=-1) { global $db; $ret="<select name='$ddname' type='dropdown'>"; $q=$db->query("SELECT * FROM users WHERE mailban > 0 ORDER BY username ASC"); if($selected == -1) { $first=0; } else { $first=1; } while($r=$db->fetch_row($q)) { $ret.="\n<option value='{$r['userid']}'"; if ($selected == $r['userid'] || $first == 0) { $ret.=" selected='selected'";$first=1; } $ret.= ">{$r['username']}</option>"; } $ret.="\n</select>"; return $ret; } function forumb_user_dropdown($connection,$ddname="user",$selected=-1) { global $db; $ret="<select name='$ddname' type='dropdown'>"; $q=$db->query("SELECT * FROM users WHERE forumban > 0 ORDER BY username ASC"); if($selected == -1) { $first=0; } else { $first=1; } while($r=$db->fetch_row($q)) { $ret.="\n<option value='{$r['userid']}'"; if ($selected == $r['userid'] || $first == 0) { $ret.=" selected='selected'";$first=1; } $ret.= ">{$r['username']}</option>"; } $ret.="\n</select>"; return $ret; } function job_dropdown($connection,$ddname="job",$selected=-1) { global $db; $ret="<select name='$ddname' type='dropdown'>"; $q=$db->query("SELECT * FROM jobs ORDER BY jNAME ASC"); if($selected == -1) { $first=0; } else { $first=1; } while($r=$db->fetch_row($q)) { $ret.="\n<option value='{$r['jID']}'"; if ($selected == $r['jID'] || $first == 0) { $ret.=" selected='selected'";$first=1; } $ret.=">{$r['jNAME']}</option>"; } $ret.="\n</select>"; return $ret; } function jobrank_dropdown($connection,$ddname="jobrank",$selected=-1) { global $db; $ret="<select name='$ddname' type='dropdown'>"; $q=$db->query("SELECT jr.*,j.* FROM jobranks jr LEFT JOIN jobs j ON jr.jrJOB=j.jID ORDER BY j.jNAME ASC, jr.jrNAME ASC"); if($selected == -1) { $first=0; } else { $first=1; } while($r=$db->fetch_row($q)) { $ret.="\n<option value='{$r['jrID']}'"; if ($selected == $r['jrID'] || $first == 0) { $ret.=" selected='selected'";$first=1; } $ret.=">{$r['jNAME']} - {$r['jrNAME']}</option>"; } $ret.="\n</select>"; return $ret; } function house_dropdown($connection,$ddname="house",$selected=-1) { global $db; $ret="<select name='$ddname' type='dropdown'>"; $q=$db->query("SELECT * FROM houses ORDER BY hNAME ASC"); if($selected == -1) { $first=0; } else { $first=1; } while($r=$db->fetch_row($q)) { $ret.="\n<option value='{$r['hID']}'"; if ($selected == $r['hID'] || $first == 0) { $ret.=" selected='selected'";$first=1; } $ret.=">{$r['hNAME']}</option>"; } $ret.="\n</select>"; return $ret; } function house2_dropdown($connection,$ddname="house",$selected=-1) { global $db; $ret="<select name='$ddname' type='dropdown'>"; $q=$db->query("SELECT * FROM houses ORDER BY hNAME ASC"); if($selected == -1) { $first=0; } else { $first=1; } while($r=$db->fetch_row($q)) { $ret.="\n<option value='{$r['hWILL']}'"; if ($selected == $r['hWILL'] || $first == 0) { $ret.=" selected='selected'";$first=1; } $ret.=">{$r['hNAME']}</option>"; } $ret.="\n</select>"; return $ret; } function course_dropdown($connection,$ddname="course",$selected=-1) { global $db; $ret="<select name='$ddname' type='dropdown'>"; $q=$db->query("SELECT * FROM courses ORDER BY crNAME ASC"); if($selected == -1) { $first=0; } else { $first=1; } while($r=$db->fetch_row($q)) { $ret.="\n<option value='{$r['crID']}'"; if ($selected == $r['crID'] || $first == 0) { $ret.=" selected='selected'";$first=1; } $ret.=">{$r['crNAME']}</option>"; } $ret.="\n</select>"; return $ret; } function crime_dropdown($connection,$ddname="crime",$selected=-1) { global $db; $ret="<select name='$ddname' type='dropdown'>"; $q=$db->query("SELECT * FROM crimes ORDER BY crimeNAME ASC"); if($selected == -1) { $first=0; } else { $first=1; } while($r=$db->fetch_row($q)) { $ret.="\n<option value='{$r['crimeID']}'"; if ($selected == $r['crimeID'] || $first == 0) { $ret.=" selected='selected'";$first=1; } $ret.=">{$r['crimeNAME']}</option>"; } $ret.="\n</select>"; return $ret; } function crimegroup_dropdown($connection,$ddname="crimegroup",$selected=-1) { global $db; $ret="<select name='$ddname' type='dropdown'>"; $q=$db->query("SELECT * FROM crimegroups ORDER BY cgNAME ASC"); if($selected == -1) { $first=0; } else { $first=1; } while($r=$db->fetch_row($q)) { $ret.="\n<option value='{$r['cgID']}'"; if ($selected == $r['cgID'] || $first == 0) { $ret.=" selected='selected'";$first=1; } $ret.=">{$r['cgNAME']}</option>"; } $ret.="\n</select>"; return $ret; } function event_add($userid,$text,$connection=0) { global $db; $text=mysql_escape($text); $db->query("INSERT INTO events VALUES('',$userid,UNIX_TIMESTAMP(),0,'$text')"); $db->query("UPDATE users SET new_events=new_events+1 WHERE userid={$userid}"); return 1; } function mysql_escape($str) { return str_replace("'","''",$str); } function check_level() { global $db; global $ir,$c,$userid; $ir['exp_needed']=(int) (($ir['level']+1)*($ir['level']+1)*($ir['level']+1)*100); if($ir['exp'] >= $ir['exp_needed']) { $expu=$ir['exp']-$ir['exp_needed']; $ir['level']+=1; $ir['exp']=$expu; $ir['energy']+=2; $ir['brave']+=2; $ir['maxenergy']+=2; $ir['maxbrave']+=2; $ir['hp']+=50; $ir['maxhp']+=50; $ir['exp_needed']=(int) (($ir['level']+1)*($ir['level']+1)*($ir['level']+1)*2.2); mysql_query(sprintf("UPDATE users SET level = level + 1 , exp = %s , energy = energy + 2 , brave = brave + 2 , maxenergy = maxenergy + 2 , maxbrave = maxbrave + 2 , hp = hp + 50 , maxhp = maxhp + 50 , awards = awards + 2 WHERE (userid = %s) " , abs(@intval($expu)) , $userid)); } } function get_rank($stat, $mykey) { global $db; global $ir,$userid,$c; $q=$db->query("SELECT count(*) FROM userstats us LEFT JOIN users u ON us.userid=u.userid WHERE us.$mykey > $stat AND us.userid != $userid AND u.user_level != 0") ; return $db->fetch_single($q)+1; } function get_gamerank($level, $housevalue, $stats) { $tp=($level*$level) * 3000 + ($housevalue) + (($stats['strength']+$stats['agility']+$stats['guard']+$stats['labour']+$stats['IQ']) * 10); if ( $tp < 100000 ) { return "#1 First Newbie"; } else if ( $tp < 400000 ) { return "#2 Newbie"; } else if ( $tp < 1600000 ) { return "#3 Beginner"; } else if ( $tp < 6400000 ) { return "#4 Not Experienced"; } else if ( $tp < 25600000 ) { return "#5 Rookie"; } else if ( $tp < 102400000 ) { return "#6 Average"; } else if ( $tp < 409600000 ) { return "#7 Good"; } else if ( $tp < 819200000 ) { return "#8 Very Good"; } else if ( $tp < 3276800000 ) { return "#9 Greater Than Average"; } else if ( $tp < 13107200000 ) { return "#10 Experienced"; } else if ( $tp < 52428800000 ) { return "#11 Highly Experienced"; } else if ( $tp < 209715200000 ) { return "#12 Honoured"; } else if ( $tp < 838860800000 ) { return "#13 Highly Hounoured"; } else if ( $tp < 3355443200000 ) { return "#14 Respect King"; } else if ( $tp < 6655886400000 ) { return "#15 True Champion"; } } function item_add($user, $itemid, $qty, $notid=0) { global $db; if($notid > 0) { $q=$db->query("SELECT * FROM inventory WHERE inv_userid={$user} and inv_itemid={$itemid} AND inv_id != {$notid}"); } else { $q=$db->query("SELECT * FROM inventory WHERE inv_userid={$user} and inv_itemid={$itemid}"); } if($db->num_rows($q) > 0) { $r=$db->fetch_row($q); $db->query("UPDATE inventory SET inv_qty=inv_qty+{$qty} WHERE inv_id={$r['inv_id']}"); } else { $db->query("INSERT INTO inventory (inv_itemid, inv_userid, inv_qty) VALUES ({$itemid}, {$user}, {$qty})"); } } function item_remove($user, $itemid, $qty) { global $db; $q=$db->query("SELECT * FROM inventory WHERE inv_userid={$user} AND inv_itemid={$itemid}"); if($db->num_rows($q) > 0) { $r=$db->fetch_row($q); if($r['inv_qty']>$qty) { $db->query("UPDATE inventory SET inv_qty=inv_qty-{$qty} WHERE inv_id={$r['inv_id']}"); } else { $db->query("DELETE FROM inventory WHERE inv_id={$r['inv_id']}"); } } } function forum_dropdown($connection,$ddname="forum",$selected=-1) { global $db; $ret="<select name='$ddname' type='dropdown'>"; $q=$db->query("SELECT * FROM forum_forums ORDER BY ff_name ASC"); if($selected == -1) { $first=0; } else { $first=1; } while($r=$db->fetch_row($q)) { $ret.="\n<option value='{$r['ff_id']}'"; if ($selected == $r['ff_id'] || $first == 0) { $ret.=" selected='selected'";$first=1; } $ret.= ">{$r['ff_name']}</option>"; } $ret.="\n</select>"; return $ret; } function forum2_dropdown($connection,$ddname="forum",$selected=-1) { global $db; $ret="<select name='$ddname' type='dropdown'>"; $q=$db->query("SELECT * FROM forum_forums WHERE ff_auth != 'gang' ORDER BY ff_name ASC"); if($selected == -1) { $first=0; } else { $first=1; } while($r=$db->fetch_row($q)) { $ret.="\n<option value='{$r['ff_id']}'"; if ($selected == $r['ff_id'] || $first == 0) { $ret.=" selected='selected'";$first=1; } $ret.= ">{$r['ff_name']}</option>"; } $ret.="\n</select>"; return $ret; } function make_bigint($str, $positive=1) { $str = (string) $str; $ret = ""; for($i=0;$i<strlen($str);$i++) { if((ord($str[$i]) > 47 && ord($str[$i]) < 58) or ($str[$i]=="-" && $positive == 0)) { $ret.=$str[$i]; } } if(strlen($ret) == 0) { return "0"; } return $ret; } function stafflog_add($text) { global $db, $ir; $IP = $_SERVER['REMOTE_ADDR']; $text=$db->escape($text); $db->query("INSERT INTO stafflog VALUES(NULL, {$ir['userid']}, unix_timestamp(), '$text', '$IP')"); } function validip($IP) { if (!empty($IP) && ip2long($IP)!=-1) { $ReservedIps = array ( array('0.0.0.0', '2.255.255.255'), array('10.0.0.0', '10.255.255.255'), array('127.0.0.0', '127.255.255.255'), array('169.254.0.0', '169.254.255.255'), array('172.16.0.0', '172.31.255.255'), array('192.0.2.0', '192.0.2.255'), array('192.168.0.0', '192.168.255.255'), array('255.255.255.0', '255.255.255.255') ); foreach ($ReservedIps as $R) { $Min = ip2long($R[0]); $Max = ip2long($R[1]); if ((ip2long($IP) >= $Min) && (ip2long($IP) <= $Max)) return false; } return true; } else { return false; } } function getip() { if (validip(isset($_SERVER['HTTP_CLIENT_IP']))) { return $_SERVER['HTTP_CLIENT_IP']; } foreach (explode(",", isset($_SERVER['HTTP_X_FORWARDED_FOR'])) as $IP) { if (validip(trim($IP))) { return $IP; } } if (validip(isset($_SERVER['HTTP_X_FORWARDED']))) { return $_SERVER['HTTP_X_FORWARDED']; } else if (validip(isset($_SERVER['HTTP_FORWARDED_FOR']))) { return $_SERVER['HTTP_FORWARDED_FOR']; } else if (validip(isset($_SERVER['HTTP_FORWARDED']))) { return $_SERVER['HTTP_FORWARDED']; } else if (validip(isset($_SERVER['HTTP_X_FORWARDED']))) { return $_SERVER['HTTP_X_FORWARDED']; } else { return $_SERVER['REMOTE_ADDR']; } } function jobspec_dropdown($connection,$ddname="jobspec",$selected=-1) { global $db; $ret="<select name='$ddname' type='dropdown'>"; $q=$db->query("SELECT js.*,j.* FROM jobspecials js LEFT JOIN jobs j ON js.jsJOB=j.jID ORDER BY j.jNAME ASC, js.jsNAME ASC"); if($selected == -1) { $first=0; } else { $first=1; } while($r=$db->fetch_row($q)) { $ret.="\n<option value='{$r['jsID']}'"; if ($selected == $r['jsID'] || $first == 0) { $ret.=" selected='selected'";$first=1; } $ret.=">{$r['jNAME']} - {$r['jsNAME']}</option>"; } $ret.="\n</select>"; return $ret; } function upgrade_dropdown($connection,$ddname="upgrade",$selected=-1) { global $db; $ret="<select name='$ddname' type='dropdown'>"; $q=$db->query("SELECT * FROM house_upgrades ORDER BY upgradeName ASC"); if($selected < 1) { } else { $ret.="<option value='0'>-- None --</option>"; } while($r=$db->fetch_row($q)) { $ret.="\n<option value='{$r['upgradeId']}'"; if ($selected == $r['upgradeId']) { $ret.=" selected='selected'";$first=1; } $ret.=">{$r['upgradeName']}</option>"; } $ret.="\n</select>"; return $ret; } ?>
-
ok so i know this means that there are two functions with the same name, BUT there really isnt !! Fatal error: Cannot redeclare validemail1() (previously declared in /home/feky/public_html/global_func.php:2) in /home/feky/public_html/global_func.php on line 28. i can change the validemail1 to anything and i still get the same error! just incase ill include my register.php and global_func.php reg <?php session_start(); include_once (DIRNAME(__FILE__) . '/ImPoRtAnT/config.php'); include_once (DIRNAME(__FILE__) . '/global_func.php'); global $_CONFIG; define("MONO_ON", '1'); include_once (DIRNAME(__FILE__) . '/ImPoRtAnT/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(); $SelectSettings = $db->query("SELECT `conf_name`, `conf_value` FROM `settings`"); while($r = $db->fetch_row($SelectSettings)) { $Set[$r['conf_name']] = $r['conf_value']; } $IP = getip(); $iap = getip(); $gq=mysql_query("SELECT * FROM `users` WHERE `lastip`='$iap'",$c); if (mysql_num_rows($gq) > 0) { die("<font color=red size=-1>Thugs city does not allow more than one account."); } $gq=mysql_query("SELECT * FROM `users` WHERE `lastip_login`='$iap'",$c); if (mysql_num_rows($gq) > 0) { die("<font color=red size=-1>Thugs city does not allow more than one account."); } $gq=mysql_query("SELECT * FROM `users` WHERE `lastip_signup`='$iap'",$c); if (mysql_num_rows($gq) > 0) { die("<font color=red size=-1>Thugs city does not allow more than one account."); } //Remove the die('Register is Closed'); when register is available to public //die('Register Is Closed'); echo ' <!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>Thugs City - Register</title> <script src="Reg.JS" type="text/javascript"></script> <link rel="stylesheet" type="text/css" href="c1s.css" /> </head> <body> <div id="container"> <div id="header"></div> <div id="topmenu"> <ul> <li id="topmenucorner1"> <li id="topmenucorner2">[url="index.php"]Home[/url]<li id="topmenucorner3"> <li id="topmenucorner2">[url="tc.php"]T&C[/url]<li id="topmenucorner3"> <li id="topmenucorner2">[url="login.php"]Login[/url]<li id="topmenucorner3"> <li id="topmenucorner2">[url="register.php"]Register[/url]<li id="topmenucorner3"> [/list] </div> <div id="login"> <form action=authenticate.php method=post name=login onsubmit="return saveme();"> Username: <input type=text name=username size="10" class="inputback"> Password: <input type=password name=password size="10" class="inputback"> Remember me? <input type="radio" value="ON" name="save">Yes <input type="radio" name="save" value="OFF" checked>No <input type=submit value=Enter class="button"> </form> </div> <div id="wrapper1"> <div id="wrapper2"> <div id="left"> <div class="leftmenu"> <div class="leftmenutitle">Menu</div> <ul id="leftmenulinks"> [*][url="index.php"]Home[/url] [*][url="tc.php"]T&C[/url] [*][url="register.php"]Register[/url] [*][url="login.php"]Login[/url] [/list] </div> </div> <div id="right"> <div class="rightcontent2"> <div class="rightcontent1"></div>'; if (isset($_POST['username'])) { if ($Set['regcap_on']) { if (!$_SESSION['captcha'] OR $_SESSION['captcha'] != $_POST['captcha']) { unset($_SESSION['captcha']); echo '<div class="CenterText"><span style="color: #FF0000;">Error Captcha Test Failed!</span> > [url="register.php"]Back[/url]</div>'; } unset($_SESSION['captcha']); include_once (DIRNAME(__FILE__) . '/EPage.php'); } else if (!ValidEmail1(trim($_POST['email']))) { echo '<div class="CenterText"><span style="color: #FF0000;">Error Invalid Email!</span> > [url="register.php"]Back[/url]</div>'; include_once (DIRNAME(__FILE__) . '/EPage.php'); } else if (strlen($_POST['username']) < '4') { echo '<div class="CenterText"><span style="color: #FF0000;">Error Username Is Too Short!</span> > [url="register.php"]Back[/url]</div>'; include_once (DIRNAME(__FILE__) . '/EPage.php'); } $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}'"); $q2=$db->query("SELECT * FROM users WHERE email='{$_POST['email']}'"); if($db->num_rows($q)) { print "Username already in use. Choose another. >[url='register.php']Back[/url]"; include_once (DIRNAME(__FILE__) . '/EPage.php'); } else if($db->num_rows($q2)) { print "E-Mail already in use. Choose another. >[url='register.php']Back[/url]"; include_once (DIRNAME(__FILE__) . '/EPage.php'); } else if($_POST['password'] != $_POST['cpassword']) { print "The passwords did not match, go back and try again. >[url='register.php']Back[/url]"; include_once (DIRNAME(__FILE__) . '/EPage.php'); } else { $_POST['ref'] = abs((int) $_POST['ref']); $IP = getip(); 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, email, bankmoney, lastip, lastip_signup) VALUES( '{$username}', '{$username}', md5('{$_POST['password']}'), 1, $sm, 0, 0, 1, 12, 12, 100, 100, 5, 5, 100, 100, 1, '{$_POST['gender']}', unix_timestamp(), '{$_POST['email']}', -1, '$IP', '$IP')"); $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 "<div class='CenterText'>You have signed up, enjoy the game. > [url='login.php']Login[/url]</div>"; include_once (DIRNAME(__FILE__) . '/EPage.php'); } } 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 " <h3>Thugs city Registration</h3> <div class='rightcontentblock'> <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);' class='inputback'></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();' class='inputback'></td> <td><div id='passwordresult'></div></td> </tr> <tr> <td>Confirm Password</td><td><input type=password name=cpassword id='pw2' onkeyup='PasswordMatch();' class='inputback'></td> <td><div id='cpasswordresult'></div></td> </tr> <tr> <td>Email</td><td><input type=text name=email onkeyup='CheckEmail(this.value);' class='inputback'></td> <td><div id='emailresult'></div></td> </tr> <tr> <td>Gender</td> <td colspan='2'><select name='gender' type='dropdown'> <option value='Male' class='inputback'>Male <option value='Female' class='inputback'>Female</select></td> </tr> <tr> <td>Promo Code</td><td colspan=2><input type=text name=promo class='inputback'></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=captcha_verify.php?bgcolor=C3C3C3] <input type='text' name='captcha' /></td> </tr>"; } print " <tr> <td colspan=3 align=center><input type=submit value=Submit></td> </tr> </table> </form> [url='login.php']Go Back[/url]"; } print <<<OUT </div> <div class="rightcontent3"></div> </div> </div> </div> </div> <div id="wrapper3"></div> </div> <div id="footer">Copyright 2008 - 2009 </span></a></div> </div> </body> </html> OUT; ?>
-
Re: problem with zaypay all sorted !! now once they have completed the donation, they get the dp, the payment id and the user id get logged, and everytime some one trys to donate, it checks for the payment id, and if it exists it redirects them to the start to get a new payment id !! thanks for the idea +1 !!!!
-
Re: problem with zaypay ahhh of corse, thank you :)
-
hi, iv finally managed to set up zaypay (it testing stages) but i have found a problem, i can accept payment, credit the dp, But once the payment has been received the user can refresh the page to get more and more. im asking for a little bit of a script to stop users refreshing. iv looked around and tried the ones i found, but none worked. any help is welcomed.
-
Re: Gangs with same names yeah but you told me to put it after that, which i tried, didnt work, josh put it before and wow, it worked. but thanks for your input.
-
Re: Gangs with same names +1 josh thank you very much !!
-
Re: Total job pay Thank you :)
-
ok im having a few issues with this, id like to put it in the city stats, to show how much people are earning from jobs in total, iv messed around but what would be the easiest way to go about it? new line in user DB? or DB query for job ranks from users then jrpay from jobranks?? any help will be welcomed, thanks for your time !
-
Re: Gangs with same names iv tried here, there and everywhere lol even putting it after the : $name = clean($_POST['name']); $desc = clean($_POST['desc']); it returns "no duupped gang names"
-
Re: Gangs with same names ok haven't been able to get on for a few days, but still no luck, the way you posted wouldnt let me create any gangs!! heres what i got, its like it wont check !! <?php include(DIRNAME(__FILE__) . '/globals.php'); function format($str) { if(is_numeric($str)) { $str = number_format($str); } else { $str = nl2br($str); $str = stripslashes($str); } return $str; } function clean($string) { $string = mysql_real_escape_string($string); $string = htmlspecialchars($string); return $string; } if($ir['money'] < 1000) { echo "You don't have enough money. You need \$1,000."; $h->endpage(); exit; } if($ir['gang']) { echo "You're already in a gang!"; $h->endpage(); exit; } if(isset($_POST['name'])) { $check=$db->query("SELECT `gangNAME` FROM `gangs` WHERE `gangNAME` = '{$name}'"); if($db->num_rows($check)) { print "ERROR. [url='creategang.php']> Back[/url]"; $h->endpage(); exit; } $name = clean($_POST['name']); $desc = clean($_POST['desc']); $sql = sprintf("INSERT INTO gangs (gangNAME, gangDESC, gangPREF, gangSUFF, gangMONEY, gangCRYSTALS, gangRESPECT, gangPRESIDENT, gangVICEPRES, gangCAPACITY) VALUES ('%s', '%s', '', '', 0, 0, 100, %u, %u, 5)", $name, $desc, $userid, $userid); $db->query($sql); $i = $db->insert_id(); $gang = sprintf("UPDATE users SET gang = %u, money = money - 1000 WHERE (userid = %u)", $i, $userid); $db->query($gang); echo "Gang created!"; } else { echo "<h3>Create A Gang</h3>"; echo "<form action='creategang.php' method='post'>"; echo "<input type='hidden' name='submit' value='1' />"; echo "Name:<input type='text' name='name' /> "; echo "Description: "; echo "<textarea name='desc' cols='40' rows='7'></textarea>"; echo " <input type='submit' value='Create Gang for \$1,000' />"; echo "</form>"; } $h->endpage(); ?>
-
Re: Gangs with same names :) thank you, this has been on my mind all day !
-
good morning, im having problems with my gangs, iv tried fixing it but dont seem to be getting anywhere!! the problem is that you can create a gang with the same name that someone else has, so i have two gangs with the same name, which, as you can guess is kind of annoying!! any help will be welcomed as i cant fix it. thanks <?php include(DIRNAME(__FILE__) . '/globals.php'); function format($str) { if(is_numeric($str)) { $str = number_format($str); } else { $str = nl2br($str); $str = stripslashes($str); } return $str; } function clean($string) { $string = mysql_real_escape_string($string); $string = htmlspecialchars($string); return $string; } if($ir['money'] < 1000) { echo "You don't have enough money. You need \$1,000."; $h->endpage(); exit; } if($ir['gang']) { echo "You're already in a gang!"; $h->endpage(); exit; } if(isset($_POST['name'])) { $name = clean($_POST['name']); $desc = clean($_POST['desc']); $sql = sprintf("INSERT INTO gangs (gangNAME, gangDESC, gangPREF, gangSUFF, gangMONEY, gangCRYSTALS, gangRESPECT, gangPRESIDENT, gangVICEPRES, gangCAPACITY) VALUES ('%s', '%s', '', '', 0, 0, 100, %u, %u, 5)", $name, $desc, $userid, $userid); $db->query($sql); $i = $db->insert_id(); $gang = sprintf("UPDATE users SET gang = %u, money = money - 1000 WHERE (userid = %u)", $i, $userid); $db->query($gang); echo "Gang created!"; } else { echo "<h3>Create A Gang</h3>"; echo "<form action='creategang.php' method='post'>"; echo "<input type='hidden' name='submit' value='1' />"; echo "Name:<input type='text' name='name' /> "; echo "Description: "; echo "<textarea name='desc' cols='40' rows='7'></textarea>"; echo " <input type='submit' value='Create Gang for \$1,000' />"; echo "</form>"; } $h->endpage(); ?>