私は自宅のサーバでPHPバージョン7.0.8-0ubuntu0.16.04.3を実行しています。Ubuntu PHP href link not working
ファイルを使用しようとしています。
<?php echo "Software Version - " . $thisVersion. "<a href=\"includes/getUpdate.php\">" . $updateAvalable . "</a>"; ?>
$ updateAvailable文字列のテキストはリンクとして表示されますが、クリックすると何も表示されません。
困惑しているのは、この同じコードが、私がアクセスできるリモートサーバーでうまく動作することです。 私のホームサーバーの設定によってはこれが疑わしいかもしれませんが、私は今これを犠牲にしています。
事前にお手伝いをしてください。
ここではほとんどコードをオフにしています。 "含まれる" 場合初め "<a href=\"/includes/getUpdate.php\">"
で
$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>
ポストHTML出力...原因で、Webルートです。 PHPを使ってHTMLを出力するだけです。 HTMLが出力されると、それをレンダリングするのはあなたのブラウザに任されます。 – Devon
あなたの書き換えられたURLはありますか?この場合、 "/"を "/includes/getUpdate.php"に追加してください。文字列に二重引用符を使用すると、文字列を使用しないようにしてください。 –
1.リモートサーバにプロジェクトルートの.htaccessファイルがありますか?もしそうなら、内容を投稿してください。(PS).htaccessは隠されています。ファイルを一覧表示するスラッシュを開始せずにリンクを作成すると、{current_url} href_contentのようなリンクが作成されます。 hrefの先頭に "/"を使用すると、{base_url} {/ href_url}のようなURLが作成されます。 – Auris