Jump to content

Need help checking my php coding


waelkd

Recommended Posts

so here's the thing, ive downloaded mysql front and easy php , the HTML code ive written till now is

 

<html>

<head>

</head>

<body>

<h1>Registration Page</h1>

<form name="form" method="post" action="final-SignUp1.php">

<p>UserName <input type="text" name="username" /></p>

<p>Password <input type="password" name="password" /></p>

<p>Confirm Password<input type="password" name="confirm_password" /></p>

<p>Firstname <input type="text" name="firstname" /></p>

<p>Middlename <input type="text" name="middlename" /></p>

<p>Lastname <input type="text" name="lastname" /></p>

<p>address <input type="text" name="address" /></p>

<p>city <input type="text" name="city" /></p>

<p>Zipcode <input type="text" name="zip_code" /></p>

<p>Phone number <input type="text" name="telephone_number" /></p>

<p>Email address <input type="text" name="email" /></p>

<p>Confirm Email <input type="text" name="confirm_email" /></p>

<input type="submit" value="Register">

<input type="reset" value="Clear" /></p>

</form>

</body>

</html>

 

 

 

which i would like to link to this php code

 

 

<?php

$usr=$_POST["username"];

$pass=$_POST["password"];

$confirm=$_POST["confirm_password"];

$firstname=$_POST["firstname"];

$middlename=$_POST["middlename"];

$lastname=$_POST["lastname"];

$address=$_POST["address"];

$city=$_POST["city"];

$zipcode=$_POST["zip_code"];

$phonenumber=$_POST["`telephone_number`"];

$emailaddress=$_POST["email"];

$confirmemailaddress=$_POST["confirm_email"];

$db=mysql_connect("localhost","root","");

mysql_select_db("final-signup1",$db);

$q="INSERT INTO final-signup1 VALUES

('$usr','$pass','$confirm','$firstname','$middlename','$lastname','$address','$city','$zipcode',

'$phonenumber','$emailaddress','$cofirmemailaddress')";

mysql_query($q);

mysql_close();

?>

 

now on mysql-front  the database ive set till now is as follows

 

DDB3N.jpg

 

 

i know something is wrong with my code, because the data i enter in the register page isnt going to the database.

 

any help is greatly appreciated

 

thank you

Link to comment
Share on other sites

I'm sure you must have an ID field preceding the 'username' field, but to be sure, could you edit this line:

mysql_query($q);

 

to mysql_query($q) or die(mysql_error());

 

and see what crops up :)

 

did it and still facing same problem , and now i got a new problem, every time i click on the register button, a save-as tab opens

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.