wilna Posted March 25, 2010 Share Posted March 25, 2010 Hi I would just like to know what is the difference between: <a href=mrt10.php?echo $session><font face=Arial size=2>March</a> and <a href=mrt10.php><font face=Arial size=2>March</a> Quote Link to comment Share on other sites More sharing options...
developerdave Posted March 25, 2010 Share Posted March 25, 2010 well firstly, the top example contains some PHP, but it won't run because its not wrapped in <?php ?> if you wanted that to work it would need to be <a href="mrt10.php?<?php echo $session; ?>"><font face="Arial" size="2">March</a> And it will add whatever $session is equal too into that link. And if it contains nothing, you'll see no difference. And the bottom example is just plain old HTML lol Quote Link to comment Share on other sites More sharing options...
wilna Posted March 25, 2010 Author Share Posted March 25, 2010 ok sorry my mistake, let me try again: <?php echo "<a href=mrt10.php?echo $session><font face=Arial size=2>March</a>"; ?> and <?php echo "<a href=mrt10.php><font face=Arial size=2>March</a>"; ?> Quote Link to comment Share on other sites More sharing options...
developerdave Posted March 25, 2010 Share Posted March 25, 2010 The top example will raise an error, take the echo out of the middle of the line like this (I've also encapsulated it for you) <?php echo "<a href=mrt10.php?{$session}><font face=Arial size=2>March</a>"; ?> Quote Link to comment 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.