Abb Hum user Wale Table Mein Attribute dekh skte ho.
Abb Hum aik 2 form bnaege aik user.php aur aik reg.php .User.php mein hum html ka code likhe ge aur reg mein sara php ki script .Toh chle start krte hai.
user.php page1
<form id="frm" class="form-group">
<div class="form-group">
<input type="text" name="name" id="fullname" class="form-control" placeholder="enter name">
</div>
<div class="form-group">
<input type="email" name="email" id="email" class="form-control" placeholder="enter email">
</div>
<div class="form-group">
<input type="password" name="password" id="password" class="form-control" placeholder="enter password">
</div>
<input type="button" name="submit" id="submit" class="btn btn-success" value="submit">
<div id="response">
</div>
</form>
Aur Abb Hum Php ke dusre page mein php insert ki script likhe ge
<?php
$conn=new mysqli("localhost","root","","mlk");
$name=$_POST["name"];
$email=$_POST["email"];
$password=$_POST["password"];
$ins="INSERT INTO user(name,email,password)VALUES('$name','$email','$password')";
$res=mysqli_query($conn,$ins);
if($res)
{
echo "Hello {$name} your records is saved.";
}
else
{
echo "Can't save form data.";
}
?>
Abb hum aap ko output dikhate te iski. baki aap isko design kr lena css ya boostrap mein acha sa .
Abb AAp niche data insert ka message v dekh skte ho .
Abb Jo data hum ne insert kiya tha wo database mein v aap dekh skte ho.
Isse hum hamari aaj ki script finish ho chuki hai aur hamra aaj ja topic . Thanks for read. Please share and comment now.
0 Comments
please enter your comment in message box