1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: PHP question

Discussion in 'Software Development' started by mstyers, Sep 27, 2008.

Thread Status:
Not open for further replies.
  1. mstyers

    mstyers Thread Starter

    Joined:
    Jun 10, 2004
    Messages:
    71
    I am using php4 and php5.

    To hide the actual variable information I am using gzcompress and base64_encode to create a string that is passed for the variable.

    Doing this I get a string that may have special characters in it like a +, /, etc. I pass them to my script and use the $_GET to receive them. When I receive them the special characters are turned into blanks.

    Ex. script.php?var=eJwrSiotSc5ILXIwLAbS+nJqU
    $_GET['var'] = eJwrSiotSc5ILXIwLAbS nJqU

    I have also tired to use the + to replace the + but get the same result.

    Any idea how I can get around this?
     
  2. menriquez

    menriquez

    Joined:
    Mar 10, 2006
    Messages:
    16
    try POST-ing the request instead, and using the $_POST array to retrieve the string. i could well be that the browser is parsing and eliminating the odd characters before sending the string.

    http://www.w3schools.com/php/php_post.asp

    good luck
    - mark
     
  3. mstyers

    mstyers Thread Starter

    Joined:
    Jun 10, 2004
    Messages:
    71
    I can't use the $_POST because I haven't posted yet.

    I was able to resolve this using %2B for the + sign. 2B is the hex value for the + sign. Also, found that it has to be 2B and not 2b.

    Ex. script.php?var=eJwrSiotSc5ILXIwLAbS%2BnJqU
    $_GET['var'] = eJwrSiotSc5ILXIwLAbS+nJqU
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/753890

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice