PHP settings for a sticky form to work

I just set up wampserver to test my code before uploading to the group server and the only thing that is wrong isnt causing errors but is bothering me.

I have a bunch of sticky forms on different pages and they work on the group server but not on my localhost.  The pages do not error out but I do not get the sticky value, instead I always get code in the text field...like this

<? if(isset($_POST['username'])) echo $_POST['username'];?>

like I said the code on the page works on the group server but not on localhost that was set up by wampserver.  

does anyone know what setting PHP is missing that has it display the code and not the value?


<!-- username field --> 
                <td width="140">Enter your username:</td>
                <td width="140"><input id="username" name="username" type="text" size="20" onBlur="validUsername(this, document.getElementById('username_help'))" value="<? if(isset($_POST['username'])) echo $_POST['username'];?>" /></td>

Open in new window

cybercookie72Asked:
Who is Participating?
 
Roger BaklundCommented:
Use complete <?php start tag, or enable "short_open_tags" in php.ini:

http://php.net/manual/en/ini.core.php

<?php if(isset($_POST['username'])) echo $_POST['username'];?>
0
 
Ray PaseurCommented:
It's a common error, and I'll bet cxr is right about how to fix it.

Going forward, you can use the code snippet to see your PHP values.  Compare the differences between the two systems and you'll never be surprised!

Best to all, ~Ray
<?php phpinfo(); ?>

Open in new window

0
 
cybercookie72Author Commented:
You are AWESOME!!!!! thank you sooooo much!!  This has been bothering me ...A LOT.  thanks again
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.