<?php 
$get = $_GET;
$urls = array();
$inifile = './url_ini.txt';
$defaulturl = 'http://www.argandor.jp/';

// param is t and u
// ex) jump?t=c20&u=mugi

// ini
$url_ini = parse_ini_file($inifile,TRUE);

// type
if( array_key_exists('t', $get) ) {
	$type = $get['t'];
	$urls = $url_ini[$type];
} else {
	header('Location:'.$defaulturl);
} // type

// url
if( array_key_exists('u', $get) && array_key_exists($get['u'], $urls) ) {
	$urlcode = $get['u'];
	$url = $urls[$urlcode];
} else {
	header('Location:'.$defaulturl);
} // type

// jump
if(is_array($url)){
	$rand = rand(0, sizeof($url)-1);
	$url = $url[$rand]; // overwrite
	header('Location:'.$url);
} elseif(strlen($url)>6){
	header('Location:'.$url);
} else {
	header('Location:'.$defaulturl);
}
?>