1. Sean Davis
  2. webcircos

Source

webcircos / userSearch.php

<?php
$key = $_POST['key'];
$found = false;
foreach (glob('temp/' . '*') as $allfile1) {
	if(md5(substr($allfile1, 5)) == $key) {
		$found = true;
		$token = substr($allfile1, 5);
		echo "<script>var dis = document.getElementById('userID');
		var token = '$token';
		dis.type = \"hidden\";
		dis.value = token;
		dis = document.getElementById('username');
		dis.value = token;
		$('#circosForm').css('display', 'block');
		$(\"#ID\").html(token);
		$(\"#cookie\").html(\"<button type='button' onclick='Javascript: forgetCookie();'>Forget Cookie</button>\"); </script>";
	}
}
if($found == false) {
	echo "<script>window.alert('The id provided by your cookie does not match any existing sessions');
	delete_cookie('rcircostoken');</script>";
}
?>