Check the code on his landing page to see which page he is submitting to and what the variable is.
Copy Code code as follows:
<form method= "POST" action= "login.jsp" >
<table align= "center" width= "40%" style= "font-size:12px" border= "0" cellpadding= "0" cellspacing= "2" >
<tr>
<TD width= "30%" align= "right" bgcolor= "#0073AA" style= "Font-size:12px;color: #ffffff" >name:</td>
<TD width= "70%" ><input type= "text" size= "" name= "username" ></td>
</tr>
<tr>
<TD width= "30%" align= "right" bgcolor= "#0073AA" style= "Font-size:12px;color: #ffffff" >password:</td>
<TD width= "70%" ><input type= "password" "size=" Name= "passwd" ></td>
</tr>
<tr>
<TD colspan= "2" align= "right" >
<input type= "Submit" name= "Submit" value= "Login" >
<input type= "button" name= "Submit" value= "Regest" onclick= "location.href= ' regest.jsp '" ">
</td>
</tr>
</table>
</form>
Obviously, if you want to log in, you need to post the username, passwd, submit these several variables to login.jsp, and Submit=login
Use the following code:
Copy Code code as follows:
<?php
$postData = "Username=your_name&password=your_password&submit=login";
$posturl = "http://......../../login.jsp";
$POSTURL = Parse_url ($posturl);
$host = $POSTURL [host]? $POSTURL [host]: "";
$port = $POSTURL [port]? $POSTURL [port]: 80;
$path = $postUrl [path]? $POSTURL [path]: "/";
$FSP = Fsockopen ($host, $port, & $errno, & $errstr, 30);
if (! $fsp) {
Print "\nopen socket failed\n";
}else{
Fwrite ($FSP, "POST". $path. " Http/1.1\r\n ");
Fwrite ($FSP, "Accept:image/gif, Image/x-xbitmap, Image/jpeg, Image/pjpeg, Application/x-shockwave-flash, application /vnd.ms-excel, Application/vnd.ms-powerpoint, Application/msword, */*\r\n ");
Fwrite ($FSP, "accept-language:zh-cn\r\n");
Fwrite ($FSP, "content-type:application/x-www-form-urlencoded\r\n");
Fwrite ($FSP, "user-agent:mozilla/4.0" (compatible; MSIE 6.0; Windows NT 5.1; SV1; Maxthon) \ r \ n ");
Fwrite ($FSP, "Host:". $host. " \ r \ n ");
Fwrite ($FSP, "Content-length:". strlen ($postData). " \r\n\r\n ");
Fwrite ($FSP, $postData);
$resp = "";
do{
if (strlen ($out =fread ($FSP, 1024)) = = 0) break;
$resp. = $out;
}while (TRUE);
echo "<br><br>". NL2BR ($RESP);
Fclose ($FSP);
}
?>