What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Sign up & SQL table problem

Sign up & SQL table problem
Author: Message:
zaher1988
Senior Member
****

Avatar
Inseperable

Posts: 699
Reputation: 10
36 / Male / Flag
Joined: Jun 2005
Status: Away
O.P. Sign up & SQL table problem
Hey!

i'm working on a simple sign up form. that's consisted to 4 pages, 2 html and 2 php

signup.htm make.php login.htm getin.php

and using a server running PHP, mySQL, and phpMyAdmin. i have created a mySQL table which will store the user's name and password when they create it. and, logged on to phpMyAdmin, and select the database. My database is called "easyflas_testdb". Inside the database, i made  a table, called it "users" and have 4 columns for it.

id - INT (auto increment, primary)
username - text
password -  text
email -  text

so i made the user and password, i setup the host and the database!. all are fine till now

and then i went ahead and start making my signup form which starts with the page signup.htm and has this code:

<form action="make.php" method="post">
Username Desired: <input type="text" name="username" size="10">
Password Desired: <input type="password" name="password" size="10">
E-mail: <input type="text" name="email" size="10">
<input type="submit" value="submit" name="submit">
</form>


then i started with my make.php page which will post the info to the SQL data base, make.php has this code:


<?
$conn = mysql_connect("localhost","MYUSER","PASSWORD");


$db = mysql_select_db("easyflas_testdb");

$username = $_POST["username"];
$password = $_POST["password"];
$email = $_POST["email"];


$result= MYSQL_QUERY("INSERT INTO users (id, username, password, email)".
   "VALUES ('NULL', '$username', '$password', '$email')");
   
echo "Your name and password have been submitted into our database :)";
?>


ok done from this test it and no errors it says "Your name and password have been submitted into our database"

but these info are not submited into the TABLE! i checked it times and times, and still telling me that it was submited , but it's not actually.

now i tried anyway to signin using info i used in the signup page using this page login.htm which has this code:

<form action="getin.php" method="post">
Username: <input type="text" name="username" size="10">
Password: <input type="password" name="password" size="10">
<input type="submit" value="submit" name="submit">
</form>


and followed by the page getin.php which is :

<?
$conn = mysql_connect("localhost","MYUSER","PASSWORD");
$db = mysql_select_db("easyflas_testdb");

$username = $_POST["username"];
$password = $_POST["password"];

$result = MYSQL_QUERY("SELECT * from users WHERE username='$username'and password='$password'")
   or die ("Name and password not found or not matched");

$worked = mysql_fetch_array($result);

$username = $worked[username];
$password = $worked[password];
$email = $worked[email];


if($worked)
   echo "Welcome $user! Your e-mail address is $email";
?>



but it's telling"Name and password not found or not matched" me though i also tried to enter these info manually from inside the phpAdmin page! not using the form , so in both cases it's not working .


so please if anybody knows what may be happening i will be thankfull for him:)

thanks in advance


This post was edited on 09-16-2005 at 03:15 PM by zaher1988.
09-16-2005 12:42 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Sign up & SQL table problem - by zaher1988 on 09-16-2005 at 12:42 PM
RE: Sign up & SQL table problem - by WDZ on 09-16-2005 at 02:32 PM
RE: Sign up & SQL table problem - by zaher1988 on 09-16-2005 at 02:56 PM
RE: Sign up & SQL table problem - by J-Thread on 09-16-2005 at 06:27 PM
RE: Sign up & SQL table problem - by zaher1988 on 09-16-2005 at 07:10 PM
RE: Sign up & SQL table problem - by J-Thread on 09-16-2005 at 07:16 PM
RE: Sign up & SQL table problem - by J-Thread on 09-16-2005 at 07:17 PM
RE: Sign up & SQL table problem - by zaher1988 on 09-16-2005 at 07:25 PM
RE: Sign up & SQL table problem - by J-Thread on 09-17-2005 at 09:22 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On