<html>
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<!--<script async src="https://www.googletagmanager.com/gtag/js?id=UA-135169335-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'UA-135169335-1');
</script>
-->
</head>

</html>
<?php
	$param="";
	if($_GET)
	{
		foreach($_GET as $param => $value);
		if(isset($param)) $uniq_seq = strtok($param,"A");
		include "./config/config.php";
		$sql_query="select link from NOTE where no= ? limit 1";
		$stmt = $conn->stmt_init();
		$stmt = $conn->prepare($sql_query);
		$stmt->bind_param("s", $uniq_seq);
		$stmt->execute();
		$result = $stmt->get_result();
		if($result->num_rows===0){ }
		else 
		{ 
			$data = $result->fetch_assoc(); 
			echo ("<script> document.location='".$data['link']."';</script>");
		}
		exit(1);
	}
	else
	{
		session_start();
		if(isset($_SESSION['user']))
		{
			echo ("<script> document.location='/main.php';</script>");
		}
		else
		{
			echo ("<script> document.location='/login.php';</script>");
		}
	}
?>
