Qbasicnews.com

Full Version: PHP login system for AtosoftQB
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
I need to test it, and see where the bugs are

http://atosoftqb.digitalblackie.com
>> login
>> Not a member? Join Here
>> Agree
>> User info

Oz~
i keep getting this messege:

Quote:1136: Column count doesn't match value count at row 1

Oz~
If you are willing can we see some source?
I'll post some source, but for privacey reasons, i will star-out the username, password, and database name.

just give me a sec, and I will edit this post...

Oz~

Edit:

Code:
<HTML>

<HEAD>
  <TITLE>AtosoftQb Homepage</TITLE>
</HEAD>

<BODY bgcolor="White" text="Black" link="#004080" vlink="#004080" alink="#004080">

<?

require("header.htm");

$username=$_POST['duser'];
$email=$_POST['email'];
$password=$_POST['pswrd'];

$conn = mysql_connect("localhost" , "****" , "****");

if ($conn == false)
{
echo mysql_errno() . ": " . mysql_error() . "<BR>";
exit;
}

@mysql_select_db("****") or die( "Unable to select database");


$query = "INSERT INTO userdata VALUES ('','$username','password','$email','','0')";
mysql_query($query);


$result = mysql_db_query ("****", $query);

if ($result){
echo "User successfully created! <br> Please click on login on the top menu to continue";
}
else {
echo mysql_errno().": ".mysql_error()."<BR>";
}

mysql_close ();

Require("footer.htm");

?>

</BODY>
</HTML>
3 things

Your INSERT INTO is incorrect syntax
password should be $password
encrypt the password

[syntax="PHP"]$query = "INSERT INTO userdata VALUES ('','$username','password','$email','','0')"; [/syntax]
should be something like:
[syntax="PHP"]$query = "INSERT INTO userdata (``, `username`, `password`, `email`, `whateverthisthingis`) VALUES ('','$username','$password','$email','','0')"; [/syntax]
Quote:[syntax="PHP"]$query = "INSERT INTO userdata VALUES ('','$username','password','$email','','0')"; [/syntax]
should be something like:
[syntax="PHP"]$query = "INSERT INTO userdata (``, `username`, `password`, `email`, `whateverthisthingis`) VALUES ('','$username','$password','$email','','0')"; [/syntax]



No, wt, actually you dont need that. You can just leave it as it was. The Mysql call doesnt require you to tell what fields you are inserting to.
I haven't encrypted the passwords, because the site won't do PMing, or anything major. It'll just be for posting stupid things, and downloading (so i can keep track of whats hot and whats crap).

Oz~
Oz, the whole point of encrypting the password is so that **you** yourself cant see everyones passwords. Do you really i think id register if it let you know my password? I use that password for everything!
Quote:No, wt, actually you dont need that. You can just leave it as it was. The Mysql call doesnt require you to tell what fields you are inserting to.

Whoops Didn't know that. But still password should be $password =P
@darkp: I have no use in looking @ ur password, nor would i use it.

i suppose that is hard to believe, since u don't personally know me...meh

Oz~
Pages: 1 2 3 4