Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

$x and $y variables in the URL!

Status
Not open for further replies.

alsaffar

Programmer
Joined
Oct 25, 2001
Messages
165
Location
KW
Hi there,

I had starnge behaviour of submitting a form with GET method with image submit button,

When I submit a form I noticed there are 2 variables in the URL $x and $y although Im not using any hidden variables called $x or $y!

Why there are $x and $y variables in the URL?!
 
When you use an image submit button to submit a form, your browser sends to the server the x- and y-coordinates of where you clicked on the image.

It can be useful. Imagine a two-part button which presents graphically two actions. The script to which the form submits can then use the click coordinates to determine which action graphic the user clicked on.

Want the best answers? Ask the best questions: TANSTAAFL!!
 
Whenever you use the GET method the passed values will show up in the URL.
You can change that by submitting with the POST mehtod. That way nothing will be appended to the visible URL. The values will still be there for the receiving script, namely in $_POST (older: $HTTP_POST_VARS). That's the only way you can get rid of the vars in the URL.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top