如何将图像名称作为参数传递?

There is something I am trying to acheive but I don't quite understand how to do it. What I think I need to do is to pass the name of the image as a parameter to the cancelimage.php script and the use that in the query. But I don't think I am doing this with var image_file_name. What do I need to do to achieve this?

Below is the startImageUpload() function where it starts uploading an image and where the cancel button exist:

 function startImageUpload(imageuploadform){

    ...

                $(".imageCancel").on("click", function(event) {

var image_file_name = $(this).attr('image_file_name');

                jQuery.ajax("cancelimage.php"  + image_file_name)
                    .done(function(data) {

                    $(".imagemsg" + _cancelimagecounter).html(data);
                });

                return stopImageUpload();

            });       
                  return true;
            }

Below is the cancelimage,php page where it is suppose to delete a row from the database?

<?php

$username="xxx";
$password="xxx";
$database="xxx";

mysql_connect('localhost',$username,$password);

mysql_select_db($database) or die( "Unable to select database");

$image_file_name = $_GET["fileImage"]["name"];

    echo "File Upload was Canceled";

        $imagecancelsql = "DELETE FROM Image 
        WHERE ImageFile = 'ImageFiles/". mysql_real_escape_string($image_file_name)."'";

    mysql_query($imagecancelsql);

    mysql_close();


?>

If that is the issue with only variable passed with "image_file_name", then why dont your try to achieve it like this:

var image_file_name = "<?php echo $image_file_name; ?>"

Then you can just forward it as url to ajax call like in regular mannar:

       jQuery.ajax("cancelimage.php"  + image_file_name)
                    .done(function(data) {
                   .....some code here....

    });