-4
我有這個形式我在哪裏上傳MP3文件,但我希望用戶上傳的音樂和所有細節,比如作者,標題等mp3的應該會自動填寫在表單field.i我使用PHP,並希望任何PHP/JavaScript的方法,可以從本地機器找出文件的名稱,並將該名稱在我的表格標題字段 我的表格如下。我不希望用戶輸入書名,作者等
<form enctype="multipart/form-data" method="post" action="http://youshare.ca/music/writestorypost"><p><span class="form_label">Name of the song</span><input type="text" value="" name="title" style="width:400px" class="inputText required"></p><p><span class="form_label">Description</span>
<textarea class="rich" style="width:580px" rows="18" name="form_content"></textarea>
</p><p><span class="form_label">Tags</span>
<input type="text" value="" style="width:300px" name="tags" class="inputText">
<span>Multiple tags should be Separated with commas(,)</span>
</p>
<p><label>Upload</label><input type="file" name="song">
<span>Only mp3 is accepted</span></p>
<p><label>Music source</label>
<input type="radio" checked="1" value="own" name="musicsource">My own
<input type="radio" value="others" name="musicsource">From another musician
</p>
<div style="display:none" id="ms_others">
<p><label>Musician name</label><input name="musician"></p>
</div>
<div id="ms_own">
<p></p>
</div>
<p><label>Picture (Optional)</label><input type="file" name="picture">
<span>A picture about the song or the musician</span></p>
<script type="text/javascript">
jQuery(document).ready(function($) {
$("input[value='own']").click(
function() {
$("#ms_others").hide();
$("#ms_own").fadeIn();
}
);
$("input[value='others']").click(
function() {
$("#ms_own").hide();
$("#ms_others").fadeIn();
}
);
})
</script><p><input type="submit" value="Submit" class="button"></p><input type="hidden" value="935" name="page_id"></form>
[您嘗試過什麼?](http://mattgemmell.com/2008/12/08/what-have-you-tried/) – Palladium 2012-08-02 17:39:12
請減少此處的代碼量,並且只發布對於你在做什麼。 – Matt 2012-08-02 17:39:38