0 Replies Latest reply on Dec 26, 2006 2:57 PM by CrazyMerlin

    Having trouble with filereference upload and $_GET?

    CrazyMerlin
      If you have a php script that is called and passed variable/value pairs in the url and your $_GET array is still empty, there is another way around this.

      PHP has a function called parse_str(). When used with one of the server variables, you can get all the variable/value pairs passed to the script.

      Lets say you pass this url:
      quote:

      http://myserver.com/my_php_file.php?user_id=6&cmd=get_user_data


      in your php file you could have
      quote:

      parse_str($_SERVER['QUERY_STRING']);


      now you have access in your php file to these variables:
      quote:

      $user_id and $cmd


      you don't have to assign any variables anywhere, parse_str() will do it all for you.

      happy coding!

      //erlin!