Jump to content
MakeWebGames

why


3XTR3M3

Recommended Posts

Re: why

There is a problem with your mysql insert query.

Please let me know what the column name for the 'class' is.

If it is 'class' use the following query;

INSERT INTO users (username, login_name, userpass, level, money, user_level, energy, maxenergy, will, maxwill, brave, maxbrave, hp, maxhp, location, class, gender, signedup, email,  lastip) VALUES( '{$username}', '{$username}', md5('{$_POST['password']}'), 1, $sm,  1, 12, 12, 100, 100, 5, 5, 100, 100, 1, '{$_POST['class']}', '{$_POST['gender']}', unix_timestamp(), '{$_POST['email']}',  '$ip')
Link to comment
Share on other sites

Re: why

 

There is a problem with your mysql insert query.

Please let me know what the column name for the 'class' is.

If it is 'class' use the following query;

INSERT INTO users (username, login_name, userpass, level, money, user_level, energy, maxenergy, will, maxwill, brave, maxbrave, hp, maxhp, location, class, gender, signedup, email,  lastip) VALUES( '{$username}', '{$username}', md5('{$_POST['password']}'), 1, $sm,  1, 12, 12, 100, 100, 5, 5, 100, 100, 1, '{$_POST['class']}', '{$_POST['gender']}', unix_timestamp(), '{$_POST['email']}',  '$ip')

 

good catch, I missed that when I went over it

Link to comment
Share on other sites

Re: why

 

INSERT INTO users (username, login_name, userpass, level, money, user_level, energy, maxenergy, will, maxwill, brave, maxbrave, hp, maxhp, location, class, gender, signedup, email,  lastip) VALUES( '{$username}', '{$username}', md5('{$_POST['password']}'), 1, $sm,  1, 12, 12, 100, 100, 5, 5, 100, 100, 1, '{$_POST['class']}', '{$_POST['gender']}', unix_timestamp(), '{$_POST['email']}',  '$ip')

i get this now

Parse error: syntax error, unexpected T_STRING in /home/liam/public_html/register.php on line 60
Link to comment
Share on other sites

Re: why

Ferdi spoon feeds the kitten(btw. I'm allergic to cats and dogs).

 

<?php
 session_start();
 print "<html>
<head>
<title>Deaths-City</title>
<style>
body { font-family:Verdana;font-size:9pt;color: black;
  background-color:#333333;
  scrollbar-base-color: #005B70;
  scrollbar-arrow-color: #F3960B;
  scrollbar-DarkShadow-Color: #000000; }
a:visited,a:active,a:hover,a:link { color: black;text-decoration: none; }
table,tr,td { font-size:9pt; }
img { border:none; }
</style>
</head>
<body>[img=mybanner.gif]
";
 $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.";
     } elseif ($_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, user_level, energy, maxenergy, will, maxwill, brave, maxbrave, hp, maxhp, location, class, gender, signedup, email,  lastip) VALUES( '$username', '$username', md5('{$_POST['password']}'), 1, '$sm',  1, 12, 12, 100, 100, 5, 5, 100, 100, 1, '{$_POST['class']}', '{$_POST['gender']}', unix_timestamp(), '{$_POST['email']}',  '$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>Deaths-City 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>

Gender: <select type='dropdown' name='gender'><option value='male'>Male</option><option value='female'>Female</option></select>

Email: <input type=text name=email>

Class: <select name='class' type='dropdown'><option>Criminal</option><option>Mobster</option><option>Assasin</option><option>N/A</option></select>

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>";
?>
Link to comment
Share on other sites

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...