$ PHP_SELF无法使用php 5.3.3

时间:2014-02-02 10:06:36

标签: php

我在网站上使用这个php脚本,当升级到PHP5.3.3时,它与PHP5.1配合得很好 当使用$ racine = $ PHP_SELF;

时,它根本不起作用并且总是出错

=============================================== ===============================

   <?
   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>&nbsp;&nbsp;&nbsp;</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">&nbsp;</div>
        <div class="fedora-corner-tl">&nbsp;</div>
        <div id="fedora-content">
<?require("call-log.php");?>
<?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>

2 个答案:

答案 0 :(得分:0)

现代 PHP中没有$PHP_SELF 使用$_SERVER['PHP_SELF']

答案 1 :(得分:0)

选中旁边的解决错误:

$PHP_SELF = $_SERVER['PHP_SELF'];
echo $PHP_SELF ;

可能你尝试使用$ PHP_SELF作为$ _SERVER ['PHP_SELF']