您好,我需要一些有关 install.php 中这段代码的帮助,该代码必须在程序之前首先运行,但它会带来一个指向 fflush 的错误,我不知道该怎么办,请帮忙?
<?php
fflush();
authTableCreate();
announceTableCreate();
classTableCreate();
studentTableCreate();
classmembersTableCreate();
attendanceTableCreate();
assignmentTableCreate();
messageTableCreate();
supportTableCreate();
if (!authCheckUserExists('admin')) { // this is their first install probably
$randpass = 'admin' . mt_rand();
authAddUser('admin', $randpass, 100, 100); // create default superuser account
announceAddAnnouncement('Welcome', 'This is the default start page for IntraSchool. You should change this to something that describes how the system works within your school.');
?>
<p>Congratulations! You have successfully setup <em>IntraSchool</em>. You may now <a href="login/login.php">login</a> with the username <em>admin</em> and password <em><?=$randpass?></em>. Please change the password to something you can remember.</p>
<?php
} else {
?>
<p>The installation script has reinitialized any deleted tables.</p>
<?php
}
page_footer();
?>
最佳答案
fflush()
需要刷新文件的句柄。这可能是 flush()
的拼写错误,但是因为它显然位于文件的开头,所以根本不会执行任何操作。您应该删除该行。
但这只是一个警告,因此脚本的其余部分可能已被执行。如果它是一次性安装脚本,那么您可能不需要再次运行它。
关于php - 警告 : fflush() expects exactly 1 parameter, 0 给出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23397285/