Connecting Tech Pros Worldwide Help | Site Map

url parameters with a space in the variable name

  #1  
Old March 18th, 2008, 03:45 AM
goobla
Guest
 
Posts: n/a
Hello,

I am having an issue that is being sent to one of my scripts. A
particular company likes to uses spaces in their url parameters, which
is causing me some issues.

For example:
A url variable might be "custom var" with a value of "1234"
and "custom var2" with a value of "5678"
they are sending this as:

test.php?custom%20var=1234&custom%20var2=5678

I am having trouble accessing this variable.

Things i have tried:
$_GET["uid"]
$_GET["custom uid"]
$_GET["custom%20uid"]
$uid
$_REQUEST["custom uid"]
$_GET['custom uid']

You guys get the idea.

How do i reference these variables?

Thanks.
  #2  
Old March 18th, 2008, 03:55 AM
goobla
Guest
 
Posts: n/a

re: url parameters with a space in the variable name


EDIT:
Quote:
Things i have tried:
$_GET["var"]
$_GET["custom var"]
$_GET["custom%20var"]
$var
$_REQUEST["custom var"]
$_GET['custom var']
  #3  
Old March 18th, 2008, 04:55 AM
goobla
Guest
 
Posts: n/a

re: url parameters with a space in the variable name


I can answer my own question.
$custom_var works. use the underscore instead of space or %20

On Mar 17, 10:54*pm, goobla <goog-...@shadowbrew.comwrote:
Quote:
EDIT:
>
>
>
Quote:
Things i have tried:
$_GET["var"]
$_GET["custom var"]
$_GET["custom%20var"]
$var
$_REQUEST["custom var"]
$_GET['custom var']- Hide quoted text -
>
- Show quoted text -
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Search for multiple things in a string tshad answers 32 November 17th, 2005 10:18 AM
Error Trapping In Access 2000 Peter Frost answers 6 November 12th, 2005 11:14 PM
Error Trapping In Access 2000 Peter Frost answers 6 November 12th, 2005 10:50 PM
URL parameters by name or iteration.. Andrew Thompson answers 11 July 23rd, 2005 11:50 AM