registration form in multiple pages store in mysql
am new in php i have a registration in three pages.if i click a last page submit the all va开发者_如何学JAVAlues should stored in db.how to do this
In order to store all the values in the database you will need to pass them along the pages, maybe as hidden post fields. For example if your first page has something like
<input type="text" name="name" />
Your second and third pages should have something like
<input type="hidden" name="name" value="<?php echo $_POST['name'];?>"/ >
assuming that your form types are set to post.
To insert into the database when the last submit button is pressed you will need the mysql_query or PDO::exec function.
You may also want to look at Pdo::prepare, PDOStatement::execute and mysql_real_escape_string to protect your site against SQL Injection attacks
You can either pass the variables along as hidden form fields (see @Belinda's answer) or store them in a session.
精彩评论