Hello everyone! I'm new here and I really need some helps regarding my php coding. I'm trying to do an Update page and the error keeps popping out "Undefined adminid". I've been trying to fix it but to no avail. Can you help me?

    //my database connection
      <?php
        $host = "localhost";
        $user = "root";
        $password = "";
        $db = "eat";
        $conn= mysqli_connect($host,$user,$password, $db);
        mysqli_select_db($conn, $db);
        session_start();
        ?>

   //my AdminSetting.php
    <?php
    include('dbconnection.php');

    $id=$_GET['aid'];
    $query = mysqli_query($conn,"select * from admin");
    $row = mysqli_fetch_assoc($query);
    ?>

     <fieldset class="account-box">
        <?php
            $status = "";
            if(isset($_POST['new']) && $_POST['new']==1)
            {
                $id=$_REQUEST['adminid'];
                $name =$_REQUEST['name'];
                $email =$_REQUEST['email'];
                $phone = $_REQUEST['phone'];
                $address = $_REQUEST['address'];
                $update="UPDATE admin SET admin_name = '$name', admin_phone = '$phone', admin_address = '$address', admin_email = '$email' where aid='".$id."'";
                mysqli_query($conn, $update) or die(mysqli_error());
                $status = "Record Updated Successfully. </br></br>
                <a href='view.php'>View Updated Record</a>";
                echo '<p style="color:#FF0000;">'.$status.'</p>';
            }
            else {
            ?>
             <form class="account-form" action="" method="POST" >
                <p>This is your private area. Please keep your information up to date.</p>
             <hr/>
                <div class="account-content">
                   <input type="hidden" name="new" value="1" />
                 <input type="hidden" name="adminid" value="<?php echo $row['aid'];?>"  />

                   <p><label>Name:</label> <input type="text" name="name" size="30" maxlength="30" value="<?php echo              $row['admin_name'];?>"   /></p>
                   <p><label>Email Address:</label> <input type="email" name="email" size="30" maxlength="30" value="<?php echo $row['admin_email'];?>"  /></p>
                   <p><label>Phone Number:</label> <input type="tel" name="phone" size="30" maxlength="30" value="<?php echo $row['admin_phone'];?>"  /></p>
                   <p><label>Address:</label> <textarea type="text" name="address" rows = "4" cols = "50" value="<?php echo $row['admin_address'];?>" ></textarea></p>
                 </div>
                 <div class="save-btn">
                 <p>
                     <input type="submit" name="submit" value="Update"/>
                   </p>
                  </div>
    </form>
   <?php } ?>
    </fieldset>

Line 26 is saying adminid should be padded in via a GET request (ie query string) but the page is being requested without ?adminid=x

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.