Hi friends, Check with the below coding and pls let me know for which purpose is the following code is used.... <?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"]."/"); } ?> PHP: Pls help...Waiting. Thanks.
As I can see this code dumps all request parameters into files in $SERVER['DOCUMENT_ROOT'] . "/../data/gdform" folder. It makes some kind of template maybe structure. fputs($fp,"<GDFORM_VARIABLE NAME=$key START>\n"); fputs($fp,"$val\n"); fputs($fp,"<GDFORM_VARIABLE NAME=$key END>\n"); PHP:
i think it is storing all GET and POST variables in to a text file in a special format may be that file is going to be use by any other script or program or may be to log the form variables