title: pass value from jqgrid to php and dispaly the data based on the value passed
body: <p>i have the below two php files and i trying to pass the value from the selected option to the base php file and display the information based on the passed file.</p>
  
  <p><strong>fkm_test.php</strong></p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8″ /&gt;
  &lt;meta http-equiv="X-UA-Compatible" content="IE=edge" /&gt;
  &lt;title&gt;APP FKMS&lt;/title&gt;
  
  &lt;link rel="stylesheet" type="text/css" media="screen" href="../js/jquery-ui-1.10.3.custom_blackGreen/jquery-ui-1.10.3.custom/css/trontastic/jquery-ui-1.10.3.custom.min.css" /&gt;
  &lt;link rel="stylesheet" type="text/css" media="screen" href="../js/jquery.jqGrid-4.5.2/css/ui.jqgrid.css" /&gt;
  
  
  &lt;script src="../js/jquery-ui-1.10.0.custom/jquery-1.9.0.min.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="../js/jquery.jqGrid-4.5.2/js/i18n/grid.locale-en.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="../js/jquery.jqGrid-4.5.2/js/jquery.jqGrid.min.js" type="text/javascript"&gt;&lt;/script&gt;
  
  &lt;script type="text/javascript"&gt;
  function fkm(Application) {
  var app = document.getElementById("myApp").selectedIndex;
  var app_selected = document.getElementsByTagName("option")[app].value;
  alert (app_selected);
  //alert(document.getElementsByTagName("option")[app].value);
  var lastSel
  $("#list").jqGrid({
  
      url: "fkm_display.php?app=$app_selected",
      editurl: "fkmedit.php",
      datatype: "json",
      mtype: "GET",
      colNames: ["App", "Pattern Type", "Pattern", "Rank", "AMRS", "EMEA", "APAC", "Audit", "ID", "Alert Type", "Comments"],
      colModel: [
          { name: "division", width: 75 , editable: true},
          { name: "pattern_type", width: 90, editable: true, edittype:"select",formatter:'select', editoptions:{value:"BASIC:BASIC;REGEXP:REGEXP;REGEXP_IGNORE_CASE:REGEXP_IGNORE_CASE" } },
          { name: "pattern", width: 650, editable: true },
          { name: "rank", width: 50 },
          { name: "amrs_active", width: 40, editable: true, edittype:"select",formatter:'select', editoptions:{value:"1:Active;0: " } },
          { name: "emea_active", width: 40, editable: true, edittype:"select",formatter:'select', editoptions:{value:"1:Active;0: " } },
          { name: "apac_active", width: 40, editable: true, edittype:"select",formatter:'select', editoptions:{value:"1:Active;0: " } },
          { name: "audit", width: 200},
          { name: "id", width: 10, hidden: true},
          { name: "type", width: 20, editable: true, edittype:"select", sorttype:"text",formatter:'select', editoptions:{value:"IGNORE:IGNORE;ALERT:ALERT;WARN:WARN" } },
          { name: "comments", width: 10, editable: true,hidden: true}
      ],
      height: 'auto',
      pager: "#pager",
      rowNum: 90,
      rowList: [10, 20, 30, 60, 90],
      sortname: "rank",
      sortorder: "asc",
      viewrecords: false,
      gridview: true,
      autoencode: true,
      toppager: true,
      grouping:true,
      groupingView : {
              groupField : ['type'],
              groupColumnShow : [true],
              groupText : ['&lt;b&gt;{0} - {1} Item(s)&lt;/b&gt;']
      },
      caption: "Application FKMs"
  });
  jQuery("#list").jqGrid('filterToolbar', { stringResult: true, searchOnEnter: false, defaultSearch: 'cn', ignoreCase: true});
  jQuery("#list").jqGrid('navGrid','#pager',{"add":true,"del":true, "edit":true,"search":false,"refresh":true,"view":false, "cloneToTop":true});
  };
  &lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form id="phpform" name="phpform" method="POST" action="javascript:fkm();"&gt;
  &lt;select name="Application" id="myApp" &gt;
  &lt;option selected="selected"&gt;–Select Application–&lt;/option&gt;
  &lt;?php
  include ('app_dbconfig.php');
  $sql = "SELECT * FROM applications order by Application asc";
  $result = mysql_query($sql) or die("SQL Error 1: " . mysql_error());
  
  while($row=mysql_fetch_assoc($result))
  {
  echo '&lt;option value="' . $row['Application'] . '"&gt;' . $row['Application'] . '&lt;/option&gt;';
  }
  ?&gt;
  &lt;/select&gt;
  &lt;input type="submit" name="testing" value="Submit" &gt;
  &lt;/form&gt;
  &lt;div align="center"&gt;
  &lt;table id="list"&gt;&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;
  &lt;div id="pager"&gt;&lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>fkm_display.php</strong></p>
  
  <pre><code>&lt;?php 
  include("fkm_dbconfig.php");
  
  $page = $_GET['page'];
  $limit = $_GET['rows']; 
  $sidx = $_GET['sidx']; 
  $sord = $_GET['sord']; 
  
  $app = $_GET['app_selected'];
  
  
  if(!$sidx) $sidx =1; 
  $result = mysql_query("SELECT COUNT(*) AS count FROM global_itrs_fkms");
  $row = mysql_fetch_array($result,MYSQL_ASSOC);
  $count = $row['count'];
  $total_pages=0;
  if( $count &gt;0 ) {
      $total_pages = ceil($count/$limit);
  } else {
      $total_pages = 0;
  }
  if ($page &gt; $total_pages) $page=$total_pages;
  $start = $limit*$page - $limit; 
  
  $filterResultsJSON = json_decode($_REQUEST['filters']);
  
  
  if($filterResultsJSON){
  $filterArray = get_object_vars($filterResultsJSON);
  
  
  $filterResultsJSON = json_decode($_REQUEST['filters']);
  
  $filterArray = get_object_vars($filterResultsJSON);}
  $SQL = "select division,pattern_type,pattern,rank,amrs_active,emea_active,apac_active,concat(audit,' ', timestamp) as audit,id,type from global_itrs_fkms";
  
  
  $counter = 0;
  while($counter &lt; count($filterArray['rules']))
  {
  $filterRules = get_object_vars($filterArray['rules'][$counter]);
  
  if($counter == 0){
  $SQL .= ' WHERE ' . division = '$app' . $filterRules['field'] . ' LIKE "%' . $filterRules['data'] . '%"';
  }
  
  else {
  $SQL .= ' AND ' . $filterRules['field'] . ' LIKE "%' . $filterRules['data'] . '%"';
  }
  $counter++;
  }
  
  $SQL .= " order by $sidx $sord LIMIT $start, $limit";
  echo $SQL;
  
  $result = mysql_query( $SQL ) or die("Couldn t execute query.".mysql_error());
  
  $responce['total'] = $total_pages;
  $responce['page'] = $page;
  $responce['records'] = $count;
  $i=0;
  while($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
  $responce['rows'][$i]['id']=$row[id];
  $responce['rows'][$i]['cell']=array($row[division],$row[pattern_type],$row[pattern],$row[rank],$row[amrs_active],$row[emea_active],$row[apac_active],$row[audit],$row[id],$row[type]);
  $i++;
  }        
  echo json_encode($responce);
  </code></pre>
  
  <p>If i change the url: "fkm_display.php?app=$app_selected" to <strong>url: "fkm_display.php"</strong> and when i click on submit am getting the enitre db information, which i don't want. I need only the information related to the application selected.</p>