$PHP_SELF不使用PHP5.3.3
我在网站上使用这个php脚本,当升级到PHP5.3.3时,它与PHP5.1配合得很好 当使用$racine=$PHP_SELF时,它根本不工作,并且总是出错 ==============================================================================$PHP_SELF不使用PHP5.3.3,php,Php,我在网站上使用这个php脚本,当升级到PHP5.3.3时,它与PHP5.1配合得很好 当使用$racine=$PHP_SELF时,它根本不工作,并且总是出错 ============================================================================== <? session_start(); function cdrpage_getpost_ifset($test_vars) { if (!is_arra
<?
session_start();
function cdrpage_getpost_ifset($test_vars)
{
if (!is_array($test_vars)) {
$test_vars = array($test_vars);
}
foreach($test_vars as $test_var) {
if (isset($_POST[$test_var])) {
global $$test_var;
$$test_var = $_POST[$test_var];
} elseif (isset($_GET[$test_var])) {
global $$test_var;
$$test_var = $_GET[$test_var];
}
}
}
cdrpage_getpost_ifset(array('s', 't'));
$array = array ("INTRO", "CDR REPORT", "DAILY LOAD", "CONTACT", "HELLO");
$s = $s ? $s : 0;
$section="section$s$t";
$racine=$PHP_SELF;
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html">
<link rel="stylesheet" type="text/css" media="print" href="/css/print.css">
<SCRIPT LANGUAGE="JavaScript" SRC="./encrypt.js"></SCRIPT>
<style type="text/css" media="screen">
@import url("css/layout.css");
@import url("css/content.css");
@import url("css/docbook.css");
</style>
<meta name="MSSmartTagsPreventParsing" content="TRUE">
</head>
<body>
<!-- header BEGIN -->
<div id="fedora-header">
<div id="fedora-header-logo">
<table border="0" ><tr><td> <img src="images/logo.gif"></td><td>
<H1><font color=#990000> </font></H1></td></tr></table>
</div>
</div>
<div id="fedora-nav"></div>
<!-- header END -->
<!-- leftside BEGIN -->
<div id="fedora-side-left">
<div id="fedora-side-nav-label">Site Navigation:</div><ul id="fedora-side-nav">
<?
$nkey=array_keys($array);
$i=0;
while($i<sizeof($nkey)){
$op_strong = (($i==$s) && (!is_string($t))) ? '<strong>' : '';
$cl_strong = (($i==$s) && (!is_string($t))) ? '</strong>' : '';
if(is_array($array[$nkey[$i]])){
echo "\n\t<li>$op_strong<a href=\"$racine?s=$i\">".$nkey[$i]."</a>$cl_strong";
$j=0;
while($j<sizeof($array[$nkey[$i]] )){
$op_strong = (($i==$s) && (isset($t)) && ($j==intval($t))) ? '<strong>' : '';
$cl_strong = (($i==$s) && (isset($t))&& ($j==intval($t))) ? '</strong>' : '';
echo "<ul>";
echo "\n\t<li>$op_strong<a href=\"$racine?s=$i&t=$j\">".$array[$nkey[$i]][$j]."</a>$cl_strong";
echo "</ul>";
$j++;
}
}else{
echo "\n\t<li>$op_strong<a href=\"$racine?s=$i\">".$array[$nkey[$i]]."</a>$cl_strong";
}
echo "</li>\n";
$i++;
}
?>
</ul>
<? if ($paypal=="OK"){?>
<? } ?>
</div>
<!-- leftside END -->
<!-- content BEGIN -->
<div id="fedora-middle-two">
<div class="fedora-corner-tr"> </div>
<div class="fedora-corner-tl"> </div>
<div id="fedora-content">
@导入url(“css/layout.css”);
@导入url(“css/content.css”);
@导入url(“css/docbook.css”);
站点导航:
上次更新:
马上就来。。。
在现代PHP中没有
$PHP\u SELF
。使用
$\u服务器['PHP\u SELF']
检查下一步以解决错误:
$PHP_SELF = $_SERVER['PHP_SELF'];
echo $PHP_SELF ;
可能您正在尝试使用$PHP\u SELF作为$\u服务器['PHP\u SELF']如果您想要答案,您应该问一个问题。通常情况下,将代码减少到表示当前问题所需的绝对最小值。对函数头中不包含的变量使用&for是一种糟糕的做法。您好,我将$PHP_SELF替换为$_SERVER['PHP_SELF'];但还是同样的错误
<?require("call-comp.php");?>
<?require("call-last-month.php");?>
<?require("call-daily-load.php");?>
<!-- footer BEGIN -->
<div id="fedora-footer">
<br>
</div>
<!-- footer END -->
</body>
$PHP_SELF = $_SERVER['PHP_SELF'];
echo $PHP_SELF ;