Select is empty when I pass to PHP

Select is empty when I pass to PHP

Hi,

I am using below code to read the value from SELECT and pass it to PHP then get back the response. It's working perfectly when I change  $request_category = $_GET['cboRequest'] to  $request_category = 2 so the problem is at the value passing level

Can you help please?

  1. $( "#cboRequest" ).change(function() {
  2. $.ajax({
  3. type: 'GET',
  4. url: "get_request_processing_period.php",
  5. // dataType: "json",
  6. data: $(this).find('option:selected').val(),
  7. success: function(response)
  8. {
  9. alert(response);
  10. // data = response;
  11. // return response;
  12. },
  13. error: function(jq,status,message)
  14. {
  15. alert('A jQuery error has occurred. Status: ' + status + ' - Message: ' + message);
  16. }
  17. });
  18. });


and this my PHP:

  1. <?php
  2.     include('./includes/php_header.php');
  3. include($_SESSION["bluefile_absolute_path"] . '/includes/session_expiry.php');
  4.     include($_SESSION["bluefile_absolute_path"] . '/includes/connect2db.php');
  5.     include($_SESSION["bluefile_absolute_path"] . '/PHPMailer/class.phpmailer.php');

  6. $session_expiry->check_for_session_expiry();
  7. $request_category = $_GET['cboRequest'];
  8. // $request_category = 2;
  9. $mysql_query = $mysql_connection->prepare('CALL get_request_processing_period(:param_request_category)');
  10. $mysql_query->bindParam(':param_request_category', $request_category, PDO::PARAM_STR);
  11. $mysql_query->execute();
  12. while($mysql_row = $mysql_query->fetch())
  13. {
  14. $processing_days = $mysql_row["processing_period_in_days"];
  15. }

  16. echo $processing_days;
  17. return $processing_days;
  18.     // include($_SESSION["bluefile_absolute_path"] . '/includes/php_footer.php');
  19. ?>