Skip to content

Commit d168f98

Browse files
authored
Update NetPHP.php
1 parent 8291b08 commit d168f98

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

NetPHP.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,6 @@ function useragent() {
3232
return "Mozilla/5.0 (Windows NT 6.1; r…) Gecko/20100101 Firefox/60.0";
3333
return "Mozilla/5.0(Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36(KHTML,like Gecko) curlrome/68.0.3440.106 Mobile Safari/537.36";
3434
}
35-
function store_token($response) {
36-
preg_match_all("/name=\"\_token\" value=\"(?<token>[^\"]+)\"/i",$response,$tokens);
37-
if(!isset($tokens["token"][0])) {
38-
exit("No Token value in login page!\n");
39-
}
40-
return $tokens["token"][0];
41-
}
4235
function get_headers_from_curl_response($headerContent) {
4336
$headers = array();
4437
$arrRequests = explode("\r\n\r\n",$headerContent);
@@ -157,6 +150,13 @@ function random() {
157150
// like Math.random() in JS
158151
return(float)rand()/(float)getrandmax();
159152
}
153+
function store_token($response) {
154+
preg_match_all("/name=\"\_token\" value=\"(?<token>[^\"]+)\"/i",$response,$tokens);
155+
if(!isset($tokens["token"][0])) {
156+
exit("No Token value in login page!\n");
157+
}
158+
return $tokens["token"][0];
159+
}
160160
function get_parse($content,$name) {
161161
//name="__VIEWSTATEGENERATOR" id="__VIEWSTATEGENERATOR" value=""
162162
preg_match('/name="'.$name.'" id="'.$name.'" value="(?<value>[^\"]+)"/i',$content,$values);

0 commit comments

Comments
 (0)