hi friends i have some doubt on this PET <img src="pet.jpg"> <a href="#">add to profile</a> if i click this add to profile link it should pass the <img src="pet.jpg"> as a string in one variable($link) and then this $linkvariable should be pass to one method $facebook->api_client->profile_setFBML($link,$user) like that if i click the other link means PET1 <img src="pet1.jpg"> <a href="#">add to profile</a> it also should pass the <img src="pet1.jpg"> as a string in one variable and then this link should be pass to the same method $facebook->api_client->profile_setFBML($link,$user) like that it should go continuously goes on for every <img src="pet2.jpg"> can anybody help me how to write php code for this
Right, first off, you need to add some code to the link itself. Lets asume the script to handle the data is script.php. Then: <?php $img = '<img src="pet.jpg">'; ?> PET <?=$img; ?> <a href="script.php?img=<?=rawurlencode($img); ?>">add to profile</a> HTML: Then in script.php: $link = @$_GET['img'] or $link = ''; if($link != ''): $link = rawurldecode($link); $facebook->api_client->profile_setFBML($link,$user); endif; PHP: