Passing Variables a different way

Discussion in 'PHP' started by glasglow, Mar 26, 2009.

  1. #1
    I am passing variables to two scripts. One script requires the variable to be in a normal way, like:

    url.php?variable=oneword%20twowords

    The other script requires the variables to be like:

    url.php?variable=oneword,twowords

    There is no way for me to change actual scripts because they are external data applications which are out of my control. Is there a way for me to $_GET the variables in different ways. For example, the default is:

    url.php?variable=oneword%20twowords

    But I need that to $_GET the variables with commas separating them, so it's kind of, perhaps simply replacing the (%20) with a (,).

    My second question here is, will it be handled differently if it was internal, using a $_Post instead of $_Get

    Thanks for an insight into the problem in advance.
     
    glasglow, Mar 26, 2009 IP
  2. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #2
    1. no its fine with the %20, upon entering of variable there must have a code that replaces %20 with space.
    str_replace("%20"," ", $_GET['var']);
    2. nope it will be the same, all declarations of $_GET or $HTTP_GET_VARS must be replace with $_POST or $HTTP_POST_VARS
     
    bartolay13, Mar 27, 2009 IP
  3. glasglow

    glasglow Active Member

    Messages:
    926
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #3
    Thanks a lot.. That's exactly what I needed, the string replace on the $_GET
     
    glasglow, Mar 28, 2009 IP