[問題] ajax用include/require讀不到檔
※ [本文轉錄自 Ajax 看板]
作者: meemily (我每天都php了) 看板: Ajax
標題: [問題] ajax用include/require讀不到檔(路徑是對的)
時間: Sun May 25 17:36:43 2008
問題:使用include/require讀不到檔
他的錯誤訊息是:
Warning: include(/xajax_core/xajax.inc.php) [function.include]: failed to
open stream: No such file or directory in C:\AppServ\www\test.php on line 5
Warning: include() [function.include]: Failed opening
'/xajax_core/xajax.inc.php' for inclusion (include_path='.;C:\php5\pear') in
C:\AppServ\www\test.php on line 5
Fatal error: Class 'xajax' not found in C:\AppServ\www\test.php on line 9
以下是程式碼 警告的行 我有用綠色標出來
<?php
header("content-type:text/html;charset=utf-8");
date_default_timezone_set('Asia/Taipei');
define(msg_max,15);
include("/xajax_core/xajax.inc.php");
//這個檔和xajax_core資料夾放同一層目錄
//include("/xajax/xajax_core/xajaxResponse.inc.php");
//include("/xajax/xajax_core/xajaxRequest.inc.php");
//include("/xajax/xajax_core/xajaxCall.inc.php");
$xajax= new xajax();
$xajax->registerFunction('send');//送出;註冊send這個函式
$xajax->registerFunction('read');//讀取
$xajax->processRequest();//處理非同步
function send($username,$chatmsg)
{
//取得ip
if ( !empty($_SERVER["HTTP_X_FORWARDED_FOR"]) )
{
$temp_ip = split(",", $_SERVER["HTTP_X_FORWARDED_FOR"]);
$user_ip = $temp_ip[0];
}
else
{
$user_ip = $_SERVER["REMOTE_ADDR"];
}
//取得ip
$getdate=date('Y-m-d a h:i:s');//取得時間
$link = odbc_connect("phpdata", "", "")
or die("錯誤! 開啟ODBC資料庫連結失敗!<br>");
$sql = "SELECT * FROM chatdata"; // 建立SQL指令
$result = odbc_exec($link , $sql)
or die("錯誤! 無法執行SQL查詢!<br>");
if(($username !="")&&($chatmsg !=""))
{
//寫入資料庫
//string iconv ( string $in_charset, string $out_charset, stri
$str )
//$in_charset是目前字串的編碼,$out_charset是要轉換的字串編碼,
$str是要轉換的字串
$con_user=mb_convert_encoding($username,"big5","utf8");
$con_msg=mb_convert_encoding($chatmsg,"big5","utf8");
$sql="INSERT INTO chatdata (chat1,chat2,chat3,chat4)
VALUES('$con_user','$con_msg','$user_ip','$getdate')";
$result = odbc_exec($link ,$sql)
or die("錯誤! 無法執行SQL查詢!<br>");
odbc_free_result($result); // 釋放佔用的記憶體
}
odbc_close($link);
}
?>
我的電腦
The AppServ Open Project - 2.5.9 for Windows
phpMyAdmin Database Manager Version 2.10.2
PHP Information Version 5.2.3
About AppServ Version 2.5.9 for Windows
AppServ is a merging open source software installer package for Windows
includes :
Apache Web Server Version 2.2.4
PHP Script Language Version 5.2.3
MySQL Database Version 5.0.45
phpMyAdmin Database Manager Version 2.10.2
ajax版本是用這個
xajax_0.5_beta_4b_Full.zip
謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 219.81.236.168
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 219.81.236.168
推
05/25 18:08, , 1F
05/25 18:08, 1F
推
05/25 18:13, , 2F
05/25 18:13, 2F
→
05/25 18:14, , 3F
05/25 18:14, 3F
→
05/25 18:21, , 4F
05/25 18:21, 4F
推
05/25 18:42, , 5F
05/25 18:42, 5F
→
05/25 18:47, , 6F
05/25 18:47, 6F
→
05/25 18:48, , 7F
05/25 18:48, 7F
推
05/26 23:35, , 8F
05/26 23:35, 8F
→
05/26 23:36, , 9F
05/26 23:36, 9F
→
05/26 23:36, , 10F
05/26 23:36, 10F
→
05/27 22:03, , 11F
05/27 22:03, 11F
PHP 近期熱門文章
PTT數位生活區 即時熱門文章