Hello Friends,

I got a problem
iam working on a module called employers in that the company people can only give the username and we have to place the possiblity that employer cant able to modify the username and emailid
can anyone please help me.


9 Years
Discussion Span
Last Post by quibbie

if you are using text box.
then textbox has a property callled disabled
e.g: <input type="text" name="email id="emailid disabled="disabled"> now we cant edit this textbox.

i hope it works..


So, only certain users should be able to modify this data?

Then you simply need to figure out who should be able to modify it, check if the current user is a part of that group, and display the controls if he is.

This example assumes that:

  • You have loaded the user's name and role name (e.g. "Employee") into the session.
  • You want only members that have the role "Admin" to be able to edit user info.
 * Function to check if the current client
 * can edit member info
function canMemberEditUsers() {
  if(isset($_SESSION['User'])) {
    if($_SESSION['User']['Role'] == "Admin") {
      return true;
  return false;
 *File: updateMemberInfo.php
 *  The file used to update the member info.
if(canMemberEditUsers()) {
  $uUsername = trim($_POST['username']);
  $uPassword = trim($_POST['passwd']);

  // Do whatever you need to do to update the data
else {
  echo "This is a restriced zone. You do not have permisssion to be here.";
 * File: updateForm.php
 * The form used to get the new member info.
  if(!canMemberEditUsers()) {
    die("This is a restricted zone. You do not have permission to be here.");
  // Assuming the Id of the member that is to be edited was passed inthe URL
  $memberID = $_GET['memberID'];
  if(!is_numeric($memberID) || $memberID <= 0) {
    die("Invalid member ID was passed");

  // Not knowing how you get  your member data, I just invented this function.
  // You would replace it with whatever you use.
  $oldName = getMemberName($memberID);

  echo <<< HTML
  <head><title>Update member info</title></head>
     <form action="updateMemberInfo.php" method="post">
       User: <input type="text" name="username" value="{$oldName}" /><br />
       Pass: <input type="password" name="passwd" /><br />
       <input type="submit" value="update" />

Hope this helps.


I hope I understood your question. It sounds to me like you do not want people to be able to change account information in a program. Please let us know the name of the program/applicaton.

In most cases you need to edit the "User Permissions" and resrtict access to spacific fucntions. In most Admin or Control Panels you should have User Settings or Group Settings. Dissable the fields you do not want the employees changing or being able to access.

Again please let us know the program or software you are using and the current version, someone might be able to assist you further.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.