• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 333
  • Last Modified:

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

0
cybercookie72
Asked:
cybercookie72
1 Solution
 
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

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now