title: Send string to php gd through ajax request
body: <p>I try to create a captcha code image with php gd :</p>
  
  <pre><code>$im = imagecreatetruecolor(100, 25);
  $white = imagecolorallocate($im, 255, 255, 255);
  $black = imagecolorallocate($im, 0, 0, 0);
  imagefilledrectangle($im, 0, 0, 399, 29, $white);
  $imgstring=$_GET['captcha'];
  $font = 'RAVIE.TTF';
  imagettftext($im, 15, 0, 10, 20, $black, $font, $imgstring);
  header('Content-Type: image/png');
  imagepng($im);
  imagedestroy($im);
  </code></pre>
  
  <p>The GET value is send with ajax like this:</p>
  
  <pre><code>var randstring;
  function Captcha() {
      randstring = Math.round((Math.pow(36, length + 1) - Math.random() * Math.pow(36, 5))).toString(36).slice(1);
  
              $.ajax({
                  url: 'test_image.php',
                  data: {'captcha' : randstring},
                  method: 'GET',
                  success: function (data){
                      console.log(data);
                  },
                  error: function (){
                      alert('Error');
                      return false;
                  }   
  
              });
          }
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;img src="test_image.php"&gt;
  </code></pre>
  
  <p>Though it gives no errors , the image is not generated . Yes, the request reach the php script , i already checked , but something blocks image from being generated...</p>
  
  <p><strong>UPDATE</strong> Actually the image is generated, and also the ajax request is sent. But on the test_image.php script , $_GET['captcha'] ( the request ) is not recognized so it will just output a blank string in that image , though the image is there , but without a string .</p>