SitePoint Sponsor |
|
User Tag List
Results 1 to 7 of 7
-
Sep 25, 2001, 04:09 #1
- Join Date
- Feb 2000
- Location
- England
- Posts
- 568
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
parsing a variable with spaces as a link
Is there any way to pass a variable with spaces in it as a link (ie GET data). For example
www.domain.com/review.php?title=and then he said
sort of thing.
I can't do any PHP or anything like that with the link unfortunatly, a unchangeable script generates the link.
It works without doing anything in IE5 but not Netscape 4. Any ideas?
-
Sep 25, 2001, 05:06 #2
- Join Date
- Jun 2000
- Location
- Sydney, Australia
- Posts
- 3,798
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I would have thought that any browser IE, NS4.*, et al, would send that as:
Code:www.domain.com/review.php?title=and%20then%20he%20said
-
Sep 25, 2001, 05:26 #3
- Join Date
- Feb 2000
- Location
- England
- Posts
- 568
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
nope, unfortunatly NS4 really does not do this. try clicking on this link with NS4
http://www.sitepointforums.com/index...hen he shouted and see what happens
-
Sep 25, 2001, 05:27 #4
- Join Date
- Jul 2001
- Location
- The Netherlands
- Posts
- 2,617
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Yep, the link works for me...
-
Sep 25, 2001, 05:45 #5
- Join Date
- Feb 2000
- Location
- England
- Posts
- 568
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Yes, the link works but does it put
%20
between the words. If not, as it dosen't in NS4 for me, only the first word of the variable title is accessible from the PHP script.
-
Sep 25, 2001, 05:51 #6
- Join Date
- Jul 2001
- Location
- The Netherlands
- Posts
- 2,617
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
It does put %20 between the words, meaning the whole phrase is accessable as being the keyword title. I am using IE 5.5 of 6.0 by the way, I can't tell since it loads to quickly
!
-
Sep 25, 2001, 11:04 #7
- Join Date
- Aug 2000
- Location
- San Diego, CA
- Posts
- 5,460
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Chris just run your variable through urlencode() or rawurlencode() before appending it to the query string.
PHP Code:$var = urlencode($var); //puts %20 in
//or
$var = rawurlencode($var); //puts + in
If you hard coding the link just put them in there in place of the spaces.Please don't PM me with questions.
Use the forums, that is what they are here for.
Bookmarks