提供信息的PHP注册问题

时间:2015-07-15 23:49:08

标签: php mysql

我正在使用推荐计划网站,我有问题..

注册时有两种类型。 申请人员工

当您注册作为 员工 时,在成功注册后,会有一个按钮,当您点击它时,它会显示您在注册期间提供的个人信息。 信息是:

Referrer ID
Fullname
Current Position
Contact ID
Email Address
Mobile Number
Member Since

当您选择注册为员工时,如果您已经拥有您的员工编号,一旦您点击成功注册按钮,之后会有一个页面,您可以看到您的信息。 。 像这样..让我们说

Referrer ID: 12345678
Fullname: SHerlock Holmes
Current Position: Programmer
Contact ID: 11001100
Email Address: sherlockholmes@yahoo.com
Mobile Number: 73763-3838
Member Since: 2015-05-07 08:00:20

当我们将注册称为员工时。我没有问题.. 但

当您注册作为申请人时,我将推荐人ID 设置为 0 ,因为申请人没有员工号码.. 但在成功注册为申请人之后,会有一个按钮,例如员工,当您点击它时,它会显示您在注册时提供的个人信息。我有这个问题,因为如果你注册为申请人.. 这些是他们显示的以下信息..

Referrer ID: 0
Fullname: Null/No value.. (Consider I provide Sherlock Holmes as name)
Current Position: No value yet
Contact ID: 11001100
Email Address: sherlockholmes@yahoo.com
Mobile Number: 73763-3838
Member Since: Null/No value..(Consider I provide 2015-05-07 08:00:20 as time of membership)

问题是,当我注册为申请人时,全名会员变为空或没有价值的原因..虽然,我是预计这将有价值..

我希望我的问题很明确,以便您能够理解..我愿意向您展示我的注册代码以及注册后显示信息的页面。

这是注册 ..

的代码
  <!DOCTYPE html>
<?php
 include('config.php');
 session_start();

?>

<html>

<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">


</head>

<body>

<form method = "post">
    <table class = "orpRegs" style="padding-top:30px;">
    <tbody>

    <tr>
        <td colspan =2>
            <label align="center" style = "border-left:20px;"><h5>Not Yet a     Member?</h5></label>
        </td>
    </tr>

    <tr>
        <td>
            <label>First Name</label>
            <select name ="ddlGender">
        <option value = "NA"></option>  
        <option value = "M">Mr.</option>
        <option value = "F">Ms.</option>
        </select>
        </td>

        <td align ="left">
             <input type="text" name="txtFirstName" value="<?php if(isset($_POST['txtFirstName'])){echo $_POST['txtFirstName'];}?>"  
            required = "true">
        </td>

    </tr>

    <tr>
        <td>
            <label>Middle Name</label>
        </td>

        <td align = "left">
        <input type="text" name="txtMiddleName" value="<?php if(isset($_POST['txtMiddleName'])){echo $_POST['txtMiddleName'];}?>" >
        </td>

    </tr>

    <tr>
        <td>
            <label>Last name</label>
        </td>

        <td align ="left">
        <input type="text" name="txtLastName" value="<?php if(isset($_POST['txtLastName'])){echo $_POST['txtLastName'];}?>" 
            required="true">
        </td>

    </tr>

    <tr>
        <td>
            <label>Suffix</label>
        </td>

        <td align = "left">
        <input type="text" name="txtSuffix" value="<?php if(isset($_POST['txtSuffix'])){echo $_POST['txtSuffix'];}?>">
        </td>

    </tr>

    <tr>
        <td>
            <label>Email Address</label>
        </td>

        <td align = "left">
        <input type="text" name="txtEmail" value="<?php if(isset($_POST['txtEmail'])){echo $_POST['txtEmail'];}?>" 
            required = "true">
        </td>

    </tr>

    <tr>
        <td>
        <label>Cellphone Number</label>
        </td>

        <td align = "left">
        <input type="text" name="txtCellNum" value="<?php if(isset($_POST['txtCellNum'])){echo $_POST['txtCellNum'];}?>" 
            required="true" >
        </td>

    </tr>

    <tr>
        <td>
            <label>Birthdate</label>
        </td>

        <td align = "left">
        <input type="date" name="txtBirthdate" value="" required="true">
        </td>

    </tr>

    <tr>
        <td>

        </td>


        <script type="text/javascript">

        function showTextBox() 
        {
                if (document.getElementById('employeeCheck').checked) 
                {
                    document.getElementById('employeeid').style.visibility = 'visible';
                    document.getElementById('employeeidtext').style.visibility = 'visible';
                } 
                else 
                {
                    document.getElementById('employeeid').style.visibility = 'hidden';
                    document.getElementById('employeeidtext').style.visibility = 'hidden';
                }
                if (document.getElementById('applicantCheck').checked)
                {
                    document.getElementById('employeeid').style.visibility = 'hidden';
                    document.getElementById('employeeidtext').style.visibility = 'hidden';
                }
        }
        </script>

        <td align = "left">
            <input type="radio" name="position" value="Employee" onClick="showTextBox()" required="true" id ="employeeCheck"><label>Employee</label>
            <input type="radio" name="position" value="Applicant" onClick="showTextBox()" required="true" id ="applicantCheck"><label>Applicant</label>
        </td>
    </tr>

    <tr>
        <td>
            <label style="visibility:hidden" id ="employeeidtext">Employee ID</label>
        </td>

        <td align = "left">
        <input type="text" name="txtEmployeeId" value="<?php if(isset($_POST['txtEmployeeId'])){echo $_POST['txtEmployeeId'];}?>"               style="visibility:hidden;width:220px;" id ="employeeid" >
        </td>

    </tr>

    <tr>
        <td colspan="3" style="text-align: center;">
        <input type="checkbox" required="true"><label>Yes, I agree with our <a href ="http://mainpage.com/Terms/" style="text-decoration:none;" id ="terms" target="_blank">Terms and Conditions</a></label>
        </td>
    </tr>

    <tr>
        <td colspan="3" style="text-align: center;">
            <input type="image" src="../images/sign_up.png" id ="btnSignUp" value="SIGN ME UP" name ="register" style="border-style:none;">
        </td>
    </tr>

    </tbody>
</table>
</form>

 </body>

 </html>

 <?php  

  if(isset($_POST['register']))
    {
       $EmployeeID = $_POST['txtEmployeeId'];
      $Gender =     $_POST['ddlGender'];
        $FirstName =  $_POST['txtFirstName'];
      $MiddleName = $_POST['txtMiddleName'];
       $LastName =   $_POST['txtLastName'];
      $Suffix =     $_POST['txtSuffix'];
       $CellNum =    $_POST['txtCellNum'];
      $Email =      $_POST['txtEmail'];
      $Birthdate =  $_POST['txtBirthdate'];
      $position =   $_POST['position'];
      $isOk = 1;

           if(empty($FirstName))
          {
           // Empty
                $isOk = 0;
                        echo '<span style="color:#FF0000;text-align:center;font-   size:x-small;">First name is empty!<br></span>';

       }

      if(empty($LastName))
      {
       // Empty
        $isOk = 0;
        $lnameisEmpty = 1;
        echo '<span style="color:#FF0000;text-align:center;font-size:x-small;">Last name is empty!<br></span>';
      }

     if(empty($CellNum))
       {
       // Empty
        $isOk = 0;
        echo '<span style="color:#FF0000;text-align:center;font-size:x-small;">Mobile number is empty!<br></span>';
      }

      if(empty($Email))
      {
       // Empty
        $isOk = 0;
     echo '<span style="color:#FF0000;text-align:center;font-size:x-small;">Email is empty!<br></span>';
      }

       if(empty($Birthdate))
      {
   // Empty
    $isOk = 0;
    echo '<span style="color:#FF0000;text-align:center;font-size:x-small;">Birthdate is empty!<br></span>';
  }
  //Validations for letters and spaces
  //preg_match('/^[a-zA-Z\s]+$/', $string);
        if($isOk == 1)
        {
         if(!preg_match('/^[a-zA-Z\s-]+$/', $FirstName)) 
         {
            // Error
            $isOk = 0;
            echo '<span style="color:#FF0000;text-align:center;font-size:x-small;">First name is invalid!<br></span>';
         } 

        else 
         {
            // Continue
         }

         if(!preg_match('/^[a-zA-Z\s-]+$/', $LastName)) 
         {
            // Error
            $isOk = 0;
            echo '<span style="color:#FF0000;text-align:center;font-size:x-small;">Last name is invalid!<br></span>';

         } 

        else 
        {
            //Continue

        }

        if(!empty($Middlename))
        {
         if(!preg_match('/^[a-zA-Z\s-]+$/', $MiddleName))
         {
            // Error
            $isOk = 0;
            echo '<span style="color:#FF0000;text-align:center;font-size:x-small;">Middle name is invalid!<br></span>';
         }
        }
        $startOfemail = substr($Email,0,1);
    $pattern = "/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/";
    if(!preg_match($pattern,$Email))
    {
        // Error email not valid.
        $isOk = 0;
        echo '<span style="color:#FF0000;text-align:center;font-size:x-small;">Email is invalid!<br></span>';
    }

    else
    {
        if(!ctype_alpha($startOfemail))
        {
        // Error email should start with letter.
        $isOk = 0;
        echo '<span style="color:#FF0000;text-align:center;font-size:x-small;">Email should start with a letter!<br></span>';
        }

        else
        {
        // Continue                                     
        }                           
    }   

        if(!ctype_digit($CellNum)) 
        {
            // Error
            $isOk = 0;
            echo '<span style="color:#FF0000;text-align:center;font-size:x-small;">Mobile number is invalid!<br></span>';
        }

         else 
        {
            //Continue
        }

        if(!empty($Suffix))
        {
            if(!preg_match('/^[a-zA-Z\s]+$/', $Suffix)) 
            {
                // Error
                $isOk = 0;
                echo '<span style="color:#FF0000;text-align:center;font-size:x-small;">Suffix is invalid!<br></span>';
            }
            }

        if($position =="Employee")
            {
                if(empty($EmployeeID))
                {
                    // Empty
                    $isOk = 0;
                    echo '<span style="color:#FF0000;text-align:center;font-size:x-small;">Employee ID is empty!<br></span>';
                }
                elseif (!ctype_digit($EmployeeID)) 
                {
                    // Error only numbers are accepted
                    $isOk = 0;
                    echo '<span style="color:#FF0000;text-align:center;font-size:x-small;">Employee ID is invalid!<br></span>';
                }
                else
                {
                    // Continue
                }
            }

            if($isOk == 1)
            {

                 if($position =="Employee")
                {   

                        if($isOk == 1)
                         {

                             $query = "SELECT * FROM vtiger_contactscf WHERE cf_739 = '$EmployeeID'";
                         $result = mysql_query($query) or die (mysql_error());
                        if(mysql_num_rows($result)>0)
                         {
                             echo '<span style="color:#FF0000;text-align:center;font-size:small;">You are Currently Registered in the Sytem. Please log in using your Login details.<br></span>';
                        }
                        else
                        {
                                 insertNew($EmployeeID,$Gender,$FirstName,$MiddleName,$LastName,$Suffix,$CellNum,$Email,$Birthdate,0);
                        }
                        }
                }

                else
                {
                      $EmployeeID = "0";
                            insertNew($EmployeeID,$Gender,$FirstName,$MiddleName,$LastName,$Suffix,$CellNum,$Email,$Birthdate,1);
                }
            }
               }


    }


    function insertNew($empID, $gender,$fName, $mName, $lName, $suffix, $cellNum, $email, $birthDate, $pos)
    {
       $fName = ucwords($fName);
       preg_replace('/( )+/', ' ', $fName);
       $mName = ucfirst($mName);
        $lName = ucfirst($lName);
      $date = date('Y-m-d H:i:s');
     if($gender == "M")
     {
         $salutation = "Mr";
     }
     else
    {
         $salutation = "Ms";
     }
     if($pos ==1)
     {
         $empID = "0";
     }

     $query = "SELECT 
             vtiger_contactdetails.firstname, 
               vtiger_contactdetails.lastname, 
              vtiger_contactsubdetails.birthday
           FROM vtiger_contactdetails
           INNER JOIN vtiger_contactsubdetails ON 
        vtiger_contactdetails.contactid=vtiger_contactsubdetails.contactsubscriptionid
           INNER JOIN vtiger_contactscf ON vtiger_contactscf.contactid = vtiger_contactdetails.contactid
           WHERE vtiger_contactdetails.firstname = '$fName'
           AND vtiger_contactdetails.lastname = '$lName'
           AND vtiger_contactsubdetails.birthday = '$birthDate'";

     $result = mysql_query($query) or die (mysql_error());
      if(mysql_num_rows($result) > 0)
      {
          echo '<span style="color:#FF0000;text-align:center;font-size:medium;">Account already exists!<br></span>';
       }

      else
     {
    //Get Value of contactid
    $query = "SELECT MAX(crmid) from vtiger_crmentity";

$result = mysql_query($query) or die (mysql_error());

if($result)
    {
        if(mysql_num_rows($result) > 0) 
        $myRows =  mysql_num_rows($result); 
        {
            $row = mysql_fetch_array($result);
            $contactid = $row[0];
            $newcontactid = $contactid + 1;
            $newcontact_no = "CON"."$newcontactid";

            //Start Inserting Records

            // Insert Data to vtiger_crmentity(parent)
            $insertRec = "INSERT INTO vtiger_crmentity (crmid,  
            smcreatorid,
            smownerid,
            modifiedby,  
            setype,
            createdtime,
            modifiedtime,
            version,
            deleted,
            label) 

            VALUES ('$newcontactid',
            1,
            1,
            1,
            'Contacts',
            '$date',
            '$date',
            0,
            0,
            'Online Referral')";

            $result = mysql_query($insertRec) or die (mysql_error());

            if (mysql_affected_rows() > 0) {
                $insertRec = null;
                $result = null;

            // Insert Data to Vtiger_contactdetails  
            $insertRec = "INSERT INTO vtiger_contactdetails (contactid, 
                contact_no, 
                accountid,
                salutation,
                firstname, 
                lastname, 
                mobile, 
                email, 
                emailoptout, 
                notify_owner, 
                isconvertedfromlead)
            VALUES ($newcontactid,
                '$newcontact_no', 
                0,
                '$salutation',   
                '$fName', 
                '$lName', 
                '$cellNum', 
                '$email', 
                0, 
                0, 
                0)";

            $result = mysql_query($insertRec) or die (mysql_error());



            if (mysql_affected_rows() > 0) {
                $insertRec = null;
                $result = null;

                //Insert Data to vtiger_contactaddress
                $insertRec = "INSERT INTO vtiger_contactaddress (contactaddressid, 
                    mailingcountry)
                VALUES ($newcontactid, 
                    'Philippines') ";

                $result = mysql_query($insertRec);

                if (mysql_affected_rows() > 0) {
                    $insertRec = null;
                    $result = null;

                    //Insert Data to vtiger_contactsubdetails
                    $insertRec = "INSERT INTO vtiger_contactsubdetails (contactsubscriptionid, 
                        birthday, 
                        leadsource, 
                        laststayintouchrequest, 
                        laststayintouchsavedate)
                    VALUES ($newcontactid, 
                        '$birthDate', 
                        'TRM', 
                        0, 
                        0) ";

                    $result = mysql_query($insertRec);

                    if (mysql_affected_rows() > 0) {
                        $insertRec = null;
                        $result = null;

                        //Insert Data to vtiger_contactscf
                        $insertRec ="INSERT INTO vtiger_contactscf (contactid,
                            cf_739,
                            cf_709,
                            cf_703,
                            cf_705,
                            cf_1069)
                        VALUES ($newcontactid,
                            '$empID',
                            '$gender',
                            '$mName',
                            '$suffix',
                            0.0)";

                        $result = mysql_query($insertRec);

                        if (mysql_affected_rows() > 0) {
                            $_SESSION['SESS_EMP_ID'] = $empID; 
                            $_SESSION['SESS_CONID'] = $newcontactid;
                            $_SESSION['SESS_FIRSTNAME'] = $fName;
                            $_SESSION['SESS_LASTNAME'] = $lName;
                            $_SESSION['SESS_CONTACT_NO'] = $newcontact_no;
                            $_SESSION['SESS_MOBILE'] = $cellNum;
                            $_SESSION['SESS_EMAIL'] = $email;
                            $_SESSION['SESS_BDAY'] = $birthDate;

                            //Email registrant of his or her account details(firstname, lastname, birthdate)
                                   mailRegistration($empID,$fName,$lName,$birthDate,$email);
                                 //Direct to Welcome Page for New Registrants

                                echo ("<SCRIPT LANGUAGE='JavaScript'>            
                                window.location.href='/successReg.php';
                                    </SCRIPT>");

                            }
                         }              
                     }
                }
                }
            }
        }
            else 
            {
            echo "Something went wrong!";
            }
        }


    }

?>

以下是个人信息 ..

的代码
<?php
/**** Start Session ****/
include_once '../function/auth_emp.php';
/**** End ****/

/**** Redirects automatically to index ****/
header("Refresh: 15 * 60; url=index.php");
/**** End ****/

/**** authentication ****/
//require_once('../function/auth_emp.php');
/**** End ****/

$empid = $_SESSION['SESS_EMP_ID'];
$bdate = $_SESSION['SESS_BDAY'];



/**** Database connection ****/
require_once('../include/config.php');
/**** End ****/


include'../GlobalConstants.php';

include_once ('../refer/updateInfo.php');

mysql_select_db($db_name, $con) or die("ERR_COULD_NOT_SEE_DB");
if($empid == 0)
{
$fname = $_SESSION['SESS_EMP_FNAME'];
$lname = $_SESSION['SESS_EMP_LNAME'];
$bdate = $_SESSION['SESS_BDAY'];

$qry= "SELECT vtiger_contactdetails.firstname,
          vtiger_contactdetails.contact_no, 
          vtiger_contactscf.cf_703,
          vtiger_contactscf.cf_715, 
          vtiger_contactscf.cf_717,
          vtiger_contactdetails.email,
          vtiger_contactdetails.lastname, 
          vtiger_contactdetails.mobile,
          vtiger_contactdetails.contactid,
          vtiger_crmentity.createdtime
       FROM vtiger_contactdetails 
       INNER JOIN vtiger_contactscf 
       ON vtiger_contactdetails.contactid = vtiger_contactscf.contactid
       INNER JOIN vtiger_crmentity
       ON vtiger_contactdetails.contactid = vtiger_crmentity.crmid
       INNER JOIN vtiger_contactsubdetails
       ON vtiger_contactsubdetails.contactsubscriptionid= vtiger_contactdetails.contactid
       WHERE vtiger_contactdetails.firstname = '".$fname."'
       AND vtiger_contactdetails.lastname =  '".$lname."'
       AND vtiger_contactsubdetails.birthday = '".$bdate."'";   

$result = mysql_query($qry);
}
else
{
$qry= "SELECT vtiger_contactdetails.firstname,
          vtiger_contactdetails.contact_no, 
          vtiger_contactscf.cf_703,
          vtiger_contactscf.cf_715, 
          vtiger_contactscf.cf_717,
          vtiger_contactdetails.email,
          vtiger_contactdetails.lastname, 
          vtiger_contactdetails.mobile,
          vtiger_contactdetails.contactid,
          vtiger_crmentity.createdtime
       FROM vtiger_contactdetails 
       INNER JOIN vtiger_contactscf 
       ON vtiger_contactdetails.contactid = vtiger_contactscf.contactid
       INNER JOIN vtiger_crmentity
       ON vtiger_contactdetails.contactid = vtiger_crmentity.crmid
       WHERE vtiger_contactscf.cf_739 = '".$empid."'";

$result = mysql_query($qry);
}
if($result)
{
    if(mysql_num_rows($result)> 0)
    {
        $row = mysql_fetch_assoc($result);
        $contact_no = $row['contact_no'];
        $fname = $row['firstname'];
        $mname = $row['cf_703'];
        $lname = $row['lastname'];
        $mobile = $row['mobile'];
        $pos = $row['cf_715'];
        $program = $row['cf_717'];
        $email = $row['email'];
        $conid = $row['contactid'];
        $memberdate = $row['createdtime'];

    }
}

$erp = "ERP";
/**** Stores the firstname and lastname in the session ****/
$_SESSION['SESS_EMP_ID'] = $empid;
$_SESSION['SESS_CONID'] = $conid;
$_SESSION['SESS_FIRSTNAME'] = $fname;
$_SESSION['SESS_MIDDLENAME'] = $mname;
$_SESSION['SESS_LASTNAME'] = $lname;
$_SESSION['SESS_MOBILE'] = $mobile;
$_SESSION['SESS_EMAIL'] = $email;
$_SESSION['SESS_POSITION'] = $pos;
$_SESSION['SESS_GEN'] =$erp;
$_SESSION['login_time'] = time();
 ?>



 <!DOCTYPE html>
 <html lang="en">
<head>

    <meta charset="utf-8">
    </head>
    <body>
        <!-- Referrer Personal Information -->
            <center>
            <div class="twelve columns">
                <br>
                <hr class="between" width="70%">
                <form name="updatein"  method="post">
                        <div class="referrerinformation"> 
                            <div class="referrerinfohere">
                                    <div class="firsttdr">
                                    <h4 class="ua">User Agreement</h4>
 <p align="justify">You agree to provide true, accurate, and complete information on all registration and other 
 forms you 
 access on the Site or any data sent to us related in updating your information to maintain its truthfulness, 
 accuracy,
 and completeness. You must not provide misleading information about your location and the information of the 
 one you 
 are referring. You must not register for more than one Referrer’s Account without written permission from us. 
 Solely 
 for purposes of the foregoing sentence, ’You’ means you, any member of your immediate family, and any entity
 directly 
 or indirectly controlled by you or by any member of your immediate family.</p>
                                    </div>

                        <div class="secondtdr">
                                    <h4 class="ua">Referrer Personal Information</h4>
 <div class="referrerid">
     <p align="left">Referrer ID</p>
     <input type="number" name="label:Referrer_Emp_ID" readOnly="true" value="<?php echo $empid; ?>">
                                            </div>


 <div class="fnamep">
   <p align="left">Fullname</p>
   <input type="text" name="cont" value="<?php echo $fname." ".$mname." ".$lname; ?>" readOnly="true">
 </div>

 <div class="position">
   <p align="left">Current Position</p>
   <input type="text" name="cont" value="<?php echo $pos; ?>" readOnly="true">
 </div>


 <div class="contactid">
   <p align="left">Contact ID</p>
   <input type="number" name="cont" value="<?php echo $conid; ?>" readOnly="true">
 </div>


 <div class="emailad">
   <p align="left">Email Address:</p>
   <input type="email" name="cont" value="<?php echo $email; ?>" readOnly="true">
 </div>


 <div class="mobilenum">
   <p align="left">Mobile Number:</p>
   <input type="number" name="cont" value=<?php echo $mobile; ?> readOnly="true">
 </div>


 <div class="membersc">
   <p align="left">Member Since</p>
   <input type="text" name="cont" value="<?php echo $memberdate; ?>" readOnly="true">
 </div>

                                            <div class="container">
 <center><a id="modal_trigger" href="#modal" class="btn">Edit Personal Information</a></center>
                                            <div id="modal" class="popupContainer" style="display:none;">

                                            <!--head-->
                            <header class="popupHeader">
             <span class="header_title">Referrer Personal Information</span>
                <span class="modal_close"><i class="fa fa-times"></i></span>
 </header>

                                                <!--section-->
                                                <section class="popupBody">
         <div class="table">

          <!-- Social Login -->
             <p align="left"><strong>EDIT INFORMATION HERE</strong></p><br>

 <div class="tabletoedit">


 <form action="<?php echo htmlspecialchars($_SERVER[PHP_SELF]);?>" method="post"> 
 <br>
 <div class="empnum">
 <p align="left">Employee Number</p><br>
 <input type="number" name="txt_EmpID" required="true" value="<?php echo $empid; ?>"
 <?php
                                        if($empid != 0)
                                        {
                                         echo "readonly";
                                        }
                                        ?>
                                        >
                    </div>

 <div class="fnamep">
                    <p align="left">Fullname</p>
                    <input type="text" name="cont" value="<?php echo $fname." ".$mname." ".$lname; ?>" 
                    readOnly="true">
 </div>

 <div class="position">
 <p align="left"> Current Position</p>
 <input type ="text" name ="txt_CurrentPos" value="<?php echo $pos; ?>" required>
 </div>


 <div class="contactid">
 <p align="left">Contact ID</p>
 <input type="number" name="cont" value="<?php echo $conid; ?>" readOnly="true">
 </div>


 <div class="emailad">
 <p align="left">Email Address</p>
 <input type="email" name ="txt_Email" value ="<?php echo $email; ?>"  pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,3}$" title="youremail@domain.com" required>
 </div>


 <div class="mobilenum">
 <p align="left">Mobile Number</p>
 <input type ="number" name ="txt_Mobile" value="<?php echo $mobile; ?>" required>
 </div>

 <div class="action_btns">

    <input class="btn" type="submit" name="submit1" value="update"
    style="width:237px;margin-top:0%;">  


  </div>
  </form>

                </div> <!-- table to edit end-->

            </div> <!-- table div end-->

            <div class="updatereminder">
 <p align="justify">
                <strong>UPDATING INFORMATION</strong><br><br>
 You can only edit/change/update the following information:<br>
             Employee Number (if none)
             Email Address
             Mobile Number
             Current Position<br><br>
 In the event that the Employee number was mistakenly submitted during registration, kindly send us an 
 email 
 stating your Full Name and your correct employee number using our online contact form within this 
 website.   
 Please inform us immediately.
 <br>
                    <br>
 Updating your personal information is covered by the User Agreement and the Terms and Conditions in 
 using the 
 Convergys Online Referral Program. Sanction/s shall be imposed to users who deliberately provide false 
 information.
                </p>
        </div>
                                                </section>
                                        </div> <!-- referrerinfohere div end here-->
                                    </div> <!-- referrerinfomration div end here-->
                             </form> <!-- FORM updatein end here-->

                             <script type="text/javascript">
                                        $("#modal_trigger").leanModal({top : 200, overlay : 0.6, closeButton: ".modal_close" });

                                        $(function(){
                                          // Calling Login Form
                                          $("#login_form").click(function(){
 $(".social_login").hide();
 $(".user_login").show();
 return false;
                                          });

                                          // Calling Register Form
                                          $("#register_form").click(function(){
 $(".social_login").hide();
 $(".user_register").show();
 $(".header_title").text('Register');
 return false;
});

 // Going back to Social Forms
 $(".back_btn").click(function(){
 $(".user_login").hide();
 $(".user_register").hide();
 $(".social_login").show();
 $(".header_title").text('Login');
 return false;
 });

 })
</script>
</div> <!-- twelve column div ends here-->
</body>
</html>

1 个答案:

答案 0 :(得分:0)

错误是您从未在注册页面中定义$_SESSION['SESS_EMP_FNAME']$_SESSION['SESS_EMP_LNAME']

personnal page

中的错误
if($empid == 0)
{
$fname = $_SESSION['SESS_EMP_FNAME']; // --> NOT DEFINE IN REGISTRATION
$lname = $_SESSION['SESS_EMP_LNAME']; // --> NOT DEFINE IN REGISTRATION
$bdate = $_SESSION['SESS_BDAY'];

$qry= "SELECT vtiger_contactdetails.firstname,
          vtiger_contactdetails.contact_no, 
          vtiger_contactscf.cf_703,
          vtiger_contactscf.cf_715, 
          vtiger_contactscf.cf_717,
          vtiger_contactdetails.email,
          vtiger_contactdetails.lastname, 
          vtiger_contactdetails.mobile,
          vtiger_contactdetails.contactid,
          vtiger_crmentity.createdtime
       FROM vtiger_contactdetails 
       INNER JOIN vtiger_contactscf 
       ON vtiger_contactdetails.contactid = vtiger_contactscf.contactid
       INNER JOIN vtiger_crmentity
       ON vtiger_contactdetails.contactid = vtiger_crmentity.crmid
       INNER JOIN vtiger_contactsubdetails
       ON vtiger_contactsubdetails.contactsubscriptionid= vtiger_contactdetails.contactid
       WHERE vtiger_contactdetails.firstname = '".$fname."'
       AND vtiger_contactdetails.lastname =  '".$lname."'
       AND vtiger_contactsubdetails.birthday = '".$bdate."'";   

$result = mysql_query($qry);
}

<强>解决方案

personnal page中只需替换此

$fname = $_SESSION['SESS_EMP_FNAME'];
$lname = $_SESSION['SESS_EMP_LNAME']; 

通过这个

$fname = $_SESSION['SESS_FIRSTNAME'];
$lname = $_SESSION['SESS_LASTNAME']; 

希望它会有所帮助。