image create problem in verification (ajax)

image create problem in verification (ajax)

i am trying to create image from random number . i can move random number to resim.php.

  1.                             $.ajax({
                                    type        :"POST",
                                    url            :"font/resim.php",
                                    dataType    :"html",
                                    data        :{num: numRand},                                   
                                    success        : function (data){
                                                    $("#son").html("<img src="+ data +" />");
                                                },
                                    error        : function (data, textStatus){
                                                    $("#son").html(data);
                                    }                       
                                });











when i callback alue as image it is problem like following

resim.php

  1. ######################## PHP hata raporlalama #############################
    error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);

    //Outurum baþlýyor
    session_start();

    //rastgele içeriði oturuma (SESSION) yaz
    $_SESSION["rip"] = $_POST["num"];

    ################### Resmi çiz ##########################################
    header("Content-type: image/png");
        $image        = imagecreatetruecolor(75, 18) or die("GD Library hatasi"); //resim boyutu  
        $fcolor     = imagecolorallocate($image, 255, 255, 255);    //Yazý rengi  
        $bcolor     = imagecolorallocate($image, 99, 99, 99); //arkaplan rengi
    imagefilledrectangle($image, 0, 0, 300, 100, $bcolor); //resmin arkaplaný
    imagettftext($image, 12, 0, 10, 14, $fcolor, "arial.ttf",$_SESSION["rip"]);
    imagepng($image);
    imagedestroy($image);