PHP:
$iphone = strpos($_SERVER['HTTP_USER_AGENT'], ‘iPhone’); $ipod = strpos($_SERVER['HTTP_USER_AGENT'], ‘iPod’); if($iphone || $ipod){ header(‘Location: http://m.example.com/’); }
JavaScript:
if((navigator.userAgent.indexOf(‘iPhone’) != -1) || (navigator.userAgent.indexOf(‘iPod’) != -1)){ document.location = “http://m.example.com/”; }
ที่มา: http://eugen.io/2009/12/setting-up-your-web-site-to-run-on-iphone-browser/
Codeiginer มี pagination class เพื่อช่วยในการจัดแบ่งข้อมูลที่จะนำแสดงบนเว็บ โดยผู้ใช้สามารถกำหนดได้ว่าในแต่ละหน้านั้น จะให้แสดงจำนวนข้อมูลจำนวนเท่าใด โดยจะมีการทำลิ้งก์ให้เลือกหน้าถัดไปหรือย้อนหลังให้อัตโนมัติ เช่น
ตัวอย่างการใช้งาน
$this->load->library(‘pagination’); $config['base_url'] = ‘http://example.com/index.php/test/page/’; $config['total_rows'] = ’200′; $config['per_page'] = ’20′; $this->pagination->initialize($config); echo $this->pagination->create_links();
องค์ประกอบเบื้องต้น
ตัวแปร $config จากตัวอย่างข้างต้น ใช้ในการกำหนดองค์ประกอบที่ต้องการ โดยสามารถสร้างไฟล์สำหรับเก็บตัวแปร $config ชื่อ pagination.php แยกไว้ต่างหาก [...]
Tags
.htaccess Apache blogspot CentOS codeigniter CSS domain name driver Drupal Flickr Hotmail HTML internet law linux mailing list mailman MICT mod_rewrite monitor MSL MySQL name server Network open source PHP Postfix Security Smarty sony Spammail SPF theme TLS traffic log Universiade UTF-8 UTF8 vbulletin Wordpress การเมือง จตุคาม รูปภาพ สถิติ เรารักในหลวง
