-5

I came across this in my sever. And I was wondering what these PHP codes do.

<?php
    $request_method = $_SERVER["REQUEST_METHOD"];
    if($request_method == "GET"){
      $query_vars = $_GET;
    } elseif ($request_method == "POST"){
      $query_vars = $_POST;
    }
    reset($query_vars);
    $t = date("U");

    $file = $_SERVER['DOCUMENT_ROOT'] . "/../data/gdform_" . $t;
    $fp = fopen($file,"w");
    while (list ($key, $val) = each ($query_vars)) {
     fputs($fp,"<GDFORM_VARIABLE NAME=$key START>\n");
     fputs($fp,"$val\n");
     fputs($fp,"<GDFORM_VARIABLE NAME=$key END>\n");
     if ($key == "redirect") { $landing_page = $val;}
    }
    fclose($fp);
    if ($landing_page != ""){
    header("Location: http://".$_SERVER["HTTP_HOST"]."/$landing_page");
    } else {
    header("Location: http://".$_SERVER["HTTP_HOST"]."/");
    }


?>

All I see is headering me to the a new destination?

4

1 回答 1

0

It stores all data sent by GET or POST to a file (a GDFORM-file, whatever that is) and then redirects the user to a specific page. So I'm guessing it's a log function of some sort.

It might be interesting to look through the files though, since login credentials and such would be stored along with other form/get-data.

于 2013-02-12T10:02:11.737 回答