Jump to content

INVISIBLE POSTING!!!


Pavlos1316

Recommended Posts

Here is my code:

 

//Connect to database

mysql_connect ($dbhost, $dbuser, $dbpass)or die("Error: " .mysql_error());

mysql_select_db($dbname) or die(mysql_error());

$Full_Name=$_Post['Full_Name'];

$Birthday=$_Post['Birthday'];

$Phone_No=$_Post['Phone_No'];

$E_mail=$_Post['E_mail'];$

Mail=$_Post['Mail'];

$Username=$_Post['Username'];

$Password=$_Post['Password'];

 

$checkuser=mysql_query("SELECT Username FROM Register WHERE Username='$Username'");

$Username_exist=mysql_num_rows($checkuser);

if($Username_exist>0){

echo "Username Already Registered!";

unset($Username);

include 'register.html';

exit();

}

 

$query="INSERT INTO Register (ID, Full_Name, Birthday, Phone_No, E_mail, Mail, Username, Password) VALUES ('NULL','$Full_Name','$Birthday','$Phone_No','$E_m ail','$Mail_Adrdress','$Username','$Password')";

 

mysql_query($query) or die(mysql_error());mysql_close();

echo "Registration Successful!";

 

OK here is the problem.

 

When I test my registration form for 1st time I get: Registration successful. But in mysql db (throught control panel) I have only blank fields exept for ID field.

 

Then when I try my form for second or third time and so on I always get: Username allready registered!!!!!

 

Have you anything to suggest? Where is the problem?

 

Thank you

Link to comment
Share on other sites

just looking through your code there several errors i can see,

 

biggest being you have deffined :

$Mail = $_POST['Mail'];

 

But in your insert code you have :

 

$Mail_Addresses,

 

So change either one and it should work.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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

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

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.