Blogger

Home » , » การติดตั้งแบบแสดง List ของโรงแรมด้วย PHP

การติดตั้งแบบแสดง List ของโรงแรมด้วย PHP

ขอแนะนำเวอร์ชั่น PHP ในการแสดงรายชื่อโรงแรม ตามจังหวัด เรียงตามสถานที่ตั้งในรูปแบบมาตรฐาน
โค้ดที่ระบบให้มา

<div id="MYLIST1" class="centertable">
<?php # DIV,P or TD container with an "id" is REQUIRED.
$partner = "AGENCY.DOMAIN"; # replace it by your R24-registered domain name. Required.
$region = "huahin";   # replace "huahin" by whatever region you want to call initially
$defcur = "EUR";        # optional. To set a DEFAULT currency
# $province = NN                  # optional. Use province cod
e instead of region (alternative to 'region' parameter) # $sorting = "l"; # optional. To set a DEFAULT sorting [n]=name, [l]=location, [r]rates # $search = "..."; # optional. Search/filter by a name/location substring (overwrites region and province) # $promote = "1"; # optional. To filter by recommended and promoted hotels # $rating = "3"; # optional. To set a star rating range # $frame = "_self"; # optional. To set a target frame for hotelpages, e.a. same window. Default is _blank $target = "http://www.sawadee.com/hotel/"; # set your own destination domain for hotel pages # don't change remaining code below this line $thispage = "http://".$_SERVER['HTTP_HOST'].$_SERVER["SCRIPT_NAME"]."&ip=".$_SERVER['REMOTE_ADDR']."&cooki=".$_COOKIE['paramsR24']; $thelink = "http://www.R24DB.com/R24a/R24.php?p=".$partner."&r=".$region."&pv=".$province."&cur=".$defcur."&loc=".urlencode($search); $thelink .= "&sorts=".$sorting."&promo=".$promote."&stars=".$ratings."&domain=".urlencode($target)."&caller=".$thispage; echo file_get_contents ($thelink); ?> </div>
เปลี่ยนโค้ดดังต่อไปนี้
$partner = "AGENCY.DOMAIN"; // ตรงนี้ต้องเปลี่ยนเป็นโดเมนของท่านเองตัวอย่างผมใส่ของผมเข้าไปแทน$region = "huahin"; // สถานที่ต้องการให้แสดง
$defcur = "EUR"; // ประเภทของเงินถ้าต้องการแสดงเป็นเงินบาทก็ให้ใส่ THB
อันนี้ผมจะใส่ของผมละกันครับ
$partner = "kohphanganbooking.com";
$region = "kohphangan"; $defcur = "THB";
เมื่อผมเปลี่ยนทุกอย่างเสร็จแล้วผมเซฟเป็นชื่อไฟล์ว่า phanganhotels.php ครับทีนี้ลองรับบนโฮสครับ ก็จะได้ดังภาพข้างล่างครับ  คลิ๊กเพื่อดูตัวอย่างได้ที่นี่


0 ความคิดเห็น:

Post a Comment