Re: Setting variables through an URL
| From: | Joao Prado Maia | Date: | Thu, 31 Aug 2000 16:25:15 +0000 |
| Subject: | Re: Setting variables through an URL | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-14641@lists.php.net to get a copy of this message | ||
On Thu, 31 Aug 2000, akio wrote:
> Hello everyone!
>
> I have a script, I set two variables through the URL itself, like
>
>
> http://whatever.com/taf.php?ntitle=Any+title&theurl=any+url
>
> I want the $theurl variable to have a plus '+' sign. Instead of the sign I
> get a free space.
Hi akio,
Try this piece of code:
<?php
$theurl = "any+url";
echo
"http://whatever.com/taf.php?ntitle=Any+title&theurl="
. urlencode($theurl);
?>
Take a look at the manual for the urlencode() function for more details.
http://www.php.net/manual/function.urlencode.php
Regards,
Joao
--
Joao Prado Maia
Web Developer
Kefta.com, Inc