How do you create a 3 page registration form using php?
-
i have created a basic registration form with a submit button but i need to spread it accross 3 pages and be able to go back and fourth between forms can anyone help me this is my form which needs splitting accross the pages <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-... <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <link href="/Assignment2/Scripts/regform.css" rel="stylesheet" type="text/css" /> <!--This is the form layout plus names and values --> <div class="register"> <form method="post" action="regprocess.php"/> <table width="300" border="0"> <tr> <td>username:</td> <td><input type="text" name="username"/></td> </tr> <tr> <td>Email:</td> <td><input type="email" name="email"/></td> </tr> <tr> <td>First Name:</td> <td><input type="text" name="fname"/></td> </tr> <tr> <td>Last Name:</td> <td><input type="text" name="lname"/></td> </tr> <tr> <td>Title:</td> <td><input type="text" name="title"/></td> </tr> <tr> <td>Address line 1:</td> <td><input type="text" name="address1"/></td> </tr> <tr> <td>Address line 2:</td> <td><input type="text" name="address2"/></td> </tr> <tr> <td>Retype email:</td> <td><input type="text" name="cemail"/></td> </tr> <tr> <td>Post Code:</td> <td><input type="text" name="postcode"/></td> </tr> <tr> <td>City:</td> <td><input type="text" name="city"/></td> </tr> <tr> <td>Home Phone:</td> <td><input type="text" name="hphone"/></td> </tr> <tr> <td>Mobile Phone:</td> <td><input type="text" name="mphone"/></td> </tr> <tr> <td>Password:</td> <td><input type="password" name="password" /></td> </tr> <tr> <td> </td> <td><input type="submit" name="submit" value="submit" /></td> </tr> </table> </form> </div> </body> </html> this is the php iv used so far <?php session_start(); include"configfile.php"; $title = mysql_real_escape_string($_POST['title']... $fname = mysql_real_escape_string($_POST['fname']... $lname = mysql_real_escape_string($_POST['lname']... $address1 = mysql_real_escape_string($_POST['address... $address2 = mysql_real_escape_string($_POST['address... $postcode = mysql_real_escape_string($_POST['postcod... $city = mysql_real_escape_string($_POST['city'])... $email = mysql_real_escape_string($_POST['email']... $cemail = mysql_real_escape_string($_POST['cemail'... $hphone = mysql_real_escape_string($_POST['hphone'... $mphone = mysql_real_escape_string($_POST['mphone'... $username = mysql_real_escape_string($_POST['usernam... $password = md5($_POST ['password']); $insert = 'INSERT into users(title, fname, lname, address1, address2, postcode, city, email, cemail, hphone, mphone, username, password) VALUES ("'.$title.'","'.$fname.'","'.$lname.'",... mysql_query($insert); $_SESSION['name'] = $username; header('Location: index.php'); thanks in advance to anyone who helps
-
Answer:
u can store data in session variables each time the form is submitted or processthe info as it is submitted. Both have different benefits. for ex, you can store email id to contact later, if u process as soon as form is submitted , if u store in session variables the data will be processed later making just one database call rather than 3 making your form faster. to print the value in the input field use something like: <input type='text' name='title' value='hi' /> to print hi in the field when the page is loaded. Although be careful while printing password in the password field for security reasons
TechBoy101 at Yahoo! Answers Visit the source
Other answers
u can store data in session variables each time the form is submitted or processthe info as it is submitted. Both have different benefits. for ex, you can store email id to contact later, if u process as soon as form is submitted , if u store in session variables the data will be processed later making just one database call rather than 3 making your form faster. to print the value in the input field use something like: <input type='text' name='title' value='hi' /> to print hi in the field when the page is loaded. Although be careful while printing password in the password field for security reasons
Abhishek
Related Q & A:
- How can you create a different page in Wordpress?Best solution by WordPress
- How do I create a landing page for my website?Best solution by Yahoo! Answers
- How do you create a music page on Myspace?Best solution by Yahoo! Answers
- How do I create a Wikipedia page?Best solution by Yahoo! Answers
- How do you create a fan page on facebook?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.