RE: [PHP] Re: how to send spaces in the url
| From: | Matthew Walker | Date: | Thu, 09 May 2002 19:36:13 +0000 |
| Subject: | RE: [PHP] Re: how to send spaces in the url | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-96860@lists.php.net to get a copy of this message | ||
Might I suggest using PHP's urlencode() to encode the string, and
Javascript's function unescape()?
Matthew Walker
Senior Software Engineer
ePliant Marketing
-----Original Message-----
From: Kevin Stone [mailto:kevin@helpelf.com]
Sent: Thursday, May 09, 2002 11:37 AM
To: php-general@lists.php.net
Subject: Re: [PHP] Re: how to send spaces in the url
LOL! A standard!? In Javascript!? You must be joking. :-)
Nope. But it's not difficult. You simply have to access the url string
with
'document.location.href', parse out the values individually and replace
the
space placeholders. Can't remember what the exact javascript function
would
be.. I think it's 'string.replace' or something like that. I'm certain
a
quick search.will reveal exactly what you need.
-Kevin
----- Original Message -----
From: "Pushkar Pradhan" <pushkar@ERC.MsState.Edu>
To: "Kyle Gibson" <admin@plaguenet.com>
Cc: <php-general@lists.php.net>
Sent: Thursday, May 09, 2002 10:24 AM
Subject: Re: [PHP] Re: how to send spaces in the url
> Thanks to all who responded.
> I think I should have mentioned that I am trying to send these vars.
in
> the url to a javascript pg. thus won't have access to php on the other
> side (i.e. I want to keep it this way for speed).
> So as Kyle suggested to replace the " " is the only way? This is fine
but
> isn't there something standard for this?
> > What you could do is think of some random sequence of characters,
say
> > |-| and use that for a space.
> >
> > Then, on the receiving script, just remember to use
> > str_replace("|-|"," ",$HTTP_SERVER_VARS["QUERY_STRING"])
> >
> >
> > If you don't have access to the receiving script, then you'll need
to
> > use "%20".
> >
> >
> > -Kyle
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
> -Pushkar S. Pradhan
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002