Share facebook button with dynamic link

Asked

Viewed 2,202 times

0

Good morning, I’ve tried several scripts to make my dynamic link be shared with the custom facebook button. I can’t I’m trying this:

<?php $linkFace = "http://www.modalle.com.br/blog.php?artigo=".$_GET['artigo'];?>
<a onClick="return goodPopup(this.href)" href="http://facebook.com/sharer.php?u=<?php echo urlencode($linkFace)?>&amp;t=<?php echo urlencode($row['chamada']);?>" target="_blank" class="facebook"></a>

Anyone can help?

  • You can put your goodPopup function, and the end result of your personal href pro help you better?

  • 1

    <script> Function goodPopup(url) { window.open(url, '_Blank', 'scrollbars,resizable,height=400,width=550'); Return false; } </script>

  • Vinicius, give us a console.log on this one. url and put what’s coming for us...

1 answer

1

Try this

<?php
   $linkFace = "http://www.modalle.com.br/blog.php?artigo=".$_GET['artigo'];?>
?>

<a href="http://facebook.com/sharer.php?u=<?php echo urlencode($linkFace)?>" target="_blank" class="facebook"></a>

Add the suggestion commented by the colleague Vinicius-Anchez-dos-Santos , also works

Browser other questions tagged

You are not signed in. Login or sign up in order to post.