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 3599310
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:21:06+00:00 2026-05-18T20:21:06+00:00

Let’s say that I have two links. <li><a href=# id=VALUE1 class=charName>Name 1</a></li> <li><a href=#

  • 0

Let’s say that I have two links.

<li><a href="#" id="VALUE1" class="charName">Name 1</a></li>

<li><a href="#" id="VALUE2" class="charName">Name 2</a></li>

And when I click one of these links jQuery passes the ID of the link I clicked to a PHP file without reloading the page.

Due to the fact that the id’s will not be constants I assume this.id will need to be used in the jQuery.

Then in the PHP file the id is put into a variable then sent to the database. Such as,

$var = JQUERY?

insert db...

I am just stumped on how to create the jQuery needed to send the ID to the PHP file. And then to retrieve that non-constant ID using PHP.

How might I got about doing this?

  • 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-05-18T20:21:07+00:00Added an answer on May 18, 2026 at 8:21 pm

    you have to implement some ajax to achieve the same , lets have a click handler for a href first.

    And then make a ajax call

    $('.charName').click(function() {
       var idval = this.id ;
    
       $.ajax({
       type: "POST",
       url: "some.php",
       data: "id=idval  &location=Boston",
       success: function(msg){
         alert(msg ); // this is the response
       }
     });
     return false// this is diable ahref post back to the same page itself
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say we have a table that has 2 million rows. It has two
let's say I have a class that does some calculations. This set of calculations
Let's say I have data string like this... one=1&two=2&three=3&four=4&two=2 I'm using php foreach to
Let's say I have the following models class Photo(models.Model): tags = models.ManyToManyField(Tag) class Tag(models.Model):
Let's say I have two tables orgs and states orgs is (o_ID, state_abbr) and
Let's say on a page I have alot of this repeated: <div class=entry> <h4>Magic:</h4>
Let's say I have window.open (without name parameter), scattered in my project and I
Let's say I have a C++ Visual Studio 2010 solution with 2 projects: one
Let's say I have multiple requirements for a password. The first is that the
Let's say that I have a date in R and it's formatted as follows.

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.