ยินดีต้อนรับคุณ, บุคคลทั่วไป กรุณา เข้าสู่ระบบ หรือ ลงทะเบียน
ส่งอีเมล์ยืนยันการใช้งาน?

» Enter Pinkkeyhost Website «

เว็บโฮสติ้ง Pinkkeyhost :: Support Center
Pinkkeyhost
หน้า: 1
  พิมพ์  
ผู้เขียน หัวข้อ: การ Forward หน้าเวบไปยังที่อื่น  (อ่าน 10841 ครั้ง)
0 สมาชิก และ 1 บุคคลทั่วไป กำลังดูหัวข้อนี้
PinkkeyHost
Online Supported
Administrator
Sr. Member
*****
ออฟไลน์ ออฟไลน์

กระทู้: 363


« เมื่อ: 07 ก.ค. 2006 21:00 »

สำหรับการ Forward หน้าเวบไปยังที่อื่นนั้นทำได้หลายวิธี ขอแนะนำ 2 วิธีง่ายๆที่นิยมกันดังนี้ครับ

1.Redirect
เป็นการ Redirect ไปยังอีก url หนึ่ง ซึ่งในช่อง url ก็จะแสดงเป็น url ที่ใหม่
เช่นพิมพ์ http://www.start.com ก็จะไปยัง http://www.destination.com โดยในช่อง url จะแสดงเป็น http://www.destination.com
โดยการสร้างไฟล์ index.php ดังนี้
โค๊ด:
<?php
header
("location:http://www.destination.com/path/file");
?>

ตัวอย่าง http://demo.pinkkeyhost.com/forward.php >> http://demo.pinkkeyhost.com/smeweb/index.php

2. URL Frame
เป็นการนำหน้าเวบอีกแห่งหนึ่งมาแสดงภายใต้ url ของเรา
เช่นพิมพ์ http://www.start.com ก็จะแสดงข้อมูลของหน้า http://www.destination.com โดยในช่อง url จะยังแสดงเป็น http://www.start.com
ทำได้โดยการสร้างไฟล์ index.html ดังนี้
โค๊ด:
<html><head><title>Your Title</title></head>
<frameset cols="*">
<frame name="main" src="http//www.destination.com/path/file" scrolling="auto" noresize>
<noframes>
<body>
<center>
Your browser does not support frames<br>
Please click <a href="same url as above">here</a> to enter.
</center>
</body>
</noframes>
</frameset>
</html>
ตัวอย่าง http://demo.pinkkeyhost.com/frame.html (frame https://demo.pinkkeyhost.com/smeweb/index.php)

ปล. สามารถสร้างไฟล์ชื่ออื่นๆนอกจาก index ก็ได้แต่เวลาเรียกต้องระบุชื่อไฟล์ด้วยครับ
บันทึกการเข้า

หน้า: 1
  พิมพ์  
 
กระโดดไป:  

PinkkeyHost.com - บริการ เว็บโฮสติ้ง จดโดเมน Co-Location & Dedicated Server

reduce website downtime
Powered by SMF 1.1.16 | SMF © 2006-2007, Simple Machines | Thai language by ThaiSMF
XHTML | CSS | Aero79 design by Bloc
หน้านี้ถูกสร้างขึ้นภายในเวลา 0.059 วินาที กับ 20 คำสั่ง