Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9232063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:13:28+00:00 2026-06-18T06:13:28+00:00

I want to if any one click on image than only clicked image sl

  • 0

I want to if any one click on image than only clicked image sl number pass to php page. but i don’t get any imge sl number. I am trying to find out the problem. but i can’t please, any one help me. thanks. here is my code

                <?php
$query="select * from image_content order by sl";
$result=mysql_query($query) or die (mysql_error());
$num=mysql_num_rows($result);

for ($i=0; $i<$num; $i++)
{


    $sl=mysql_result($result, $i, "sl");
    $title=mysql_result($result, $i, "title");
    $image_name=mysql_result($result, $i, "image_name");



    echo"
        <div id='image_style'>

    <div id='upload_image'>
        <a class='picture_description' href='#' title='$title'>
        <img src='../download/$image_name' />
     <div align='center'>Title: $title</div>
    </a>
   </div>
<input type='hidden' class='picture_sl' name='picture_sl' value='$sl'/>
</div>";
}
?>

jquery code:

<script type="text/javascript">
$(document).ready(function() {

    $(".picture_description").click(function() {

        var action = $("#form1").attr('action');
        var form_data = {
            picture_sl: $(".picture_sl").val(),
            is_ajax: 1
        };

        $.ajax({
            type: "POST",
            url: action,
            data: form_data,
            success: function(response)
            {

                        $("#div_1").html(response);

                }
        });

        return false;
    });

});
</script>

loaded php:

<?php

echo $picture_sl=$_POST['picture_sl'];
?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T06:13:29+00:00Added an answer on June 18, 2026 at 6:13 am

    In your click handler you are selecting any input element with the class “picture_sl”, not the one that was clicked.

    You could use a data attribute on your anchor tag like this

    <a class='picture_description' href='#' title='$title' data-picture='$sl'>
    

    and then retrieve it with the jQuery data() method:

       $(".picture_description").click(function() {
    
        var action = $("#form1").attr('action');
        var form_data = {
            picture_sl: $(this).data('picture'),
            is_ajax: 1
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I have Model.objects.all() I want to get only one object for any content_object=foo,
We only want one instance of our app running at any one time. So
I want to show an image view for three like on/off,if any one have
I want to publish message on Facebook's fan page using JAVA/GWT API. Any one
I want to create one of these Click To See Image Im going to
Can any one suggest a good tutorial for Mozilla rhino. What i want to
i want buy iphone or ipad any one for testing iphone and ipad applications.my
I want to record my most recent cd across any one of my terminals.
I want to bound JVM with a fixed memory limit. Can any one help
OK, so i want to check if a large string contains one (any) of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.