title: Editing via function call PHP
body: <p>I am wrapping functions in php pages in the functions.php and to access these pages, i put an action and a value in the url. I also have a function_calls.php which requests the action and its value and passes it to a switch case which calls the appropriate function. The problem i have is that i case i want to edit a field . I dont have an appropriate case(for the switch) which i want to look something like <code>admin.php?action=edit?id=some_id</code>.</p>
  
  <p>function_calls.php</p>
  
  <pre><code> &lt;?php
      require_once "functions.php";
  
  
      if (isset($_REQUEST['action'])) {
      $option = $_REQUEST['action'];
  
      echo $option;
  
      switch ($option) {
          case "complaints":
              complaint();
              break;
          case "users":
              users();
              break;
          case "officers":
              officers();
              break;
          case "register_officer":
              register_officer();
              break;
          case "register_student":
              register_student();
              break;
          case "add_event":
              add_event();
              break;
  
          default:
              complaint();
              break;
      }
  } else {
      echo '&lt;div class="jumbotron"&gt;
    &lt;h1&gt;Welcome To The Administration Panel &lt;/h1&gt;
    &lt;p&gt;You can manage accounts and view the complaints here.&lt;/p&gt;
  
  &lt;/div&gt;';
  }
  </code></pre>
  
  <p>functions.php</p>
  
  <pre><code>&lt;?php
  
  include_once "include/db_connect.php";
  
  function register_student()
  {
      ?&gt;
  
      &lt;section&gt;
          &lt;div class="row"&gt;
              &lt;div class="col-md-7 col-md-offset-1"&gt;
                  &lt;form class="" method="post" action=""&gt;
                      &lt;div class="row"&gt;
                          &lt;div class="col-md-6 "&gt;
                              &lt;div class="input-group margin-bottom-20"&gt;
                                  &lt;span class="input-group-addon"&gt;&lt;i class="fa fa-user"&gt;&lt;/i&gt;&lt;/span&gt;
                                  &lt;input type="text" placeholder="Firstname" name="firstname" required=""
                                         class="form-control"&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                          &lt;div class="col-md-6"&gt;
                              &lt;div class="input-group margin-bottom-20"&gt;
                                  &lt;span class="input-group-addon"&gt;&lt;i class="fa fa-user"&gt;&lt;/i&gt;&lt;/span&gt;
                                  &lt;input type="text" placeholder="Lastname" name="lasttname" required=""
                                         class="form-control"&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div class="input-group margin-bottom-20"&gt;
                          &lt;span class="input-group-addon"&gt;&lt;i class="fa fa-envelope"&gt;&lt;/i&gt;&lt;/span&gt;
                          &lt;input type="text" placeholder="Email" name="email" required="" class="form-control"&gt;
                      &lt;/div&gt;
  
                      &lt;div class="input-group margin-bottom-20"&gt;
                          &lt;span class="input-group-addon"&gt;&lt;i class="fa fa-user"&gt;&lt;/i&gt;&lt;/span&gt;
                          &lt;input type="text" placeholder="Registration Number" name="reg_no" required=""
                                 class="form-control"&gt;
                      &lt;/div&gt;
                      &lt;div class="input-group margin-bottom-20"&gt;
                          &lt;span class="input-group-addon"&gt;&lt;i class="fa fa-phone"&gt;&lt;/i&gt;&lt;/span&gt;
                          &lt;input type="text" placeholder="Phone" name="phone" required="" class="form-control"&gt;
                      &lt;/div&gt;
                      &lt;div class="input-group margin-bottom-20"&gt;
                          &lt;span class="input-group-addon"&gt;&lt;i class="fa fa-lock"&gt;&lt;/i&gt;&lt;/span&gt;
                          &lt;input type="password" placeholder="Password" name="password" required="" class="form-control"&gt;
                      &lt;/div&gt;
                      &lt;div class="input-group margin-bottom-20"&gt;
                          &lt;span class="input-group-addon"&gt;&lt;i class="fa fa-lock"&gt;&lt;/i&gt;&lt;/span&gt;
                          &lt;input type="password" placeholder="Confirm Password" name="conf_password" required=""
                                 class="form-control"&gt;
                      &lt;/div&gt;
  
                      &lt;div class="row"&gt;
                          &lt;!--&lt;div class="col-md-6 checkbox"&gt;
                              &lt;label&gt;&lt;input type="checkbox"&gt;Remember me&lt;/label&gt;
                          &lt;/div&gt;--&gt;
                          &lt;div class="col-md-12"&gt;
                              &lt;button class="btn btn-success btn-block pull-right" type="submit" name="register"&gt;Register
                                  Student
                              &lt;/button&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/form&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/section&gt;
  
  &lt;?php
  
  }
  
  function register_officer()
  {
      ?&gt;
      &lt;section&gt;
          &lt;div class="row"&gt;
              &lt;div class="col-md-7 col-md-offset-1"&gt;
                  &lt;form class="" method="post" action="register.php"&gt;
                      &lt;div class="row"&gt;
                          &lt;div class="col-md-6 "&gt;
                              &lt;div class="input-group margin-bottom-20"&gt;
                                  &lt;span class="input-group-addon"&gt;&lt;i class="fa fa-user"&gt;&lt;/i&gt;&lt;/span&gt;
                                  &lt;input type="text" placeholder="Firstname" name="firstname" required=""
                                         class="form-control"&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                          &lt;div class="col-md-6"&gt;
                              &lt;div class="input-group margin-bottom-20"&gt;
                                  &lt;span class="input-group-addon"&gt;&lt;i class="fa fa-user"&gt;&lt;/i&gt;&lt;/span&gt;
                                  &lt;input type="text" placeholder="Lastname" name="lastname" required=""
                                         class="form-control"&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div class="input-group margin-bottom-20"&gt;
                          &lt;span class="input-group-addon"&gt;&lt;i class="fa fa-envelope"&gt;&lt;/i&gt;&lt;/span&gt;
                          &lt;input type="text" placeholder="Email" name="email" required="" class="form-control"&gt;
                      &lt;/div&gt;
  
                      &lt;div class="input-group margin-bottom-20"&gt;
                          &lt;span class="input-group-addon"&gt;&lt;i class="fa fa-user"&gt;&lt;/i&gt;&lt;/span&gt;
                          &lt;input type="text" placeholder="Rank" name="rank" required="" class="form-control"&gt;
                      &lt;/div&gt;
                      &lt;div class="input-group margin-bottom-20"&gt;
                          &lt;span class="input-group-addon"&gt;&lt;i class="fa fa-phone"&gt;&lt;/i&gt;&lt;/span&gt;
                          &lt;input type="text" placeholder="Phone" name="phone" required="" class="form-control"&gt;
                      &lt;/div&gt;
                      &lt;div class="input-group margin-bottom-20"&gt;
                          &lt;span class="input-group-addon"&gt;&lt;i class="fa fa-lock"&gt;&lt;/i&gt;&lt;/span&gt;
                          &lt;input type="password" placeholder="Password" name="password" required="" class="form-control"&gt;
                      &lt;/div&gt;
                      &lt;div class="input-group margin-bottom-20"&gt;
                          &lt;span class="input-group-addon"&gt;&lt;i class="fa fa-lock"&gt;&lt;/i&gt;&lt;/span&gt;
                          &lt;input type="password" placeholder="Confirm Password" name="conf_password" required=""
                                 class="form-control"&gt;
                      &lt;/div&gt;
  
                      &lt;div class="row"&gt;
                          &lt;!--&lt;div class="col-md-6 checkbox"&gt;
                              &lt;label&gt;&lt;input type="checkbox"&gt;Remember me&lt;/label&gt;
                          &lt;/div&gt;--&gt;
                          &lt;div class="col-md-12"&gt;
                              &lt;button class="btn btn-success btn-block pull-right" type="submit" name="register_officer"&gt;
                                  Register Officer
                              &lt;/button&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/form&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/section&gt;
  &lt;?php
  }
  </code></pre>