php mysqli
Php is a language used for server side web development. Basically it is the language used for the web development and the most popular scripting language on the web.
Tuesday 5 July 2016
Insert part of Update form
Insert part of Update form
<html>
<body>
<?php
$con=mysqli_connect('localhost','root','','deepak');
$id=$_GET['id'];
echo $id;
$sql1="SELECT * FROM login where id='$id'";
$sql11=mysqli_query($con,$sql1);
//echo $sql11;
$profile=mysqli_fetch_assoc($sql11);
$name=$profile['Name'];
$password=$profile['Password'];
?>
<div class="display">
<form action="update.php?id=<?php echo $id; ?>" method="POST">
<p>
name :
<input type="text" name="name" placeholder="name"
value="<?php echo $name; ?>" />
</p>
<p>
password :
<input type="password" name="password" placeholder="password"
value="<?php echo $password; ?>" />
</p>
<p>
<input type="submit" name="login" value="login">
</p>
</form>
</div>
</body>
</html>
Monday 4 July 2016
Delete command for Php login form
Delete command for Php login form
<?php
$con=mysqli_connect('localhost','root','','deepak');
$de=$_GET['id'];
$del="delete from login where id='$de'";
mysqli_query($con,$del);
header('location:show.php');
?>
Show command for Php login form
Show command for Php login form
<table border=4>
<tr>
<td> id </td>
<td> name </td>
<td> password </td>
<td> delete </td>
</tr>
<?php
$con=mysqli_connect('localhost','root','','deepak');
$sel="select*from login";
$run=mysqli_query($con,$sel);
while($row=mysqli_fetch_assoc($run))
{
$id=$row['id'];
$n=$row['Name'];
$p=$row['Password'];
?>
<tr>
<td> <?php echo "$id"; ?> </td>
<td> <?php echo "$n"; ?> </td>
<td> <?php echo "$p"; ?> </td>
<td> <a href="delete.php?id=<?php echo $id; ?>"> delete</a></td>
</tr>
<?php
}
?>
Insert command for the login page
Insert command for the login page
<?php
$con=mysqli_connect('localhost','root','','deepak');
$n=$_POST['Name'];
$p=$_POST['Password'];
echo "$n";
echo "<br>";
echo "$p";
$in="insert into login(name,password)values('$n','$p')";
mysqli_query($con,$in);
?>
Tuesday 28 June 2016
Create a login form
Create a login form
Coding for login form
<html>
<title> coding for login form </title>
<body>
<form method="POST" action="insert.php">
Name :
<input type="text" name="Name" placeholder="enter your name">
<br>
Password :
<input type="password" name="Password" placeholder="enter the password">
<br>
<input type="submit" name="login" value="login">
</form>
</body>
</html>
Subscribe to:
Posts (Atom)