details.php
changeset 22 52aaf1a838bd
parent 21 0bd6e7537154
child 23 7696ae981a3c
equal deleted inserted replaced
21:0bd6e7537154 22:52aaf1a838bd
    76 	}
    76 	}
    77  /*                       while ($db_fieldcache = mysql_fetch_assoc($query_cache))
    77  /*                       while ($db_fieldcache = mysql_fetch_assoc($query_cache))
    78                         {
    78                         {
    79 			$curr_reqID = $db_fieldcache["req_ID"];
    79 			$curr_reqID = $db_fieldcache["req_ID"];
    80 			$strip_url_val = remove_http($db_fieldcache['req_val']);
    80 			$strip_url_val = remove_http($db_fieldcache['req_val']);
    81 			$http_proxy = "http://localhost:8080";
    81 			$http_proxy = "http://village.n4c.eu/portal:8080";
    82 			$command2 = "squidclient -m HEAD -p 8080 -u www-data -w www-data http://localhost/router_stage/{$db_fieldcache["req_ID"]}/$strip_url_val/?uid=$uid'&'sid1=$sid1'&'sid2=$sid2 |grep MISS |awk -F \" \" '{print $2}'";
    82 			$command2 = "squidclient -m HEAD -p 8080 -u www-data -w www-data http://village.n4c.eu/portal/router_stage/{$db_fieldcache["req_ID"]}/$strip_url_val/?uid=$uid'&'sid1=$sid1'&'sid2=$sid2 |grep MISS |awk -F \" \" '{print $2}'";
    83 			exec($command2, $cache_results);
    83 			exec($command2, $cache_results);
    84 			echo $cache_results;
    84 			echo $cache_results;
    85                         // find out if site is available and update the database
    85                         // find out if site is available and update the database
    86                                 if (strpos($cache_results, "HIT") == true)
    86                                 if (strpos($cache_results, "HIT") == true)
    87                                         {
    87                                         {
    93               				if (file_exists($filename))
    93               				if (file_exists($filename))
    94                         		{
    94                         		{
    95                                         $query_update = mysql_query("UPDATE responses_tbl SET req_response = '0' WHERE req_ID = '$curr_reqID'");
    95                                         $query_update = mysql_query("UPDATE responses_tbl SET req_response = '0' WHERE req_ID = '$curr_reqID'");
    96                                         $staging = "/data/www/private/HTMLrequester/staging/";
    96                                         $staging = "/data/www/private/HTMLrequester/staging/";
    97                                         $wget_options = "--dns-timeout=1 --proxy-user=www-data --proxy-password=www-data -N -r -l 3 --no-remove-listing -p --max-redirect 10 -t 1 -d";
    97                                         $wget_options = "--dns-timeout=1 --proxy-user=www-data --proxy-password=www-data -N -r -l 3 --no-remove-listing -p --max-redirect 10 -t 1 -d";
    98                                         $command1 = "wget -P $staging $wget_options http://localhost/router_stage/{$db_fieldcache["req_ID"]}/$strip_url_val/?uid=$uid'&'sid1=$sid1'&'sid2=$sid2";
    98                                         $command1 = "wget -P $staging $wget_options http://village.n4c.eu/portal/router_stage/{$db_fieldcache["req_ID"]}/$strip_url_val/?uid=$uid'&'sid1=$sid1'&'sid2=$sid2";
    99                                        exec($command1, $wget_results);
    99                                        exec($command1, $wget_results);
   100 					}
   100 					}
   101 					else
   101 					else
   102 					{		
   102 					{		
   103                                         $query_update = mysql_query("UPDATE responses_tbl SET req_response = '0' WHERE req_ID = '$curr_reqID'");
   103                                         $query_update = mysql_query("UPDATE responses_tbl SET req_response = '0' WHERE req_ID = '$curr_reqID'");
   263 }
   263 }
   264 else
   264 else
   265 {
   265 {
   266 
   266 
   267 #$data = http_get('http://...')
   267 #$data = http_get('http://...')
   268 #$response = http_get("'http://localhost:8080'. '/router_stage/' . $db_field['req_ID'] . '/' . remove_http($db_field['req_val'] . '?' . 'uid=' . $uid . '&'  . 'sid1=' . $sid1 . '&' . 'sid2=' . $sid2");
   268 #$response = http_get("'http://village.n4c.eu/portal:8080'. '/router_stage/' . $db_field['req_ID'] . '/' . remove_http($db_field['req_val'] . '?' . 'uid=' . $uid . '&'  . 'sid1=' . $sid1 . '&' . 'sid2=' . $sid2");
   269 print "<span class='result_output'><a href='". 'http://localhost'. '/router_stage/' . $db_field['req_ID'] . '/' . remove_http($db_field['req_val'] . '?' . 'uid=' . $uid . '&'  . 'sid1=' . $sid1 . '&' . 'sid2=' . $sid2) ."' target='_blank'>View website</a></span>";
   269 #print "<span class='result_output'><a href='". 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . '/router_stage/' . $db_field['req_ID'] . '/' . remove_http($db_field['req_val'] . '?' . 'uid=' . $uid . '&'  . 'sid1=' . $sid1 . '&' . 'sid2=' . $sid2) ."' target='_blank'>View website</a></span>";
   270 #print "<span class='result_output'><a href='". 'http://localhost:8080'. '/' . remove_http($db_field['req_val'] . '?' . 'uid=' . $uid . '&'  . 'sid1=' . $sid1 . '&' . 'sid2=' . $sid2) ."' target='_blank'>View website</a></span>";
   270 
       
   271 print "<span class='result_output'><a href='". 'http://village.n4c.eu/portal'. '/router_stage/' . $db_field['req_ID'] . '/' . remove_http($db_field['req_val'] . '?' . 'uid=' . $uid . '&'  . 'sid1=' . $sid1 . '&' . 'sid2=' . $sid2) ."' target='_blank'>View website</a></span>";
       
   272 #print "<span class='result_output'><a href='". 'http://village.n4c.eu/portal:8080'. '/' . remove_http($db_field['req_val'] . '?' . 'uid=' . $uid . '&'  . 'sid1=' . $sid1 . '&' . 'sid2=' . $sid2) ."' target='_blank'>View website</a></span>";
   271 
   273 
   272 #print "<span class='result_output'><a href='". $response ."' target='_blank'>View website</a></span>";
   274 #print "<span class='result_output'><a href='". $response ."' target='_blank'>View website</a></span>";
   273 
   275 
   274 }
   276 }
   275 
   277