Judul : how to create Multistep registration Form in PHP
link : how to create Multistep registration Form in PHP
how to create Multistep registration Form in PHP
(1) Create database ajax & then create table record:
SQL>
create table record
(id int primary key auto_increment,
name varchar(200),
contact varchar(200),
email varchar(200),
address varchar(200),
subject varchar(200),
message varchar(2000));
(2)create page1.php file:
<form action="page2.php" method="post">
name <input type="text" name="name">
Contact <input type="text" name="contact">
<input type=submit name=submit value="next">
</form>
(3)create page2.php file:
<?php
session_start();
foreach($_POST as $key=>$value)
{
$_SESSION['omsir'][$key]=$value;
}
?>
<form action="page3.php" method="post">
email <input type="text" name="email">
Address <input type="text" name="address">
<input type=submit name=submit value="next">
</form>
(4)write code for page3.php file:
<?php
session_start();
foreach($_POST as $key=>$value)
{
$_SESSION['omsir'][$key]=$value;
}
?>
<form action="page4.php" method="post">
subject <input type="text" name="subject">
message<input type="text" name="message">
<input type=submit name=submit value="submit">
</form>
(5)write code for page4.php file:
<?php
session_start();
foreach($_POST as $key=>$value)
{
$_SESSION['omsir'][$key]=$value;
}
extract($_SESSION['omsir']);
echo $name;
echo$contact;
echo$email;
echo$address;
echo$subject;
echo $message;
$con=mysql_connect("Localhost","root","");
mysql_select_db("ajax",$con);
$sql="insert into record(name,contact,email,address,subject,message)
values('$name','$contact','$email','$address','$subject','$message')";
$result=mysql_query($sql);
if($result)
{
echo "record inserted";
}
else
{
echo "record not inserted";
}
?>
Demikianlah Artikel how to create Multistep registration Form in PHP
Sekianlah artikel how to create Multistep registration Form in PHP kali ini, mudah-mudahan bisa memberi manfaat untuk anda semua. baiklah, sampai jumpa di postingan artikel lainnya.
Anda sekarang membaca artikel how to create Multistep registration Form in PHP dengan alamat link https://othereffect.blogspot.com/2017/02/how-to-create-multistep-registration.html
0 Response to "how to create Multistep registration Form in PHP"
Post a Comment