Skip to main content
$("img").click(function() {
    var ipath = $(this).attr('src');
    $.ajax({ type:'POST', url: 'sample.php',
        dataType: 'HTML',
        data : {
            path: ipath 
        },
        success: function(data)
        { 

        } 
    });//end of ajax

})//end of click

You can get this value in php script as $_POST['path']

$("img").click(function() {
    var ipath = $(this).attr('src');
    $.ajax({ type:'POST', url: 'sample.php',
    dataType: 'HTML',
    data : {
        path: ipath 
    },
 success: function(data)
 {
 } 
});//end of ajax

})//end of click

You can get this value in php script as $_POST['path']

$("img").click(function() {
    var ipath = $(this).attr('src');
    $.ajax({ type:'POST', url: 'sample.php',
        dataType: 'HTML',
        data : {
            path: ipath 
        },
        success: function(data)
        { 

        } 
    });//end of ajax

})//end of click

You can get this value in php script as $_POST['path']

Source Link
Dr. Dan
  • 2.3k
  • 16
  • 19

$("img").click(function() {
    var ipath = $(this).attr('src');
    $.ajax({ type:'POST', url: 'sample.php',
    dataType: 'HTML',
    data : {
        path: ipath 
    },
 success: function(data)
 {
 } 
});//end of ajax

})//end of click

You can get this value in php script as $_POST['path']