adding 25 instead of just % sign

Posted on 2011-10-11
Last Modified: 2012-08-14
I have a problem,
I am using GET to get some values passed to this file on the server, but then i want to redirect the user to a new URL but it somehow adds "25" on the end of the "%" sign which is giving me a wrong URL.
Below is the code i am using
$userid = $_GET["userId"]; 


<form action="" method="get">
     <input name="userId" type="hidden" value="<?php echo $userid?>"/> 
      <input name="R" type="hidden" value="Q"/> 
       <input name="earn" type="hidden" value="sdKa6Ro9vbdXJgr7qXDJ9w%3d%3d"/> 

  <input type="image" title="Next" id="cmdNext" name="Next" /></td></tr>

Open in new window

But it shows up as:

as you can see it add "25" after "%" and then appends "&Next.x=32&Next.y=23" for some reason...
Can you please help me out ? i need this issue solved asap..

Question by:chiboy888
    LVL 107

    Expert Comment

    by:Ray Paseur
    I think you have a URL encoding collision
    LVL 107

    Expert Comment

    by:Ray Paseur
    Please tell us how you arrived at this input value:

    <input name="earn" type="hidden" value="sdKa6Ro9vbdXJgr7qXDJ9w%3d%3d"/>

    ... And tell us what you expected to receive in the "Next" position of the GET array?

    Thanks, ~Ray

    Author Comment

    thanks ray,
    i had to replace the %3d with = sign and it does the conversion back to %3d, however it converts to %3D...does uppercase letters matter in URL's?

    Author Comment

    Hi Ray,
    I change the input value to be

     <input name="earn" type="hidden" value="sdKa6Ro9vbdXJgr7qXDJ9w=="/>
    which converts to:

    however it still appends the extra bit on the end "&Next.x=58&Next.y=27"

    which i don't know why...the Final URL should look like this:

    LVL 107

    Accepted Solution

    The "&Next.x=58&Next.y=27" part is because the submit button is an image

    input type="image"

    If you make this input type="submit" it will not transmit the image coordinates.

    Author Closing Comment

    cool mystery solved, as always, fast responses from you Ray,
    LVL 107

    Expert Comment

    by:Ray Paseur
    Thanks for the points! ~Ray

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    A Change in PHP Behavior with Session Write Short Circuit ( (Winter 2014)** With the release of PHP 5.6 the session handler changed in a way that many think should be considered a bug.  See the note …
    These days socially coordinated efforts have turned into a critical requirement for enterprises.
    In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
    The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now