Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Senior Coder
    Join Date
    Dec 2005
    Location
    Slovenia
    Posts
    1,994
    Thanks
    120
    Thanked 76 Times in 76 Posts

    submit form/url parameters

    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 ?
    Found a flower or bug and don't know what it is ?
    agrozoo.net galery
    if you don't spot search button at once, there is search form:
    agrozoo.net galery search

  • #2
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    What are you using/doing to try and read the url?

  • #3
    Senior Coder
    Join Date
    Dec 2005
    Location
    Slovenia
    Posts
    1,994
    Thanks
    120
    Thanked 76 Times in 76 Posts
    java code:
    Code:
    foo = request.getParameter("foo");
    Code:
    <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 ?
    Found a flower or bug and don't know what it is ?
    agrozoo.net galery
    if you don't spot search button at once, there is search form:
    agrozoo.net galery search

  • #4
    New Coder
    Join Date
    Sep 2011
    Location
    United Kingdom
    Posts
    74
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Code:
    <form action="..<%=request.getServletPath()%>" method="post">
    You have to change the method to GET (it is not POST).
    Code:
    <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 )

  • Users who have thanked clausrei for this post:

    BubikolRamios (02-23-2012)


  •  

    Posting Permissions

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