Whay type of encoding is this?

Discussion in 'PHP' started by ridesign, Oct 6, 2009.

  1. #1
    Can you solve this?

    I have a url:
    PAZG/dsummary.aspx?offercode=DSL0PP152

    Which needs to be encoded as:
    PAZG%252Fdsummary.aspx%3Foffercode%3DDSL0PP152

    I have tried urlencode, but then instead of %252F I get %2F, but the rest of it seems correct.

    Is there other way to encode to get to what I need?
     
    ridesign, Oct 6, 2009 IP
  2. premiumscripts

    premiumscripts Peon

    Messages:
    1,062
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #2
    %252F is simply %2F encoded. So it's encoded twice. You can see this here:

    http://www.string-functions.com/urldecode.aspx

    Type %252F in the box and decode it. It will show %2F. urldecode is correct, and whatever you did before was wrong.
     
    premiumscripts, Oct 6, 2009 IP
  3. ridesign

    ridesign Peon

    Messages:
    294
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    so is the "/" the only bit which is being encoding twice?
     
    ridesign, Oct 6, 2009 IP