SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Wizard subnet_rx's Avatar
    Join Date
    Aug 2001
    Location
    Hattiesburg, MS
    Posts
    1,085
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Form adding weird data

    It may just be my limited use of GET, but when I submit my search form, I'm getting this data added to the end of the query?

    Code:
    &search.x=5&search.y=15
    Where does this come from? The fact that I'm using a submit image instead of the default button?

  2. #2
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,476
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    (Bear with me, I'm really really tired and not feeling very well either.)

    When you use GET, the query gets attached to the URL string so it can be referenced later on. It does have some security issues, but is also very useful; for instance, if you wanted to send someone a link of search results for a particular keyword or group of keywords.

    If you don't want the query to be attached to the URL string, try using POST instead.

  3. #3
    SitePoint Wizard subnet_rx's Avatar
    Join Date
    Aug 2001
    Location
    Hattiesburg, MS
    Posts
    1,085
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry to hear that Dan, but thanks for replying. Well, I have to use GET because I'm using a search api. It is one field, labeled query with a image submit button. What I can't figure out is, why search.x and search.y are added to the string.

  4. #4
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,476
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You're going to want to look at the server-side code (I'm presuming you're using PHP and MySQL for this - ASP and Microsoft SQL Server would probably be what you're using if you're having to deal with M$'s products).

  5. #5
    SitePoint Guru
    Join Date
    Sep 2004
    Location
    NY, USA
    Posts
    712
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by subnet_rx
    What I can't figure out is, why search.x and search.y are added to the string.
    Those are the coordinates of the mouse click on the image type submit button that get sent along with the rest of the form data.

    Yes, it's an effect of using type="image" as your submit button.

  6. #6
    SitePoint Wizard subnet_rx's Avatar
    Join Date
    Aug 2001
    Location
    Hattiesburg, MS
    Posts
    1,085
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by cringer
    Those are the coordinates of the mouse click on the image type submit button that get sent along with the rest of the form data.

    Yes, it's an effect of using type="image" as your submit button.
    Thanks cringer and Dan. That explains it, although I wasn't aware that it added that automatically.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •