开发者

Passing form variables through URL

开发者 https://www.devze.com 2023-03-30 11:54 出处:网络
What I want to accomplish is logging in to a website by simply typing in the form variables in the 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>
  开发者_如何学JAVA  <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?


Change method="post" to method="get"


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.


<input type="text" class="form-control" placeholder="Products" name="search" value="search" id="search">
<input type="text" class="form-control" placeholder="Products" name="search" value="search" id="search2">
<button type="submit" class="btn btn-default" onclick="location.href='\search.php?search='+ document.getElementById('search').value+'&search2='+document.getElementById('search2').value;"> Search</button>


the issue was in the input tag <input type="hidden" name="min_price" value="200"> forward slash was missing,I have added the forward slash and it works now <input type="hidden" name="min_price" value="200"/>.


It's not possible to do that; the form would have to use the GET method.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号