Page 1 of 1

PHP code in my form

Posted: Wed Nov 26, 2008 4:07 pm
by reyes99
Hi Everyone,

I keep getting my PHP code " <?=$_POST[email]?> " showing up inside my field when I run my form in my browser.

What could be causing this??

Code: Select all

        
<p align="center">E-Mail Address:</td>
<td><p align="center">
<input type="text" name="email" value="<?=$_POST[email]?>">
<font color="#FF0000">* required</font></td>
 
Thanks in advance

Ralph

Re: PHP code in my form

Posted: Wed Nov 26, 2008 4:09 pm
by Syntac
Never, ever use <? or <?=.

Re: PHP code in my form

Posted: Wed Nov 26, 2008 4:14 pm
by reyes99
what should I use. I am kind of new to PHP...

Thanks

Re: PHP code in my form

Posted: Wed Nov 26, 2008 4:35 pm
by reyes99
Thanks Syntac,

I found this on google and it worked.

is it ok to use this?

<input type="text" name="email" value="<?php echo $PHP_SELF;?>">


Thanks

Ralph

Re: PHP code in my form

Posted: Wed Nov 26, 2008 4:38 pm
by Syntac
Yes, provided you replace $PHP_SELF with whatever your variable is.

Re: PHP code in my form

Posted: Wed Nov 26, 2008 4:39 pm
by reyes99
Thank you

Re: PHP code in my form

Posted: Wed Nov 26, 2008 4:42 pm
by Syntac
Oh, and one more thing...

Code: Select all

$_POST[email]
should be:

Code: Select all

$_POST["email"]