...

View Full Version : submit form/url parameters



BubikolRamios
02-23-2012, 08:16 AM
if I have submit form with element named foo
should I be able to do : url?foo=something
and read that on server ?

It seems it does not work, via url I get null ?

Nightfire
02-23-2012, 11:35 AM
What are you using/doing to try and read the url?

BubikolRamios
02-23-2012, 12:22 PM
java code:


foo = request.getParameter("foo");




<form action="..<%=request.getServletPath()%>" method="post">
<select name="foo">
..


if I hit submit button, request.getParameter... gets it right
if I try: url?foo=x, I get nothing.

I thought , both should work on same variable foo ?

clausrei
02-23-2012, 02:43 PM
<form action="..<%=request.getServletPath()%>" method="post">


You have to change the method to GET (it is not POST).


<form action="..<%=request.getServletPath()%>" method="get">


The POST method is encrypted, you you will not see the parameters in the url. But the GET method send it in the URL. Doesn't matter if it arrives or not, you should see your parameters in the URL after pressing the submit button. ( ?var=something etc )



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum