Foros del Web » Programando para Internet » PHP »

Parametros PHP

Estas en el tema de Parametros PHP en el foro de PHP en Foros del Web. Hola gente !! Tengo el siguiente problema! Tengo una function en javascript que envio un parametro 'Prod="e_learning.htm";' photo=window.open(URL, "PhotoWindow", "width=" + windowWidth + ",height=" + ...
  #1 (permalink)  
Antiguo 23/06/2007, 18:40
 
Fecha de Ingreso: noviembre-2006
Ubicación: Capital Federal
Mensajes: 141
Antigüedad: 17 años, 5 meses
Puntos: 1
Parametros PHP

Hola gente !!

Tengo el siguiente problema!
Tengo una function en javascript que envio un parametro 'Prod="e_learning.htm";'

photo=window.open(URL, "PhotoWindow", "width=" + windowWidth + ",height=" + windowHeight + ",toolbars=no,scrollbars,top="+nTop+",left="+nLeft );
Prod="e_learning.htm";

Lo que necesito ahora es recuperar ese parametro 'Prod' con PHP .........

Ya probe $Prod = $_GET['Prod']; o $Prod = $_POST['Prod']; pero no me funciono!!!

Si alguien me da una mano se lo agradecere!!!
  #2 (permalink)  
Antiguo 23/06/2007, 19:17
 
Fecha de Ingreso: febrero-2003
Ubicación: Santiago
Mensajes: 220
Antigüedad: 21 años, 2 meses
Puntos: 4
Re: Parametros PHP

Podrias mostrar parte del codigo, porque si envias por URL de manera

index.php?Prod=e_laerning.html

deberia funcionar con $_GET["Prod"];

Te invito a postear parte de como "envias" el url y como lo "obtienes" saludos
__________________
Roberto Osses Elgueta
Senior Web Developer
  #3 (permalink)  
Antiguo 23/06/2007, 20:05
 
Fecha de Ingreso: noviembre-2006
Ubicación: Capital Federal
Mensajes: 141
Antigüedad: 17 años, 5 meses
Puntos: 1
Re: Parametros PHP

Hola !!! gracias por tu ayuda!

Aca copio parte del codigo

esta es la function javascript q lo q hace es abrir un popup

function showLargePhoto(photoName, photoWidth, photoHeight, photoCaption)
{
photoTitle=Client;
if (photoCaption != "")
photoTitle=photoTitle + "%5-%5" + photoCaption
if (window.photo && !(window.photo.closed))
window.photo.close();
var URL=photoName;
var windowWidth=parseInt(photoWidth) + 5;
var windowHeight=parseInt(photoHeight) + 5;
var nTop;
var nLeft;
nTop = (screen.height - photoHeight) / 2
nLeft = (screen.width - photoWidth) / 2

photo=window.open(URL, "PhotoWindow", "width=" + windowWidth + ",height=" + windowHeight + ",toolbars=no,scrollbars,top="+nTop+",left="+nLeft );
Prod="e_learning.htm";
}

esta es la llamada a la function

<a href="javascript:showLargePhoto('recomendar_1.php' ,'450','200');" class="productos">
Recomenda este Producto
</a>

y en la function a lo ultimo le agregue "Prod="e_learning.htm";"

y quiero en la proxima pagina en este caso 'recomendar_1.php' recuperar
ese parametro (Prod="e_learning.htm";)


Muchas gracias.
  #4 (permalink)  
Antiguo 23/06/2007, 20:20
Avatar de demiurgo_daemon  
Fecha de Ingreso: diciembre-2006
Ubicación: Querétaro
Mensajes: 184
Antigüedad: 17 años, 4 meses
Puntos: 2
Re: Parametros PHP

Hola,

para poder mandar variables por GET hay que insertarlas en el URL; te muestro tu código con los cambios en negritas para lograr esto:

Código:
function showLargePhoto(photoName, photoWidth, photoHeight, photoCaption)
{
photoTitle=Client;
if (photoCaption != "")
photoTitle=photoTitle + "%5-%5" + photoCaption
if (window.photo && !(window.photo.closed))
window.photo.close();
var URL=photoName;
var windowWidth=parseInt(photoWidth) + 5;
var windowHeight=parseInt(photoHeight) + 5;
var nTop;
var nLeft;
nTop = (screen.height - photoHeight) / 2
nLeft = (screen.width - photoWidth) / 2

photo=window.open(URL+"?Prod=e_learning.htm", "PhotoWindow", "width=" + windowWidth + ",height=" + windowHeight + ",toolbars=no,scrollbars,top="+nTop+",left="+nLeft );
}
Código HTML:
<a href="javascript:showLargePhoto('recomendar_1.php' ,'450','200');" class="productos">
Recomenda este Producto
</a> 
Ahora sí debes poder encontrar la variable $_GET['Prod']

saludos
  #5 (permalink)  
Antiguo 23/06/2007, 20:24
 
Fecha de Ingreso: noviembre-2006
Ubicación: Capital Federal
Mensajes: 141
Antigüedad: 17 años, 5 meses
Puntos: 1
Re: Parametros PHP

Hola demiurgo_daemon !!!!! muchas gracias por tu ayuda!!!

Me anduvo fantastico lo que me enviastes!!!

Gracias a todos por su ayuda!!!!!!
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 20:18.