title: how to create a registration form with different user role?
body: <p>Aside from creating username and password.</p>
  
  <p>I added this form for selecting user privilege.</p>
  
  <p>-Administrator
  -Event Facilitator
  -Attendance Checker</p>
  
  <p>Each has a different role.</p>
  
  <p>How can i insert PHP code to assign privileges to each role of the user to access certain data and table.</p>
  
  <pre><code>&lt;div class="login-fields"&gt;
      &lt;p&gt;Select user privilege:&lt;/p&gt;
      &lt;div class="form-group"&gt;
          &lt;label&gt;User Privilege:&lt;/label&gt;
          &lt;select id="priv" name="user_pr" maxlength="50" onchange='checkvalue(this.value)'&gt;
              &lt;option hidden disabled selected&gt;Select User Role&lt;/option&gt;
              &lt;optgroup label="User Privilege"&gt;
                  &lt;option value="admin"&gt;Administrator&lt;/option&gt;
                  &lt;option value="facilitator"&gt;Facilitator&lt;/option&gt;
                  &lt;option value="checker"&gt;Checker&lt;/option&gt;
              &lt;/optgroup&gt;
          &lt;/select&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>another things is, I inserted another field if the Facilitator option has been selected. This field will let the administrator assign the Facilitator to a certain event to be managed by providing him/her an EventID from the database.</p>
  
  <pre><code>&lt;div class="login-fields" id="eventid" style='display:none'&gt;
    &lt;p&gt;Assign an Event:&lt;/p&gt;
    &lt;div class="form-group"&gt;
      &lt;input type="text" class="form-control" placeholder="Enter Event ID"&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>javascript for accessing the EventID field.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      function checkvalue(val)  {
        if(val==="facilitator")
          document.getElementById('eventid').style.display='block';
        else
          document.getElementById('eventid').style.display='none';
      }
  
  &lt;/script&gt;
  </code></pre>