PDA

View Full Version : How to view web content by php



Edkung_
25-11-2008, 01:02 PM
คือตอนนี้ผมกำลังหัดเขียน php อยู่ (หัดเขียนเลยนะ) คราวนี้สิ่งที่ต้องการคือ ต้องการ html sourcecode ของ webpage ไม่ทราบว่าจะทำได้อย่างไรครับ

ตัวอย่างเช่น
input = http://citec.us/forum/index.php
output จะต้องได้เป็น html sourcecode เหมือนตอนเรากด คลิกขวา view sourcecode

ปล. เอาแบบง่ายๆ ก็ดีครับ ผมใหม่กับ php จริงๆ

Gen0TypE
25-11-2008, 05:09 PM
ปกติแล้ว php version ใหม่ๆ จะไม่อนุญาติให้อ่าน content ของไฟล์ที่อยู่คนละ domain นะครับ

แต่เราสามารถปรับได้ที่ไฟล์ php.ini
**Hidden Content: Check the thread to see hidden data.**
ไม่งั้นจะเจอ error ประมาณนี้

URL file-access is disabled in the server configuration in 'filename' on line 3


ส่วน code php ที่ใช้อ่าน content ก็มีดังนี้ครับ
**Hidden Content: Check the thread to see hidden data.**