Jump to content

GetReady

Members
  • Posts

    65
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

GetReady's Achievements

Member

Member (2/5)

0

Reputation

  1. Thanks, I'll give that a look, may just be worth me re coding the registration page... worked last time i tested it guess i screwed something up (dammit not keeping back ups!) and i haven't released it as of yet, doing the last stretch of testing, bug fixes etc at this current time... probably be another week or so before we go live, if your interested I'll message you when it's up and running.
  2. Yea, actual sql below.... I have absolutely no clue why it's not working -- -- Table structure for table `players` -- CREATE TABLE IF NOT EXISTS `players` ( `id` int(9) NOT NULL AUTO_INCREMENT, `name` varchar(21) NOT NULL, `password` varchar(60) NOT NULL, `email` varchar(60) NOT NULL, `ip_address` varchar(30) NOT NULL, `last_login` timestamp NULL DEFAULT NULL, `is_active` tinyint(1) NOT NULL, `in_guild` tinyint(1) NOT NULL, `score` int(9) NOT NULL, `actual_score` int(9) NOT NULL, `attack` int(9) NOT NULL, `armor` int(9) NOT NULL, `magic` int(9) NOT NULL, `resist` int(9) NOT NULL, `gold` bigint(12) NOT NULL, `bank_gold` bigint(12) NOT NULL, `bank_deposits` int(11) NOT NULL DEFAULT '2', `class` varchar(20) NOT NULL, `energy` int(9) NOT NULL, `energy_regen` tinyint(3) NOT NULL DEFAULT '10', `age` bigint(14) NOT NULL, `sex` varchar(20) NOT NULL, `rank` varchar(20) NOT NULL, `experience` int(9) NOT NULL, `level` tinyint(1) NOT NULL, `admin` tinyint(1) NOT NULL, `location` varchar(55) NOT NULL DEFAULT 'Caldera', `room` int(11) NOT NULL DEFAULT '5', `x_loc` int(4) NOT NULL DEFAULT '4', `y_loc` int(4) NOT NULL DEFAULT '3', `donator` tinyint(1) NOT NULL, `subscriber` tinyint(1) NOT NULL, `points` bigint(12) NOT NULL, `income` int(11) NOT NULL DEFAULT '50', `gold_stolen` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=124561 ;
  3. I do get when registering a name not currently in the database; Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in C:\Program Files\EasyPHP-5.3.3\www\htdocs\register.php on line 174 Congratulations, you registered successfully! Line 174 in dreamweaver is the: mysql_real_escape_string($_POST['username']), Rather odd.
  4. The following is 100% connected to the database as it says if a name is in use.... yet wont let you register; Really starting to hurt my head wondering as to why i just cannot see it, please any help will be great thanks. <?php if($_POST) { function VisitorIP() { if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) $TheIp=$_SERVER['HTTP_X_FORWARDED_FOR']; else $TheIp=$_SERVER['REMOTE_ADDR']; return trim($TheIp); } $ipaddress = VisitorIP(); $name = $_POST['username']; $namelength = strlen($name); $email = $_POST['email']; $password = $_POST['password']; $passwordlength = strlen($password); $confirm = $_POST['confirm']; if($namelength < 3){ $error1="<div class='text1' style='background-color:#FF0;'><span style='color:red'>Error: Your username must be at least 3 characters!</span></div>"; echo $error1; } elseif($passwordlength < 6) { $error1="<div class='text1' style='background-color:#FF0;'><span style='color:red'>Error: Password must be at least 6 characters long!</span></div>"; echo $error1; } elseif($email == "") { $error1="<div class='text1' style='background-color:#FF0;'><span style='color:red'>Error: You must enter an email address!</span></div>"; echo $error1; } elseif($password != $confirm) { $error1="<div class='text1' style='background-color:#FF0;'><span style='color:red'>Error: Passwords do not match!</span></div>"; echo $error1; } else { include("server.php"); $query = sprintf("SELECT COUNT(id) FROM players WHERE UPPER(name) = UPPER('%s')", mysql_real_escape_string($_POST['username'])); $result = mysql_query($query); list($count) = mysql_fetch_row($result); if($count >= 1) { $error1="<div class='text1' style='background-color:#FF0;'><span style='color:red'>Error: that username is taken.</span></div>"; echo $error1; } else { $query1 = sprintf("INSERT INTO players(name,password,email,ip_address) VALUES ('%s','%s', '$email','$ipaddress');", mysql_real_escape_string($_POST['username']), mysql_real_escape_string(md5($password))); mysql_query($query1); $error1="<div class='text1' style='background-color:#FF0;'><span style='color:#390'>Congratulations, you registered successfully!</span></div>"; echo $error1; } } } ?>
  5. Hi, i made a registration page in php, Only problem is its not submitting anything to the database nor throwing back an errors. I'm confused as to why, the code is below any help will be appreciated thanks ** server.php holds the database info i.e <?php ///Server Info $dbhost = "localhost"; $dbuser = "*****"; $dbpass = "******"; $dbname = "****"; $conn = mysql_connect($dbhost,$dbuser,$dbpass) or die(); mysql_select_db($dbname); ?> Registration page in question; <?php require_once('check.php'); session_start(); $name = $_SESSION['name']; require_once('server.php'); require_once('stats.php'); if($_POST) { function VisitorIP() { if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) $TheIp=$_SERVER['HTTP_X_FORWARDED_FOR']; else $TheIp=$_SERVER['REMOTE_ADDR']; return trim($TheIp); } $ipaddress = VisitorIP(); $name = $_POST['username']; $namelength = strlen($name); $email = $_POST['email']; $password = $_POST['password']; $passwordlength = strlen($password); $confirm = $_POST['confirm']; if($namelength < 3){ $error1="<div class='text1' style='background-color:#FF0;'><span style='color:red'>Error: Your username must be at least 3 characters!</span></div>"; echo $error1; } elseif($passwordlength < 6) { $error1="<div class='text1' style='background-color:#FF0;'><span style='color:red'>Error: Password must be at least 6 characters long!</span></div>"; echo $error1; } elseif($email == "") { $error1="<div class='text1' style='background-color:#FF0;'><span style='color:red'>Error: You must enter an email address!</span></div>"; echo $error1; } elseif($password != $confirm) { $error1="<div class='text1' style='background-color:#FF0;'><span style='color:red'>Error: Passwords do not match!</span></div>"; echo $error1; } else { include("server.php"); $query = sprintf("SELECT COUNT(id) FROM players WHERE UPPER(name) = UPPER('%s')", mysql_real_escape_string($_POST['username'])); $result = mysql_query($query); list($count) = mysql_fetch_row($result); if($count >= 1) { $error1="<div class='text1' style='background-color:#FF0;'><span style='color:red'>Error: that username is taken.</span></div>"; echo $error1; } else { $query1 = sprintf("INSERT INTO players(name,password,email,ip_address) VALUES ('%s','%s', '$email','$ipaddress');", mysql_real_escape_string($_POST['username']), mysql_real_escape_string(md5($password))); mysql_query($query1); $error1="<div class='text1' style='background-color:#FF0;'><span style='color:#390'>Congratulations, you registered successfully!</span></div>"; echo $error1; } } } ?>
  6. Thanks guys, Yea DevilsAdvocate that worked a charm. One thing thought does anyone know of a way in which that code could echo the results at the bottom of the page instead of going to a blank page.. Thanks.
  7. Sorry my php skills are amateur to say the least, Its supposed to divide each number e.g numa divided by numb divided by numb2, Its how ever not echoing the results... I take it ive gone wrong with that function somehow also? Any help is appreciated Thanks!
  8. This wont work for some reason and its begining to get to me, any chance of some help? <?php /* Calculator */ if($submit) { echo $numa / $numb / $numb2; { } else { ?> <form method="POST" action="<?php $_SERVER['PHP_SELF']; ?>"> <p>number 1: </p> <p> <input type="text" name="numa" size="10"> </p> <p>number 2: </p> <p> <input type="text" name="numb" size="10"> </p> <p>number 3: </p> <p> <input type="text" name="numb2" size="10"> </p> <p> <input type="submit" value="Calculate output!" name="submit"> </p> </form> <?php } ?>
  9. The following wont work once added to my current codebase any ideas as to why? Thanks. } if ($time=$conf["hours_to_block_same_user_attacking"]*60*60; $IP=isIPNewerThen($ip,$time); if ($IP){ //print_r($IP); //$IP=getIP($ipID); $time=time()-$IP->time; //alert($time); $time=$conf["hours_to_block_same_user_attacking"]*60*60-$time; //alert($time); $t=$time/(60*60); $tF=floor($t); $timeA['tm_hour']=$tF; $time=$time-$tF*60*60; $t=$time/(60); $tF=floor($t); $timeA['tm_min']=$tF; $time=$time-$tF*60; $timeA['tm_sec']=$time; // $t=($time-$timeA['tm_sec']) ?>You may only steal from an individual once per 6 hours.<br> You will need to wait <?=$timeA['tm_hour']?> hours, <?=$timeA['tm_min']?> minutes and <?=$timeA['tm_sec']?> seconds before attacking again <? } else{
  10. Is it possible to make the following function only run once the user types in there password? if so how would i go about it, Regards. function deleteUser($id){ $str = "DELETE FROM `UserDetails` WHERE ID='$id'"; //echo $str; $q = @mysql_query($str); $str = "DELETE FROM `Ranks` WHERE userID='$id'"; $q = @mysql_query($str); deleteUserWeapon($id); deleteIP($id); deleteAtacksOfUser($id); deleteSpyLogsOfUser($id); deleteMessagesOfUser($id); $str = "update `UserDetails` set commander=0 WHERE commander='$id' "; $q = @mysql_query($str); /* if (!$q) { print ('Query failed: '.mysql_error()); return; }*/
  11. Hi, Basically when i want it to refresh an iframe i have... once a link is clicked within the iframe (Steal.cfm) it would stop refreshing.
  12. Hey i basically use the following on a html website skin i have with an auto refresh function, is it possible to make the auto refresh stop once a link is clicked; code below 1. <html> 2. <head> 3. <script> 4. var asdf = false; 5. function StartTime(){ 6. if(asdf)clearTimeout(asdf) 7. asdf = setTimeout("RefreshPage()",5000); 8. } 9. function RefreshPage(){ 10. clearTimeout(asdf) 11. if(document.Test.CB1.checked) 12. document.location.href= "timerRefresh.htm?Checked" 13. } 14. function LoadPage(){ 15. var findCheck = document.location.href.split("?Chec"); 16. if(findCheck.length == 2){ 17. document.Test.CB1.checked=true; 18. StartTime() 19. } 20. } 21. </script> 22. </head> 23. <body onload="LoadPage()"> 24. <form name="Test"> 25. <input type="checkbox" name="CB1" onclick="StartTime()"> 26. </form> 27. </body> 28. </html>
  13. ahhh thanks for that, that was the problem just having issues with the ifs coflicting now, should this not work now? as i now need it to be an individual action. <? if (!(isset($tos))) { echo 'you must agree to our TOS';} ?>
  14. Hey my code was workign fine before i added these lines into the correct areas of the php that im 100% sure about the following was added; $tos= $_POST['tos']; $tos= strip_tags($tos); }else{ if (!(isset($tos))){ echo 'you must agree to our TOS'; }else{ <td colspan="2"><input type="checkbox" name="tos" value="true"> I have read and agree to comply with the <a href="tos.php" target="_new">terms of service</a></td> Im getting the error message; Parse error: syntax error, unexpected $end Any help would be great; Thanks.
  15. Hi, im newish to javascript, i have some javascript code but would like to run it at the :25 of every hour, is there a code to do this? or a tutorial you can forward me to, ive looked around but one for executing the javascript on that specific time isn't something i can find, Thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.