include "admin/includes/functions.php"; if(isset($_GET['username'])) { $output_username = $_GET['username']; } else { if(isset($_GET['category'])) { ob_start(); generate($_GET['category']); $output_username = ob_get_contents(); ob_clean(); $output_username = trim($output_username); // Prepare vars, Insert into database $time = date("Y-m-d H:i:s"); $username = addslashes($output_username); if(ctype_alpha($_GET['category'])) { $category = $_GET['category']; } else { $category = "N/A"; } $ip = $_SERVER['REMOTE_ADDR']; if(!empty($username)) { mysql_query("INSERT INTO user_log (category, username) VALUES('$category', '$username') ") or die(mysql_error()); } header("Location:{$_GET[category]}/".ucfirst($output_username)); } } ?>