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
https://forums.phpfreaks.com/topic/276445-replace-follow-button-upon-follow/
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" />'; 
}
?> 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.