PHP code

<?php
include "sql_and_php_debug.php";
mysql_connect("localhost""time2""time2");
mysql_select_db("time2");

?>
<h1>NSA</h1>
<p>Flag is in column <code>flag</code> of table <code>flag</code>.</p>
<p>We have logged your visit.</p>
<?php
$uag 
$_SERVER['HTTP_USER_AGENT'];
$ip $_SERVER['REMOTE_ADDR'];
debug_mysql_query("INSERT INTO logs (time, useragent, ip) VALUES (NOW(), '$uag', '$ip') ON DUPLICATE KEY UPDATE time = NOW(), useragent = '$uag'");

debug_mysql_query("SELECT * FROM logs ORDER BY time DESC LIMIT 10");
SQL debug

NSA

Flag is in column flag of table flag.

We have logged your visit.