Welcome! Log In Create A New Profile

Advanced

Registration page not submitting

Posted by 44538456 Candice 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
Registration page not submitting
October 14, 2012 06:18PM
Hi

Please help, my registration page is not submitting. Keeps coming back to the same registration form.

Language: PHP
<body> <div align="center"> | <a href="index.php">Index<a/> | <a href="register.php">Register<a/> | <a href="login.php">Login<a/> | <a href="insert.php">Insert<a/> | <a href="list.php">List<a/> | </div>   <h2>   <div align="center">Property Agents Registrations</div> <div align="center"> <form action="register.php" method="post"> <table> <tr><td colspan="2"><hr></td></tr> <tr><td>Title:</td><td><select name="title" id "Title" size="1" ><option>Mr</option> <option>Mrs</option><option>Miss</option></select></td></tr> <tr><td>Name:</td><td><input type="text" name="name" id="name" size="30" /></td></tr> <tr><td>Surname:</td><td><input type="text" name="surname" id="surname" size="30" /></td></tr> <tr><td>Agency:</td><td><input type="text" name="agency" id="agency" size="30" /></td></tr> <tr><td>Username:</td><td><input type="text" name="username" id="username" size="30" /></td></tr> <tr><td>Password: </td><td><input type="text" name="password" id="password" size="30" /></td></tr> <tr><td>Confirm Password:</td><td><input type="text" name="Confirm Password" id="confPassword" size="30" /></td></tr> <tr><td colspan="2"><hr></td></tr> <tr><td align="center" colspan="2"><input type="submit"value="Register" id="submit" /><input type="reset" value="Clear"</td><td></tr> <tr><td colspan="2"><hr></td></tr> </table> </form> </div>   <?php include("connect.php"); // connect to database   $Submit=$_POST["submit"]; $Title=$_POST["title"]; $Name=$_POST["name"]; $Surname=$_POST["Surname"]; $Agency=$_POST["agency"]; $Username=$_POST["username"]; $Password1=$_POST["password"]; $Password2=$_POST["confPassword"];     if($Submit=="Yes"){ // if submit button is clicked   $Check=mysql_query("SELECT * FROM prop_agents WHERE username=';$Username';");// check for existing username   $Rows=mysql_num_rows($Check);       if($Rows>0){   header("Location: index.php?msg=The username $Username already exists!"); // back to index   } else{ if($Password1==$Password2){ //testing passwords     $Insert=("INSERT INTO 535132, prop_agents (user_id, title, name, surname, agency, username, password)VALUES(';';, ';$Title';, ';$Name';, ';$Surname';, ';$Agency';, ';$Username';, ';$Password';)");// save to database   $Result=mysql_query($Insert,$Connect) or die(mysql_error());   header("Location: login.php?msg=Registration Sucessful"); // goes to login page   } else{ echo "passwords doesnt match"; }   }   }   ?>
Re: Registration page not submitting
October 15, 2012 02:01PM
Try echo the header eg
echo header("Location: login.php"winking smiley;
Re: Registration page not submitting
October 15, 2012 09:15PM
Hi

Thanks Mduduzi. Still the data does not submit. Still brings me back to the same page with the data cleared. No error msg.
It seems to me as though the "if" loops are not functioning.

Please help
Re: Registration page not submitting
October 16, 2012 09:37PM
Hi Candice,

At
Language: PHP
$Insert=("INSERT INTO 535132, prop_agents (user_id, title, name,

I Asume 535132 is your DB, then you are already connected to DB with your CONNECT Statement.

So take out the DB name and c if that helps, the user_id is auto increment so dont INSERT it...also take out the ( infront of INSERT & at the end of statement
Language: PHP
$Insert="INSERT INTO prop_agents (title, name,...

Hope this helps
Re: Registration page not submitting
October 18, 2012 09:22AM
@Candice you did not give your submit button a name. It suppose to be
Language: HTML
<input type="submit"value="Register" id="submit" name="Yes" />
so data when you call the button with this statement
Language: PHP
if($Submit=="Yes")
it submit the form
avatar
Mac
Re: Registration page not submitting
October 18, 2012 10:01AM
No, other way round. name = Submit and value = yes.
Sorry, only registered users may post in this forum.

Click here to login