Ajax %-wildcard URL giving 404 error when setting a parameter
If the form is part of a standard Drupal form, you can use Drupal's built in AJAX system. There is a detailed explanation here: Ajax Forms in Drupal 7. Basically it should look like this.

function hook_some_form($form, &amp;$form_state) {
  // Create a frop down
  $form['some_select'] = array(
    '#type' =&gt; 'select',
    '#options' =&gt; $options,
    '#default_value' =&gt; $default,
    '#ajax' =&gt; array(
      'callback' =&gt; 'some_ajax_callback', // This is the php function to be called
      'wrapper' =&gt; 'some_wrapper', // The javascript #id to put content in.
      'method' =&gt; 'replace', // Content placement option
    ),
  );

  // Result contents container
  $form['some_wrapper'] = array(
    '#type' =&gt; 'item',
    '#id' =&gt; 'some_wrapper',
    '#tree' =&gt; TRUE,
  );
}


And for the PHP callback

function some_ajax_callback($form, $form_state) {
  // Fetch the value AJAX gave us.
  $value = $form_state['values']['some_select'];

  // Recreate the wrapper as we overwrite the old one.
  $form['some_wrapper'] = array(
    '#type' =&gt; 'item',
    '#id' =&gt; 'some_wrapper',
    '#tree' =&gt; TRUE,
  );

  // Append the value of the drop down to it.
  $form['some_wrapper']['value'] = array(
    '#type' =&gt; 'item',
    '#markup' =&gt; check_plain($value);
  );
  // Return everything to Javascript.
  return $form['some_wrapper']
}


This allows you to pass form values to PHP for processing.