繁体   English   中英

Ubuntu PHP href链接不起作用

[英]Ubuntu PHP href link not working

我的PHP版本7.0.8-0ubuntu0.16.04.3在家中的服务器上运行。

我正在尝试使用链接到文件;

<?php echo "Software Version - " . $thisVersion. "<a href=\"includes/getUpdate.php\">" . $updateAvalable . "</a>"; ?>

$ updateAvailable字符串中的文本将显示为链接,但单击时不执行任何操作。

令人困惑的是,同一段代码在我可以访问的远程服务器上运行良好。 我怀疑这可能是由于我的家庭服务器上的某些设置,但是现在我对此感到茫然。

提前加油以寻求帮助。

这里最不关代码;

$serverVersion = "ftp://ServerLogonDetails/someText.txt";
$handle = fopen($serverVersion, "r");
$latestVersion = fgets($handle);
fclose;

// Get the software version 
if (($_SESSION[Page] == "Config")||($_SESSION[Page] == "backUpRec")){
    $localVersion = "daemon_ver.txt";
    $handle = fopen($localVersion, "r") or die($openLocalFile = FALSE);
    $currentVersion = fgets($handle);
    fclose;
}
else if (($_SESSION[Page] == "System")||($_SESSION[Page] == "Users")){
    // Get the software version on the VS-One unit
    $localVersion = "../daemon_ver.txt";
    $handle = fopen($localVersion, "r") or die($openLocalFile = TRUE);
    $currentVersion = fgets($handle);
    fclose;
}

if ($latestVersion <= $currentVersion) {
    $updateAvalable = "";
}
else if ($latestVersion > $currentVersion){
    $updateAvalable = " Update Available";
}

?>

</head>
<body>

<table id="footersmall" width="940" border="0" cellspacing="10" cellpadding="0">
    <tr>
        <td class="version"><?php echo "Software Version - ".$thisVersion."<a href=\"includes/getUpdate.php\">".$updateAvalable . "</a>"; ?></td>
    </tr>
</table>
</body>
</html>

尝试以斜杠开头"<a href=\\"/includes/getUpdate.php\\">"

...如果“包含”位于网络根目录,则原因...

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM