Page 1 of 1

problem with variable

Posted: Mon Feb 02, 2004 2:33 pm
by orangeapple
Hi everyone !

i have a problem :

header("Location: norestric1.php?randompass=$randompass");

this works perfectly, it sends the value of $randompass to norestric1.php
wereas this :

<a href="logmon.php?randompass=$randompass"><img src="../media/bouton_loginmonitoring.jpg" width="130" height="25" border="0">

doesn't send the value of the variable but sends :

http://steph/microsent/pages/logmon.php ... randompass

who can help ?
Thanks !

Posted: Mon Feb 02, 2004 4:02 pm
by DuFF
Are you sure that

Code: Select all

<a href="logmon.php?randompass=$randompass"><img src="../media/bouton_loginmonitoring.jpg" width="130" height="25" border="0">
is inside the PHP tags? If it's not you will have to do:

Code: Select all

<a href="logmon.php?randompass=<?php echo $randompass; ?>"><img src="../media/bouton_loginmonitoring.jpg" width="130" height="25" border="0">

Posted: Mon Feb 02, 2004 11:52 pm
by orangeapple
yes, these codes are inside the PHP tags...

Posted: Tue Feb 03, 2004 12:00 am
by markl999
<a href="logmon.php?randompass=$randompass">
You've used single quotes to wrap it, e.g.
echo '<a href="$bar">'; .. that will not work..
either
echo "<a href=\"$bar\">"; ... or
echo '<a href="'.$bar.'">';