Search code examples
htmlformsurlhttp-posthttp-get

Passing form variables through URL


What I want to accomplish is logging in to a website by simply typing in the form variables in the URL.

HTML code:

    <form action="httpclient.html" onsubmit="return checkSubmit();" method="post"           target="_parent" name="frmHTTPClientLogin">
    <input type="hidden" name="mode" value="191">
    <label>Username</label>
    <input border="1" style="width:150px" maxlength="60" name="username">
    <label>Password</label></pre>
    <input type="password" border="1" style="width:150px" autocomplete="off" name="password" maxlength="60">

This is the relevant past of the code. Now I want to login to this site http://10.100.56.55/httpclient.html just by passing values typed in the url. Firstly is it possible. If yes then what exactly do i need to type for userame :name and password being pass ? and what encoded URL will be passed in POST method if any?


Solution

  • If you want to type the Querystring in for the username and password, you need to do this in the address field of your browser:

    http://10.100.56.55/?username=name&password=pass
    

    EDIT: You need to find out where the form is going and what it's doing. For this, you need to check what the submit javascript function called 'checkSubmit()' is doing. You can do this by opening the page in your browser and doing a view source. If the javascript is external to the html file, check the js links on the page and open those up to find that function. The function might have the querystring parameters you're looking for.