调试结果就一句话: Fatal error: Call to undefined function: virtual() in
d:\usr\www\html\guest.php on line 1
1-67行如下:
本人用的是 Apache+PHP+MySQL服务器套件 v1.1.0
服务器系统:XP SP2 开发工具:Macromedia Dreamweaver 8
大侠们帮帮忙看下吧...小生感激不尽.........[ 本帖最后由 NIGHTKING 于 2008-8-19 11:22 编辑 ]







最新回复
all to undefined function: virtual()
virtual函数没有定义
可能是你没有讲定义这个函数的文件包含进来,
第一句改成
[ 本帖最后由 七月十五 于 2008-8-19 10:56 编辑 ]
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_diskenth = "localhost";
$database_diskenth = "diskenth";
$username_diskenth = "root";
$password_diskenth = "";
$diskenth = mysql_pconnect($hostname_diskenth, $username_diskenth, $password_diskenth) or trigger_error(mysql_error(),E_USER_ERROR);
?>
(PHP 3, PHP 4, PHP 5)
virtual -- Perform an Apache sub-request
说明
bool virtual ( string filename )
virtual() is an Apache-specific function which is equivalent to <!--#include virtual...--> in mod_include. It performs an Apache sub-request. It is useful for including CGI scripts or .shtml files, or anything else that you would parse through Apache. Note that for a CGI script, the script must generate valid CGI headers. At the minimum that means it must generate a Content-type header.
To run the sub-request, all buffers are terminated and flushed to the browser, pending headers are sent too.
此函数仅在 PHP 作为 Apache 模块安装时才可使用
调试得:
Warning: main(/Connections/diskenth.php): failed to open stream: No such file or directory in d:\usr\www\html\guest.php on line 1
Fatal error: main(): Failed opening required '/Connections/diskenth.php' (include_path='.;c:\php4\pear') in d:\usr\www\html\guest.php on line 1
改为<?php require_once('/Connections/diskenth.php'); ?>,调试得:
Warning: main(/Connections/diskenth.php): failed to open stream: No such file or directory in d:\usr\www\html\guest.php on line 1
Fatal error: main(): Failed opening required '/Connections/diskenth.php' (include_path='.;c:\php4\pear') in d:\usr\www\html\guest.php on line 1
假如把virtual()改成include(),页面和表单都能正常显示,但是留言后得:
Warning: main(/Connections/diskenth.php): failed to open stream: No such file or directory in d:\usr\www\html\guest.php on line 1
Warning: main(): Failed opening '/Connections/diskenth.php' for inclusion (include_path='.;c:\php4\pear') in d:\usr\www\html\guest.php on line 1
Notice: Undefined variable: database_diskenth in d:\usr\www\html\guest.php on line 40
Notice: Undefined variable: diskenth in d:\usr\www\html\guest.php on line 40
Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in d:\usr\www\html\guest.php on line 40
Notice: Undefined variable: diskenth in d:\usr\www\html\guest.php on line 41
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in d:\usr\www\html\guest.php on line 41
假如把virtual()改成require(),调试后得:
Warning: main(/Connections/diskenth.php): failed to open stream: No such file or directory in d:\usr\www\html\guest.php on line 1
Fatal error: main(): Failed opening required '/Connections/diskenth.php' (include_path='.;c:\php4\pear') in d:\usr\www\html\guest.php on line 1
关于7楼大虾的答案....小生看不懂....
我用的是Apache v1.3.29 (Win32) PHP v4.3.4 (Win32) 开发工具是Macromedia Dreamweaver 8
[ 本帖最后由 NIGHTKING 于 2008-8-19 11:24 编辑 ]
如果是用DW的话,你的留言本页面应该是在根目录下。如果你的留言本在文件夹下,呵呵!应该:
require_once("Connections/diskenth.php");