Page 1 of 1

variables and headers

Posted: Sat Aug 06, 2011 3:43 am
by timoteo
Hi, Can anyone help me here - I can't pass the variable in my header redirect.
If I echo $MM_redirectLoginSuccess it echos fine : mipagina.php?id=106
However in the url it comes up withouth the variable: mipagina.php?id=
thanks in advanced

Code: Select all

 $ent = $_GET['id'];
  $MM_redirectLoginSuccess = "mipagina.php?id=$ent";

 header("Location: " . $MM_redirectLoginSuccess );


Re: variables and headers

Posted: Sat Aug 06, 2011 4:56 am
by Dodon
The code above works fine for me, make sure that $_GET['id'] return a value.

first try to replace $ent = $_GET['id']; by $ent = 106;

if that works your $_GET['id'] is probably empty.

I copied your code and it works fine as long as $_GET['id'] contains a value.

Re: variables and headers

Posted: Sat Aug 06, 2011 5:31 am
by timoteo
if I echo $MM_redirectLoginSuccess it echos mipagina.php?id=106 so $_GET['id'] contains the value and the variable $MM_redirectLoginSuccess is complete. just won't echo the value in the url it reopens

Re: variables and headers

Posted: Sat Aug 06, 2011 5:35 am
by timoteo
...

Re: variables and headers

Posted: Sat Aug 06, 2011 12:48 pm
by timoteo
thanks you were right. $_GET['id'] was empty. - 2am isn't right moment to do this. got it now. as always looking in the wrong place and wrong page. never mind.