Ver Mensaje Individual
  #1 (permalink)  
Antiguo 13/04/2011, 10:19
havih
 
Fecha de Ingreso: abril-2011
Mensajes: 1
Antigüedad: 13 años
Puntos: 0
Pregunta Problema con Facebook (me gusta) y PHP

Hola,

he probado el código tanto en PHP

<iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];?>&layout=button_count&show_faces=false&width=80& action=like&font=verdana&colorscheme=light" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:80px; height:22px" allowTransparency="true"></iframe>

como Javascript

<SCRIPT LANGUAGE="JavaScript">
document.write("<iframe src=\"http:\/\/www.facebook.com\/plugins\/like.php?href="+document.URL+"&layout=button_count &show_faces=false&width=80&action=like&font=verdan a&colorscheme=light\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:80px; height:22px\" allowTransparency=\"true\"><\/iframe>");
</SCRIPT>

para añadir el botón “Me gusta” en páginas dinámicas, pero no me consigue obtener toda la URL completa (uso varias variables -obtenidas con PHP y Mysql- en la URL y se corta después de la primera) un ejemplo:

URL original: http://www.dominio.es/pagina.php?var1=24&var2=599&var3=1

y después de pinchar en el botón “me gusta” sólo enlaza a: http://www.dominio.es/pagina.php?var1=24

¿alguna sugerencia para poder solucionar esto?