簡體   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