Forum Moderators: coopster
i have a form as such
<input type=text name=address size=75>
if someone enters like:
"my house here in MD"
using the $_POST['address'] i can only get the first part of the string "my". there must be a way to get the rest of it. if so, please advise. thanks.
-khanh
what i had before -- // prints only first word
<input type="text" name="address" size=75 value= <? echo address;?>
>
after (notice the quotation) //prints all
<input type="text" name="address" size=75 value='<? echo address;?>'
>
silly me =)
what i had before -- // prints only first word
<input type="text" name="address" size=75 value= <? echo address;?>
>
Actually this is not what you stated, you said you were just echoing the address as ...
php form handler:
$address = $_POST['address'];
echo $address;
... which is quite different. When you write code out embedded in the HMTL you have to handle it differently. And, as you have figured out, "View Source" will often save you many headaches. You need to take your output and make it browser safe as follows ...
after (notice the quotation) //prints all
<input type="text" name="address" size=75 value='<? echo htmlentities [php.net](address);?>'
>