Encrypted Query Problem

Discussion in 'PHP' started by RobinDeanDotCom, Nov 13, 2007.

  1. #1
    Hello all,

    I have a custom encrypted query which reads like this ...

    http://localhost/index.php?dhfgzdjf...nbvcxpoiuyhgfdslkjhggfdsahgfdshgfdskjhgfkjhgf

    My encryption / decryption translator is already covered.

    How do I ...

    1) grab everything after the question mark
    2) create variable values from the (decrypted) string for use in my php doc?

    I've been having trouble finding any information on this. Thanks in advance.
     
    RobinDeanDotCom, Nov 13, 2007 IP
  2. TwistMyArm

    TwistMyArm Peon

    Messages:
    931
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You should just be able to do something like:
    $the_encrypted_query = $_SERVER[ 'QUERY_STRING' ];

    and use it as normal. Just remember, there is a limit to the length of allowable query strings. Unfortunately this limit changes depending on the client and the server.
     
    TwistMyArm, Nov 13, 2007 IP
  3. Remotay

    Remotay Well-Known Member

    Messages:
    2,426
    Likes Received:
    61
    Best Answers:
    0
    Trophy Points:
    140
    #3
    Try google.com
     
    Remotay, Nov 13, 2007 IP
  4. RobinDeanDotCom

    RobinDeanDotCom Peon

    Messages:
    25
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks Twist,

    Using $_SERVER[ 'QUERY_STRING' ] did exactly as you said it would.

    If I call my decryption function ... $some_variable = decrypt($_SERVER['QUERY_STRING']); ... how do I get the resulting variables to be used out of the $some_variable product?
     
    RobinDeanDotCom, Nov 13, 2007 IP
  5. commandos

    commandos Notable Member

    Messages:
    3,648
    Likes Received:
    329
    Best Answers:
    0
    Trophy Points:
    280
    #5
    depend what's in the variable ...

    what does the result query looks like ?
     
    commandos, Nov 13, 2007 IP
  6. Fash

    Fash Peon

    Messages:
    37
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Depending on how your decrypt() works, list() might be a good idea.
     
    Fash, Nov 13, 2007 IP
  7. RobinDeanDotCom

    RobinDeanDotCom Peon

    Messages:
    25
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    My query looks something like this ...

    display=audio&track=trunkfullofpunkfunk&bandwidth=hiband&validate=2358966996708

    Actually, scratch that, the resulting STRING looks like that.

    Now that I have a string, how do I convert it into a series of variable values?
     
    RobinDeanDotCom, Nov 13, 2007 IP
  8. commandos

    commandos Notable Member

    Messages:
    3,648
    Likes Received:
    329
    Best Answers:
    0
    Trophy Points:
    280
    #8
    commandos, Nov 14, 2007 IP
  9. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #9
    nico_swd, Nov 14, 2007 IP
  10. commandos

    commandos Notable Member

    Messages:
    3,648
    Likes Received:
    329
    Best Answers:
    0
    Trophy Points:
    280
    #10
    10x nico :) , much much better :D
     
    commandos, Nov 14, 2007 IP
  11. RobinDeanDotCom

    RobinDeanDotCom Peon

    Messages:
    25
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Thanks! That worked.
     
    RobinDeanDotCom, Nov 16, 2007 IP