Jump to content

Replace Follow Button Upon Follow?


justlukeyou

Recommended Posts

Hi,

 

I have a social networking button which is an image. However when someone clicks the button to follow someone I want to replace the follow button with a standard image.

<input name="followbutton" CLASS="submitbutton" type="submit" />
$query = mysql_query("SELECT * FROM follow WHERE user_id = '". $profileid ."' AND follow_user_id= '". $followerid ."'"); 
$duplicatefollow = null;
if (mysql_num_rows($query) > 0) 
{ 
echo ' <input name="followbutton" CLASS="submitbutton" type="submit" />'; 
} 
else
{
echo '<img src="/images/successfulfollow.png" />
}
Any suggestions please?
Link to comment
Share on other sites

Bloody hell, this code actually works!!!

 

I wrote it here, didn't think it would work.

 

I just had to swap the two sets of images. See Jessica, I am learning!

 <?php
$query = mysql_query("SELECT * FROM follow WHERE user_id = '". $profileid ."' AND follow_user_id= '". $followerid ."'"); 
$duplicatefollow = null;
if (mysql_num_rows($query) > 0) 
{ 
echo '<img src="/images/successfulfollow.png.png" />'; 
} 
else
{
echo '<input name="followbutton" CLASS="submitbutton" type="submit" />'; 
}
?> 
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.