Jump to content
MakeWebGames

Could i steal 10 seconds of your life to help me? Thanks


Recommended Posts

Posted

Hi,

I hope you can help me, I bought the email verification from cronus i couldnt get it to work so i added my old register.php file back on my server. And throuhout my game i get the error messages:

 

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/murderco/public_html/inventory.php on line 27
You have no items Equipped!

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/murderco/public_html/inventory.php on line 53

On my inventory.php

and

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/murderco/public_html/halloffame.php on line 160

On my halloffame.php,

I presume its got to be my register thats caused these probems as i had no trouble at all before, below is my register.php i hope you can help. thanks for your time.

<?php
session_start();
print "<html>
<head>
<title>Murder Country</title>
<style>
body { font-family:Verdana;font-size:9pt;color: red;
  background-color:black;
  scrollbar-base-color: red;
  scrollbar-arrow-color: black;
  scrollbar-DarkShadow-Color: #000000; }
a:visited,a:active,a:hover,a:link { color: red;text-decoration: none; }
table,tr,td { font-size:9pt; }
img { border:none; }
</style>
</head>
<body>[img=logo.png]
";
$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>");
}
require "mysql.php";
global $c;
if($_POST['username'])
{
$sm=100;
if($_POST['promo'] == "Your Promo Code Here")
{
$sm+=100;
}
$username=$_POST['username'];
$username=str_replace(array("<", ">"), array("<", ">"), $username);
$q=mysql_query("SELECT * FROM users WHERE username='{$username}'",$c);
if(mysql_num_rows($q))
{
print "Username already in use. Choose another.";
}
else if($_POST['password'] != $_POST['cpassword'])
{
print "The passwords did not match, go back and try again.";
}
else
{
$_POST['ref'] = abs((int) $_POST['ref']);
$ip = ($_SERVER['HTTP_X_FORWARDED_FOR'])
   ?  $_SERVER['HTTP_X_FORWARDED_FOR']
   :  $_SERVER['REMOTE_ADDR'];
$q=mysql_query("SELECT * FROM users WHERE lastip='$ip' AND userid={$_POST['ref']}",$c);
if(mysql_num_rows($q))
{
die("No creating referral multies. Bad dog.");
}
if($_POST['ref']) {
$q=mysql_query("SELECT * FROM users WHERE userid={$_POST['ref']}",$c);
$r=mysql_fetch_array($q);
}
mysql_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) VALUES( '{$username}', '{$username}', md5('{$_POST['password']}'), 1, $sm, 2, 2, 1, 12, 12, 100, 100, 5, 5, 100, 100, 9, 'Male', unix_timestamp(), '{$_POST['email']}', -1, '$ip')", $c);
$i=mysql_insert_id($c);
mysql_query("INSERT INTO userstats VALUES($i, 10, 10, 10, 10, 10)", $c);

if($_POST['ref']) {
require "global_func.php";
mysql_query("UPDATE users SET crystals=crystals+2 WHERE userid={$_POST['ref']}",$c);
event_add($_POST['ref'],"For refering $username to the game, you have earnt 2 valuable crystals!",$c);
mysql_query("INSERT INTO referals VALUES('', {$_POST['ref']}, $i, unix_timestamp(),'{$r['lastip']}','$ip')", $c);
}
print "You have signed up, enjoy the game.

> [url='login.php']Login[/url]";
}
}
else
{
print "<h3>Murder Country Registration</h3>";
print "<form action=register.php method=post>Username: <input type=text name=username>

Password: <input type=password name=password>

Confirm Password: <input type=password name=cpassword>

Email: <input type=text name=email>

Promo Code: <input type=text name=promo>

<input type=hidden name=ref value='";
if($_GET['REF']) { print $_GET['REF']; }
print "'>
<input type=submit value=Submit></form>

> [url='login.php']Go Back[/url]";
}
print "</body></html>";
?>
Posted

Re: Could i steal 10 seconds of your life to help me? Thanks

First thing lets talk security lol

$ip = ($_SERVER['HTTP_X_FORWARDED_FOR'])
   ?  $_SERVER['HTTP_X_FORWARDED_FOR']
   :  $_SERVER['REMOTE_ADDR'];

Bad

$ip =  $_SERVER['REMOTE_ADDR'];

Better ;D

and after quickly looking over your register i see no problems and for the inventory.php error we're gonna need to know whats on line 25ish - 30 ish to fix that problem and its probably a good idea to post your halloffame.php aswell.

Posted

Re: Could i steal 10 seconds of your life to help me? Thanks

My email verification mod has nothing to do with the inventory page so I find it highly unlikely that it is what caused your inventory page to error.

Posted

Re: Could i steal 10 seconds of your life to help me? Thanks

lol. Your register page has nothing to do with inventory. Same as the email verification has nothing to do with inventory. lol.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...