//オリンピアキャンペーン用 2006/07/31
// check agent
//
define("iMode_ADR", "http://olympia.oi.commseed.jp/qr/qr.php?uid=NULLGWDOCOMO");
define("EzWAP_ADR", "http://olympia.oe.commseed.jp/qr/qr.php");
define("EzHdml_ADR", "http://olympia.oe.commseed.jp/qr/qr.php");
define("Vodafone_ADR","http://olympia.ov.commseed.jp/qr/qr.php");
//define("iMode_ADR", "http://iol.commseed.net/camp-qr/index2.xhtml");
//define("EzWAP_ADR", "http://eol.commseed.net/camp-qr/index2.xhtml");
//define("Vodafone_ADR","http://vol.commseed.net/camp-qr/index2.xhtml");
define("DEFAULT_FROM", "go_olympia");
function main ()
{
$from = $_REQUEST["from"];
$op = $_REQUEST["op"];
if ($from == "") {
$from = DEFAULT_FROM;
}
switch (CheckAgent()) {
case 'iMode':
htmlJump(iMode_ADR."&from=".$from."&op=".$op);
break;
case 'EzWAP':
htmlJump(EzWAP_ADR."?from=".$from."&op=".$op);
//htmlJump(EzWAP_ADR);
break;
case 'EzHdml':
hdmlJump(EzHdml_ADR."?from=".$from."&op=".$op);
//hdmlJump(EzHdml_ADR);
break;
case 'Vodafone':
htmlJump(Vodafone_ADR."?from=".$from."&op=".$op);
//htmlJump(Vodafone_ADR);
break;
default:
echo "Page not found.";
break;
}
}
// ---------------------------------------------
// iMode DoCoMo/
// EzHdml UP.Browser/
// EzWAP KDDI-XXXX UP.Browser/
// Vodafone J-PHONE/
//
// check HTTP_USER_AGENT and HTTP_X_JPHONE_MSNAME
// ---------------------------------------------
function CheckAgent() {
//echo "agent = (".getenv("HTTP_USER_AGENT").")
";
//echo "msname = (".getenv("HTTP_X_JPHONE_MSNAME").")
";
$as = getenv("HTTP_USER_AGENT");
if (ereg("^DoCoMo/", $as)) {
return "iMode";
} else if ((ereg("^J-PHONE/", $as)) ||
(getenv("HTTP_X_JPHONE_MSNAME") != "")) {
return "Vodafone";
} else if (ereg("^KDDI-.*UP\.Browser/", $as)) {
return "EzWAP";
} else if (ereg("^UP\.Browser/", $as)) {
return "EzHdml";
}
return "other";
}
// ---------------------------------------------
function htmlJump($adr)
{
header ("Location: ".$adr);
exit(0);
}
// ---------------------------------------------
function hdmlJump($adr)
{
header ("Content-type: text/x-hdml; charset=Shift_JIS\n\n");
print "\n";
print "\n";
print " \n";
print "\n";
print "\n";
exit(0);
}
main();
?>