Re: OT? passing text variables through html forms.
| From: | Kris Dahl | Date: | Fri, 30 Jun 2000 00:08:18 +0000 |
| Subject: | Re: OT? passing text variables through html forms. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-3928@lists.php.net to get a copy of this message | ||
on 6/29/00 4:56 PM, Teodor Cimpoesu at teo@digiro.net wrote:
> Hi Travis!
> On Thu, 29 Jun 2000, Travis Ruthenburg wrote:
>
>>
>> <?
>> $var = "This is 'a' test";
>> <input type='hidden' name='name' value='$var'>
>> ?>
> try
> <input type='hidden' name='name'
> value='<?=rawurlencode($var)?>'>
> or
> <? echo "<input type='hidden' name='name' value='" .
> rawurlencode($var)."'>";
> ?>
> so on
> AFAIK ' and " are not allowed in urls, so they will be translated and I expect
> PHP to decode it as any url-encoded content, or you may call rawurldecode() on
> the other end.
This is true that spaces aren't allowed, but the form is automatically
urlencoded when submitted, so that won't be the problem nor the solution.
-k