Created
March 2, 2014 13:30
-
-
Save furahaclothing/9306578 to your computer and use it in GitHub Desktop.
荷物トラッキングの検索
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//エラー処理 | |
$kaisha = (!isset($_POST['kaisha'])) ? null : $kaisha = $_POST['kaisha']; | |
$denpyou = (!isset($_POST['denpyou'])) ? null : $denpyou = $_POST['denpyou']; | |
$submit = (!isset($_POST['submit'])) ? null : $submit = $_POST['submit']; | |
//URL設定 | |
//クロネコヤマト | |
$url['1'] = "http://jizen.kuronekoyamato.co.jp/jizen/servlet/crjz.b.NQ0010?id=".$denpyou; | |
//佐川急便 | |
$url['2'] = "http://k2k.sagawa-exp.co.jp/p/web/okurijosearch.do?okurijoNo=".$denpyou; | |
//日本郵便 ゆうパック・EXPACK・ポスパケット | |
$url['3'] = "http://tracking.post.japanpost.jp/service/singleSearch.do?org.apache.struts.taglib.html.TOKEN=&searchKind=S002&locale=ja&SVID=&reqCodeNo1=".$denpyou; | |
//伝票番号が入力されていれば検索ページを表示 | |
if (isset($denpyou)){ | |
header("Location: ".$url["$kaisha"]); | |
} | |
else { | |
?> | |
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<title>荷物追跡</title> | |
</head> | |
<body> | |
<form id="form1" name="form1" method="post" action="tracking.php" target="_blank"> | |
<label for="denpyou">伝票番号</label><br> | |
<input name="denpyou" type="text" id="denpyou" /><br> | |
<label for="kaisha">会社選択</label><br> | |
<input name="kaisha" type="radio" id="kaisha" value="1" checked /> | |
ヤマト運輸<br> | |
<input name="kaisha" type="radio" id="kaisha" value="2" /> | |
佐川急便<br> | |
<input name="kaisha" type="radio" id="kaisha" value="3" /> | |
ゆうパック・EXPACK<br> | |
<input name="submit" type="submit" id="submit" value="検索" /> | |
</form> | |
</body> | |
</html> | |
<?php | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment