meltingpoint Posted August 14, 2010 Share Posted August 14, 2010 The $_SESSION['record_to_chage'] variable is set- I know this as I can echo it out. $openedfile = file("myfile.txt"); sort($openedfile); // foreach($openedfile as $key => $newpick) { echo "<a href=\"/editpage.php?request=$_SESSION['record_to_chgange']&newcat=$newpick\" target=\"_parent\">$newpick</a>"; echo "<br>"; } The Resulting error: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in For the life of me I can not figure where I am going wrong. Going to get coffee and some fresh eyes. Cheers Quote Link to comment https://forums.phpfreaks.com/topic/210744-session-variable-in-hyperlink/ Share on other sites More sharing options...
sKunKbad Posted August 14, 2010 Share Posted August 14, 2010 Try this: <?php $openedfile = file("myfile.txt"); sort($openedfile); // foreach($openedfile as $key => $newpick) { echo '<a href="/editpage.php?request=' . $_SESSION['record_to_chgange'] . '&newcat=' . $newpick . '" target="_parent">' . $newpick . '</a>'; echo "<br>"; } Quote Link to comment https://forums.phpfreaks.com/topic/210744-session-variable-in-hyperlink/#findComment-1099342 Share on other sites More sharing options...
meltingpoint Posted August 14, 2010 Author Share Posted August 14, 2010 That worked most excellent! Much thanks. Quote Link to comment https://forums.phpfreaks.com/topic/210744-session-variable-in-hyperlink/#findComment-1099348 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.