View Full Version : getting plus (+) symbols in query string

06-10-2007, 02:15 PM
I'm trying to grab a query string value for "search" where there are multiple values separated by plus symbols

e.g. index.php?search=one+two+three

in index.php I have the following

$action = $_GET['search'];

and I use this to do this


It works fine if there is only one search term. However when there is more than one the "require" breaks because it replaces the "+" with a blank space

require("http://www.mysite.com/cgi-bin/search.pl?search=one"); (works)

require("http://www.mysite.com/cgi-bin/search.pl?search=one two three"); (does not work)

Is there a simple solution?

06-10-2007, 02:53 PM
The urlencode() function will probably do what you want.

06-10-2007, 10:44 PM
Thankyou CFMaBiSmAd,
That was a simple solution!

$action = urlencode($action);

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum