By clicking on the link the ID value to pass to the server with AJAX POST method?


<a class="image" href="<?= $img['path_original_image']?>" target="_blank" id="<?= $img['count_opened']?>"> //give the number of opening pictures
 <img src="<?= $img['path_min_image'] ?>" alt="#"></a>
<p id="cart-count">()</p>

<script src="jquery.js"></script>
the <script>
 $(document).ready(function () {
 $(".image").click(function () {
 var params = {
 count: $("#id").val(),

 $.post("photo.php", params, function (data) {


$count = $_POST['params'];
echo $count; //nothing displays
March 12th 20 at 08:11
0 answer

Find more questions by tags PHPAJAX