PHP Usage
Starting your php code
Always start your PHP code with <?php rather than <? as it’s less work for your parser. This is good practice.
Encoding form variables in a URL
If you’re putting form variables in a URL, you can get into strife when the user enters spaces or other non-alphanumeric characters in the form.Here is the way to convert their data to a URL compliant format:
<?php
echo ‘<a href=”scriptname.php?formvalue=’.htmlentities(urlencode($formvalue)).’” mce_href=”scriptname.php?formvalue=’.htmlentities(urlencode($formvalue)).’”>’;
?>
