|
 |
|
สอบถาม " Curl Permission " ครับ You don't have permission to access 'xxx' on this server. |
|
 |
|
|
 |
 |
|
เขียน code ไว้ยังไงบ้างครับ ลองเอามาดูครับ
|
 |
 |
 |
 |
Date :
2012-06-19 06:27:18 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
<?php
function get_content($URL) {
$ch = curl_init();
$timeout = 0; // set to zero for no timeout
$useragent="Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)";
curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
curl_setopt ($ch, CURLOPT_URL, $URL);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$String = curl_exec($ch);
curl_close($ch);
return $String;
}
$data = get_content('http://www.test.com/webboard/follow.php3?postid=123456');
$result = substr($data,strpos($data,'checksum/index.php?imgnum=')+29,80);
echo $result;
?>
รบกวนตรวจสอบส่วนของ curl ให้ด้วยครับ ผล Result มันแสดงเป็น F//DTD HTML 2.0//EN">
คือเนื้อหาตั้งแต่ String 29 ขึ้นไป คือ ความ error ของ page
Code
You don't have permission to access /webboard/followup.php3 on this server.
รบกวนด้วยครับ ขอบคุณครับ
พอดีเริ่มศึกษา ยังไม่เข้าใจรูปแบบการทำงานต่างๆเท่าใดนัก เลยลองสั้นๆ ก่อน T_T แต่ Error ซะละ
|
ประวัติการแก้ไข 2012-06-19 09:18:24
 |
 |
 |
 |
Date :
2012-06-19 09:17:29 |
By :
blackedition |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 03
|