Ver Mensaje Individual
  #20 (permalink)  
Antiguo 23/01/2009, 03:43
farve
 
Fecha de Ingreso: marzo-2005
Mensajes: 130
Antigüedad: 20 años
Puntos: 1
Respuesta: Pasar variable URL a un boton

jojo se me ha encendido la bombilla y me he acordado de que hace dos años yo estaba buscando algo parecido

viendo que no te va php(cosa rara, seguro que los archivos acaban en .php???)

lo he exo en javascript:

Código:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="es" xml:lang="es">
<head>
<title>Variables por javascript</title>

<script type="text/javascript">
var params = location.search.substr(1).split("&");
for (var i = 0, total = params.length; i < total; i ++)
window[params[i].split("=")[0]] = unescape(params[i].split("=")[1]);

if (num == undefined) {
    var num = 1;
    }
</script>

</head>
<body onload="obtener_valor()">

<script type="text/javascript">
    document.write("<a href='fotos" +  ++num  + ".html?num=" + num + "'>Siguiente (" + num + ")<\/a>");
    </script>

</body>
</html>
lo importante esta en negrita;
el primer script metelo en head, y el segundo donde quieras que este el enlace