Jump to content

REGISTRATION HELP PLZ!!!


cheat

Recommended Posts

OK IVE BEEN MAKING A MMORPG I HAVE ALL MY SCRIPTS UPLOADED AND THE DATABASE IS DONE BUT WHEN A PLAYER REGISTERING IT IS SAYING THAT THEY HAVE SUCCESSFULLY REGISTERED BUT IS NOT ADDING THEIR DETAILS TO THE DATABASE... I HAVE BEEN TOLD THAT THE FOLLOWING SCRIPT HAS A ERROR THAT IS CAUSING THE PROBLEM PLZ HELP!

 

<?php

session_start();

include("conn.php");

$country = $_POST[location];

if ($country == "England") {

    $drug_prices = "8-13-21-9-106-36-32-103-159";

} elseif ($country == "France") {

    $drug_prices = "12-54-28-2-129-29-19-97-147";

} elseif ($country == "Italy") {

    $drug_prices = "10-26-54-19-97-23-25-89-153";

} elseif ($country == "Germany") {

    $drug_prices = "11-47-13-121-39-12-93-149-131";

} elseif ($country == "China") {

  $drug_prices = "7-38-17-22-152-27-14-95-144";

} elseif ($country == "Russia") {

  $drug_prices = "4-41-33-7-122-65-21-94-120";

} elseif ($country == "Mexico") {

  $drug_prices = "11-40-28-14-136-21-81-100-160";

} elseif ($country == "Japan") {

  $drug_prices = "9-45-22-63-101-30-100-87-152";

} elseif ($country == "Australia") {

  $drug_prices = "21-33-27-6-100-35-22-88-133";

}

?>

<html>

<head>

<title>Sign Up</title>

<style type="text/css">

<!--

body,td,th {

color: #FFFFFF;

}

body {

background-color: #000000;

}

a:link {

color: #00FFFF;

text-decoration: underline;

}

a:visited {

text-decoration: underline;

color: #00FFFF;

}

a:hover {

text-decoration: none;

color: #FFFFFF;

}

a:active {

text-decoration: underline;

}

-->

</style>

</head>

<body>

<?php

$time = time();

$email = $_POST["email"];

$user = str_replace(" ", "_", $_POST[username]);

$username = strtolower($user);

$user_exist = mysql_query("SELECT * FROM users WHERE username='$username'") or die(mysql_error());

if (mysql_num_rows($user_exist) == "1") {

echo "Username already in use";

} else {

$sql = "INSERT INTO users VALUES ('', '$username', password('$_POST[password]'), '$_POST[full_name]', '$email', '0', '0', '500', 'none', '100', '0', '0', '0', '0', 'alive', '0', '0', '0', '$time', '0', '$country', '0','0', '0', 'no', '', '1', '$drug_prices', '0', 'none', 'middle.jpg', 'none', '$_POST[username]', '0', '0', '0', '0', '0', '1')";

$_SESSION["name"] = $_POST["username"];

if (mysql_query($sql, $conn)) {

echo "Succesful signup!<br><a href='index.php'>Sign in</a>";

} else {

echo "Unsucessful sign-up please try again";

}

}

?>

</body>

</html>

Link to comment
https://forums.phpfreaks.com/topic/36948-registration-help-plz/
Share on other sites

Randomising? Where's the random coming from?

 

Your problem is your query:

$sql = "INSERT INTO users VALUES ('', '$username', password('$_POST[password]'), '$_POST[full_name]', '$email', '0', '0', '500', 'none', '100', '0', '0', '0', '0', 'alive', '0', '0', '0', '$time', '0', '$country', '0','0', '0', 'no', '', '1', '$drug_prices', '0', 'none', 'middle.jpg', 'none', '$_POST[username]', '0', '0', '0', '0', '0', '1')";

 

The syntax for an insert is INSERT INTO table_name (comma seperated fields list) VALUES (values like you have, in same order as fields)

Link to comment
https://forums.phpfreaks.com/topic/36948-registration-help-plz/#findComment-176367
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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