Connecting Tech Pros Worldwide Help | Site Map

url parameters with a space in the variable name

 
LinkBack Thread Tools Search this Thread
  #1  
Old March 18th, 2008, 02:45 AM
goobla
Guest
 
Posts: n/a
Default url parameters with a space in the variable name

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, 02:55 AM
goobla
Guest
 
Posts: n/a
Default 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, 03:55 AM
goobla
Guest
 
Posts: n/a
Default 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 -
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.