Jump to content

Canadiengland

Members
  • Posts

    38
  • Joined

  • Last visited

    Never

Everything posted by Canadiengland

  1. could this simply be a problem with my cookies / intranet?
  2. GAH SO FRUSTRATING. i echoed the player name and it DOES know ive logged in but BAM as soon as i refresh im not
  3. tried all of which didnt help
  4. no clue it worked yesterday but now its not haha i didnt alter anything
  5. like i said, i know its written poorly but w.e it worked before, now it just stopped all of a sudden i dont remember changing anything
  6. didnt work. i dont think thats the case, i have that on the index pages and what not
  7. use a random number to pick an image verification picture that they have to click on?
  8. <html> <head> <style type="text/css"> <!-- body { background-color: #110f0c; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } --> </style> </head> <body> <font color="#990000"> <link rel="stylesheet" href="loginstyle.css" type="text/css"> <?php include "connect.php"; if (isset($_POST['submit'])) // name of submit button { $player=$_POST['player']; $password=$_POST['password']; $player=strip_tags($player); $password=md5($password); $query = "select * from km_users where playername='$player' and password='$password' and validated='1'"; $result = mysql_query($query) or die("No te Gusta") ; $result2=mysql_fetch_array($result); if($result2) { session_start(); $_SESSION['player']=$player; print "logged in successfully<br><br>"; print "<A href='index.php'>Go to Admin Panel</a>"; } else { echo "<center><table width='750' height='144'><td>"; include 'top.php'; // top echo "</td></table>"; echo "<table width='750' height='30'><td width='750'><center><img src='images/statusbar.jpg'>"; echo "<center><br><table class='maintable' width='750' height='500'>"; echo "<td>"; print "<center>Wrong username or password or non-activated account."; print "<center><A href='index.php'>Back</a></center>"; echo "</td></table>"; } } ?> </body> </html> authenticate.php <?php parse_str("$QUERY_STRING"); $db = mysql_connect("localhost", "root", "stars") or die("Could not connect."); if(!$db) die("no db"); if(!mysql_select_db("monster",$db)) die("No database selected."); if(!get_magic_quotes_gpc()) { $_GET = array_map('mysql_real_escape_string', $_GET); $_POST = array_map('mysql_real_escape_string', $_POST); $_COOKIE = array_map('mysql_real_escape_string', $_COOKIE); } else { $_GET = array_map('stripslashes', $_GET); $_POST = array_map('stripslashes', $_POST); $_COOKIE = array_map('stripslashes', $_COOKIE); $_GET = array_map('mysql_real_escape_string', $_GET); $_POST = array_map('mysql_real_escape_string', $_POST); $_COOKIE = array_map('mysql_real_escape_string', $_COOKIE); } ?> connect.php i know its written horribly but it worked before i stopped workin on it for a while
  9. for some reason, when i try to register a new account to my game it says "cannot register user". ive searched for this in my php files but cannot find it. also, when i try to log in to my game, it works and displays the new page. but the moment i refresh it says i am not logged in again. is this a problem with my cookies? does anyone have any ideas?
  10. aha knew it was something easy - havent been at this in a while - thanks teng!
  11. $selectuser="SELECT * from km_users order by pkpoints ASC"; $selectuser2=mysql_query($selectuser) or die("could not select item"); while($selectuser3=mysql_fetch_array($selectuser2)) { print "<br>$selectuser3[playername]<br><br>"; } i want this to return only the top 5 of the list. how can i limit the query?
  12. SOLVED! added a <td> after each echo and that solved it. thanks for all the help project and frost!
  13. well i kinda fixed it... the way you put it up there made it so that each item would be displayed according to pic... but i wanted it to be each item.. so i changed !in_array($uneq3['itempic'], $shown_items)) to !in_array($uneq3['id], $shown_items)) but ive still got the problem of each pic has the same url when they are 2 different ids
  14. database structure of km_items is name power type expperturn rageperturn itempic owner id status cost rarity raritymax itemfind
  15. may have spoke too soon - that displays a max of 2 seperate pics and both pics are linked to the same url... hmm
  16. wow that worked - thanks for helping AND explaining what you did, so i won't make future errors now!
  17. buuuuuuuuuuuuuump
  18. //unequipped items ------------------------------------------------------------------- $uneq="SELECT DISTINCT * from km_items where owner='$player' and status='u'"; $uneq2=mysql_query($uneq) or die("Could not get user stats"); $uneq3=mysql_fetch_array($uneq2); $shown_items = ""; //this is just another checker, incase my mysql is gay. while($uneq3=mysql_fetch_array($uneq2)) { if (!empty($uneq3['id']) && !in_array($uneq3['itempic'])) { echo "<a href=equip.php?itemid=$uneq3[id]><img src='$uneq3[itempic]'<br>"; $shown_items[] = $uneq3['itempic']; } } print "</table><br><br>"; } } this code gives me the effect but it also says (on the page) Warning: Wrong parameter count for in_array() in C:\wamp\www\killmonster\index.php on line 242 any ideas? 242 is if (!empty($uneq3['id']) && !in_array($uneq3['itempic']))
  19. well the main code is (without his code) $item1="SELECT * from km_items where rarity<'$selmonster3[rare]' and raritymax>'$selmonster[rare]'"; $item2=mysql_query($item1) or die ("Could not find player"); $item3=mysql_fetch_array($item2); it kept displaying Could not find player... meaning it couldnt query it with the added order and limit included
  20. how would i impliment that into my code? i tried usings yours.. didnt work. tried using the ORDER by rand LIMIT 1 in my code... didnt work. im stuck!
  21. how would i make this select a random match for the code but stay within the limiations of rarity? if ($randomitem<$itemget) { $item1="SELECT * from km_items where rarity<'$selmonster3[rare]' and raritymax>'$selmonster[rare]'"; $item2=mysql_query($item1) or die ("Could not find player"); $item3=mysql_fetch_array($item2); $randompower=rand(90,110) / 100; $itempower=$item3[power]*$randompower; $createitem="INSERT into km_items (name, power, type, expperturn, rageperturn, itempic, owner, status, cost, rarity) VALUES ('$item3[name]', '$itempower', '$item3[type]', '$item3[expperturn]','$item3[rageperturn]','$item3[itempic]', '$playerstats3[playername]', 'u', '$item3[cost]', '$item3[rarity]')"; mysql_query($createitem) or die("Could not create item"); print "<center>You've found a(n) $item3[name]<br></center>"; print "<center><A href='index.php'>Kill more monsters</a></center>"; would i change SELECT to random select or something?
  22. how would i make it so that this script recognizes that the random numbers are with 2 decimal places, and make it so it doesnt just round them up? $randomattack=rand(.95,1.05); $randomdefence=rand(.95,1.05);
  23. still doesnt work... i think its cause im using an older version of php or mysql or something.. using whatever comes with wampserver.. but its getting late thanks for trying, ill mess with it more tomorrow.
  24. hmm.. didnt work
×
×
  • 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.