Click here to Skip to main content
15,891,529 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
dear all user i m getting error while distributing team member from data base

PHP
if(isset($_POST['searchuser']))
{
     $depart=$_POST['searchdepart'];
     $desig=$_POST['searchdesig'];
    $select=mysql_query("SELECT * FROM admin_login WHERE depart='$depart' and designation='$desig' ");
     $numb=mysql_num_rows($select);
        while($row=mysql_fetch_array($select))
                {

$id=$row['UId'];
$data=$row['loginid'];
$email=$row['email'];
$depart=$row['depart'];
$designation=$row['designation'];


?>


this is ajax code which im using

C#
<script>
function showDesig(str) {
    if (str.length == 0) {
        document.getElementById("txtHint").innerHTML = "";
        return;
    } else {
        var xmlhttp = new XMLHttpRequest();
        xmlhttp.onreadystatechange = function() {
            if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
                document.getElementById("txtHint").innerHTML = xmlhttp.responseText;
            }
        }
        xmlhttp.open("GET", "../assign_team.php?asgwrk=" + str, true);
        xmlhttp.send();
    }
}

function isNumber(evt) {
    evt = (evt) ? evt : window.event;
    var charCode = (evt.which) ? evt.which : evt.keyCode;
    if (charCode > 31 && (charCode < 48 || charCode > 57)) {
        return false;
    }
    return true;
}
</script>




assignteam.php

XML
<?php
include("includes/connection.php");
$id=$_GET['asgwrk'];
if($id=='TechSales')
{?>
  <select name="searchdesig" id="searchdesig" style="height:19px;float:left;width:40%;height:25px;margin-left:10px;">
                        <option value="0">Choose Designation</option>
                      <option value="supervisor">supervisor</option>
                        <option value="agent">agent</option>

                    </select>
<?php  }

else if($id=='customer_service')
{
?>
 <select name="searchdesig" id="searchdesig" style="height:19px;float:left;width:40%;height:25px;margin-left:10px;">
                        <option value="0">Choose Designation</option>
                        <option value="supervisor">supervisor</option>
                        <option value="agent">agent</option>

                    </select>
<?php
}
else if($id=='TechSupport')
{
?>

<select name="searchdesig" id="searchdesig" style="height:19px;float:left;width:40%;height:25px;margin-left:10px;">
                        <option value="0">Choose Designation</option>
                       <option value="supervisor">supervisor</option>
                        <option value="agent">agent</option>
                    </select>

<?php
}
?>


getting error :

Notice: Undefined index: searchdesig in C:\xampp\htdocs\admin_panel\Admin\teamdistribution.php on line 42
Posted
Comments
ZurdoDev 29-Jan-15 20:16pm    
Which line of code is line 42?
Rohit85 30-Jan-15 10:11am    
yes
$desig=$_POST['searchdesig'];
Undefined index: searchdesig in C:\xampp\htdocs\admin_panel\Admin\teamdistribution.php on line 42

they are not getting ajax value which is passed from asignteam.php in searchdesig

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900