php中的CRUD操作...在edit.php中获取错误

I'm trying to execute CRUD operation using phpmyadmin
and when I select edit option after that i get error i tried but not getting it

i get following errors on edit operation

Notice: Undefined index: edit in C:\wamp\www\projects\edit.php on line 3

( ! ) Notice: Undefined variable: id in C:\wamp\www\projects\edit.php on line 23 Call Stack #TimeMemoryFunctionLocation 10.0010252672{main}( )..\edit.php:0 " method="post"> name=
password=
email=

Notice: Undefined index: edit_form in C:\wamp\www\projects\edit.php on line 39

-- Table structure for table `user`

Warning: Cannot modify header information - headers already sent by (output started at C:\wamp\www\projects\edit.php:26) in C:\wamp\www\projects\edit.php on line 46

CREATE TABLE IF NOT EXISTS `user` (
  `userid` varchar(50) NOT NULL,
  `name` varchar(50) NOT NULL,
  `email` varchar(100) NOT NULL,
  `pass` varchar(50) NOT NULL,
  `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `id` int(11) NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`id`),
  UNIQUE KEY `email` (`email`),
  UNIQUE KEY `email_2` (`email`),
  UNIQUE KEY `email_3` (`email`),
  UNIQUE KEY `userid` (`userid`),
  UNIQUE KEY `email_4` (`email`),
  KEY `id` (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=66 ;

--
-- Dumping data for table `user`
--

INSERT INTO `user` (`userid`, `name`, `email`, `pass`, `timestamp`, `id`) VALUES
('59e3950737b1f', 'ram', 'ram@gmail.com', 'rampwd', '2017-10-15 17:04:07', 59),
('59e3a5d94dfbd', 'gaurang', 'gnt3131@gmail.com', 'gaurangpwd', '2017-10-15 18:15:53', 64);


index.php

<html>
<head>
<title></title>

</head>

<body>
<center>
<h1> ADD USER</H1>
<form action="index.php" method="post">
name=<input type ="text" name="name"required/></br>
password=<input type ="text" name="pass" requierd /></br>
email=<input type ="text" name="email" required /></br></BR>
<input type ="submit" name="submit" VALUE ="INSERT"/></br>

</form>
</center>




<?php 
$connection=mysqli_connect('localhost','root','root','crud');


if(isset($_POST['submit'])){

    $name = $_POST['name'];
    $email = $_POST['email'];
    $pass = $_POST['pass'];
    $userid=uniqid();

if(mysqli_query($connection,"insert into user(userid,name,email,pass)values('$userid','$name','$email','$pass')"))
{
    echo"<H2>succesfully insert query</H2>";

}   
}
?>

<div align="center">
<table border="2" width="600">
<tr>
<th>USERID</th>
<th>NAME</th>
<th>EMAIL</th>
<th>PASSWORD</th>
<th>DATE CREATED </th>
<th>EDIT</th>
<th>DELETE</th>
</tr></div>
<?php
$connection=mysqli_connect('localhost','root','root','crud');

if(isset($_REQUEST['del'])){
    $del_id= $_REQUEST['del'];

if(mysqli_query($connection,"delete from user where id =$del_id"))
{
    echo"<h2>selected user of is deleted succesfully";
}





}
$run=mysqli_query($connection,"select * from user");



while($row=mysqli_fetch_array($run))
{

    $showuserid=$row[0];
    $showname=$row[1];
    $showemail=$row[2];
    $showpass=$row[3];
    $showdate=$row[4];
    $showid=$row[5];

    echo"<tr>
    <td>$showuserid</td>
    <td>$showname</td>
    <td>$showemail</td>
    <td>$showpass</td>
    <td>$showdate</td>
    <td><a href='edit.php?edit=$showid'>EDIT</td>
    <td><a href='?del=$showid'>DELETE</td>  
    </tr>
    ";
}




?>
</body>
</html>

-------------------------
edit.php

<?php
$connection=mysqli_connect('localhost','root','root','crud');
$edit=$_REQUEST['edit'];
$run=mysqli_query($connection,"select * from user where id = '$edit'");


while($row=mysqli_fetch_array($run))
{

    $name=$row[1];
    $email=$row[2];
    $pass=$row[3];
    $id=$row[5];
}
?>



<html>
<body>
<center>
<h1> EDIT USER</H1>
<form action="edit.php?edit_form =<?php echo $id ?>" method="post">
name=<input type ="text" name="uname" value="<?php echo $name ?>"/></br>
password=<input type ="text" name="upass" value="<?php echo $pass ?>"  /></br>
email=<input type ="text" name="uemail" value="<?php echo $email ?>" /></br> </BR>
<input type ="submit" name="uedit" VALUE ="Edit"/></br>

</form>
</center>
</body>
</html>

<?php
$connection=mysqli_connect('localhost','root','root','crud');

if(isset($_POST['uedit']))
{
    $uid= $_REQUEST['edit_form'];
    $uname= $_POST['uname'];
    $upass= $_POST['upass'];
    $uemail= $_POST['uemail'];

    if(mysqli_query($connection,"update user set name='$uname',email='$uemail',pass='$upass' where  id='$uid' "))
    {
                header("location:index.php");
    }
}


----

Check index.php in this line:

<td><a href='edit.php?edit=$showid'>EDIT</td>

It can be happening two things

First: - $showid is empty and when you click on edit button it sends an empty value.

Or Second: - In edit.php check this line:

$run=mysqli_query($connection,"select * from user where id = '$edit'");

Change it like this

$run=mysqli_query($connection,"select * from user where id = '".$_GET['edit']."'");

In your edit.php file change action="edit.php?edit_form =" to action="" and add input type="hidden" name="id" value="' . $id . '"; into your form like below...

<?php
$connection = mysqli_connect('localhost', 'root', 'root', 'crud');
$edit = $_REQUEST['edit'];
$run = mysqli_query($connection, "select * from user where id = '$edit'");

while ($row = mysqli_fetch_array($run)) {

    $name = $row[1];
    $email = $row[2];
    $pass = $row[3];
    $id = $row[5];
}
?>



  <html>
    <head>
        <title>EDIT USER</title>
    </head>
    <body>
        <center>
            <h1> EDIT USER</h1>
            <form action="" method="post">
                <?php echo '<input type="hidden" name="id" value="' . $id . '">'; ?>
                name=<input type ="text" name="uname" value="<?php echo $name ?>"/>
                password=<input type ="text" name="upass" value="<?php echo $pass ?>" />
                email=<input type ="text" name="uemail" value="<?php echo $email ?>"/>
                <input type ="submit" name="uedit" VALUE ="Edit"/>
            </form>
        </center>
    </body>
</html>

<?php
$connection = mysqli_connect('localhost', 'root', 'root', 'crud');
if (isset($_POST['uedit'])) {
    $uid = $_POST['id'];
    $uname = $_POST['uname'];
    $upass = $_POST['upass'];
    $uemail = $_POST['uemail'];

    if (mysqli_query($connection, "update user set name='$uname',email='$uemail',pass='$upass' where  id='$uid' ")) {
        header("location:index.php");
    }
}
?>