Everyone is missing the closing tag (">") on the original link after the ending quote. It is also a good practice to use full opening php tags, not shorthand. Most configurations support these shorthands, but there are still some that do not. You can also use <?php=
Code:
<?php
$var1 = 'Free+Online+Games';
?>
<a href="script2.php?q=<?php=urlencode($var1)?>"> <?php=$var1?></a>
Also an efficiency tip, freeflow:
When echoing just a variable, don't put it inside of " "
is faster than
It isn't by much, but if you're writing a large script, any piece of efficiency you can pick up is worth it. It is also a much better "Habit".
I really enjoyed
This Article that I found using
StumbleUpon about php efficiency.
Bruce