url parameters with a space in the variable name

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • goobla

    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&cus tom%20var2=5678

    I am having trouble accessing this variable.

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

    You guys get the idea.

    How do i reference these variables?

    Thanks.
  • goobla

    #2
    Re: url parameters with a space in the variable name

    EDIT:
    Things i have tried:
    $_GET["var"]
    $_GET["custom var"]
    $_GET["custom%20v ar"]
    $var
    $_REQUEST["custom var"]
    $_GET['custom var']

    Comment

    • goobla

      #3
      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:
      EDIT:
      >
      >
      >
      Things i have tried:
      $_GET["var"]
      $_GET["custom var"]
      $_GET["custom%20v ar"]
      $var
      $_REQUEST["custom var"]
      $_GET['custom var']- Hide quoted text -
      >
      - Show quoted text -

      Comment

      Working...