0
Hai frnds我是新來的PHP其實我在編碼面臨以下問題請任何人都可以提供解決方案?查詢字符串問題,如果我們使用標題
- 其實我有一個音頻播放器,我展示了一些字dcoument
- 如果我點擊word文檔對應的音頻文件應該發揮
- 其實當我點擊doc文件應該彈出IP與另存爲,與我使用一些頭碼開
- 也是我傳遞的查詢字符串在瀏覽器
- 查詢字符串不能正常工作,如果我用頭
誰能給我一個解決方案,它下面是我的代碼我附上
<?php
$f_name = $_POST["fn"];
$id = $_POST["id1"];
echo $id;
//echo "../public_html/sites/default/files/ourfiles/$f_name";
$res2=db_query("select * from mt_files where id='".$id."' ");
$row2=db_fetch_array($res2);
$job_audio=$row2["audio_name"];
//echo $job_audio;
//$job_audi=explode("/",$job_audio);
//$job_audio=$job_audi[8];
$job_audio= "C:/xampp/htdocs/med/sites/default/files/audio/$job_audio";
//$job_audio= "C:/Documents and Settings/swuser/My Documents/$job_audio";
//echo $job_audio;
echo "<object data='$job_audio' type='application/x-mplayer2' width='150' height='45'>
<param name='src' value='$job_audio'>
<param name='autoplay' value='true'>
<param name='autoStart' value='1'>
</object> ";
$file = "../mts/sites/default/files/docs/$f_name";
if (file_exists($file)) {
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($file));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
ob_clean();
flush();
readfile($file);
exit;
}
//The download table query goes here put the $f_name in insert into with the //time varible
?>
我不明白你的問題。該示例沒有顯示任何HTTP查詢字符串的使用。你應該使用$ _REQUEST而不是$ _POST? – Sjoerd 2010-05-27 07:18:34