get the value of which link I click

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Lphp
Forum Commoner
Posts: 74
Joined: Sun Jun 26, 2011 9:56 pm

get the value of which link I click

Post by Lphp »

I have two link like and unlike I would like to handle click like hidden the unlike and get the value on which link I click , how to hande this :(
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: get the value of which link I click

Post by social_experiment »

Something like this: page.php?action=like / page.php?action=unlike ?
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Lphp
Forum Commoner
Posts: 74
Joined: Sun Jun 26, 2011 9:56 pm

Re: get the value of which link I click

Post by Lphp »

do understand your suggestions
mean time I have
<span style="font-size:10px; color:#666666; float:right"> <a href="#" class="like_button" id="tag<?php echo $row2['id']; ?>" name="tag" onclick="(this.innerHTML=='like')? this.innerHTML='unlike' : this.innerHTML='like'; return false;" >like</a></span>
do not how to continue
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: get the value of which link I click

Post by social_experiment »

Code: Select all

// this gets the text you use for the link
document.links[x].text
// where x is the value of the link in the links[] array
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Lphp
Forum Commoner
Posts: 74
Joined: Sun Jun 26, 2011 9:56 pm

Re: get the value of which link I click

Post by Lphp »

i get it by jquery
Post Reply