Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- $a=mysqli_connect("localhost","root","","members");
- if(isset($_POST['update'])){
- $username=$_POST['username'];
- $password=$_POST['password'];
- $query1="select id from users where name='$username'";
- $result=mysqli_query($a,$query1);
- $display=mysqli_fetch_assoc($result);
- $edit_record=display['id'];
- $query="select * from users where id='$edit_record'";
- $run=mysqli_query($a,$query);
- while ($row=mysqli_fetch_array($run))
- {
- $edit_id=$row['id'];
- $username= $row['name'];
- $password= $row['password'];
- }
- $query2="update users set password='$password' where id='$edit_id'";
- if(mysqli_query($a,$query2))
- {
- }
- }
- ?>
- <html>
- <head>
- <title>User's data</title>
- </head>
- <body>
- <form action="Edit.php>" method="POST">
- <h1> updating records</h1>
- <input type="text" name="username" id="username" value="Enter Username...">
- <input type="password" name="password" id="password" value="New Password"required>
- <input type="submit" id="update" name="update" value="updatenow">
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement