少し基本的なヘルプが必要です。ユーザーがフォームで送信したパラメーターを使用して、その場で XML ファイルを作成しています。フォームが送信されたら、PHP コードにジャンプします。そこで、作成された XML ファイルをダウンロード/表示するための href リンクを提供したいと考えました。
これは私のコード例です:
<?php
$outputForm = 1;
if(isset($_POST['submit'])){
$outputForm = 0
//Function to generate XML file which works as expected, so that XML file is there
createXML($folderPath, $albumName, $dateOfEntry);
//My XML file is named as albumName.xml and stored in the folderPath as specified
echo '<a href = "' . $folderPath . $albumName. '.xml' . '">XML FILE</a>';
}
else{
$outputForm = 1;
}
if($outputForm == 1)
{
//Here follows my input form
<?php
}
?>
FYI:
$folderPath = 'c:/htdocs/output/';
Therefore:
$folderPath . $albumName = 'c:/htdocs/output/jessi';
In this example xml file name:
jessi.xml
出力に href リンクが表示されますが、クリックしても何も起こりません。「XML FILE」リンクの上にカーソルを移動すると、xml ファイルへのフルパスも表示されます。
PHPスクリプトにhrefリンクを埋め込んで、XMLファイルをダウンロード/表示する方法を教えてください。
ありがとう