Variable in Another File
Posted 13 June 2006 - 08:20 PM
I have two pages and I am trying to pass a variable called $hlink from page1.php to page2.php. I was just wondering if someone could help me out? This is what I have been using:
echo '<a href="page2.php?string11= . $hlink . ">String is:</a>';
On page 2 I have :
if (isset ($_GET['string11'])) echo $_GET['string11'];
My variable $hlink stores a title that I want to bring up again on page2.php; however, the only thing that pops up is the output ".$hlink." Any suggestions?
Posted 13 June 2006 - 08:25 PM
Posted 13 June 2006 - 08:57 PM
echo "<a href=\"page2.php?string11=$hlink\">String is:</a>";
Thanks Joquius!!! That definitely worked [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /]
Posted 13 June 2006 - 09:07 PM
<?php echo '<a href="page2.php?string11=' . $hlink . '">String is:</a>'; ?>You'll notice that I added a single quote after the "=" and before the following double quote in your original code.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users