PDA

View Full Version : Please help me get this form working



houseoftracks
07-03-2006, 09:41 PM
I am in need of some assistance please. I am very new to web building, so patience is definitely appreciated. I have reviewed the topics on uploads for forms but my head is spinning! I am trying to get this form functional:

House Of Tracks, Online Recording Studio, Bass Tracks, Guitar Tracks, Drum Tracks, Backing Tracks (http://www.houseoftracks.com/Uploads.html)

This is a music recording site. Right now I am set up where my clients simply e-mail me their MP3 file. I would like to do something more professional - where they can complete this form and e-mail the information with the MP3 as an attachment. I can get the form to function simply as an e-mail. But I cannot get it to attach the MP3 file.

Can anyone help a newbie?

Thanks
Bill
House Of Tracks, Online Recording Studio, Bass Tracks, Guitar Tracks, Drum Tracks, Backing Tracks (http://www.houseoftracks.com)

Andy128
07-04-2006, 12:21 AM
Did you follow this post exactly?
http://www.vodahost.com/vodatalk/forms/7233-how-upload-file-using-form.html

Can you please post the php file (open in with note pad-copy and then paste it to thread). This way we'll be able to see the script and evaluate it.

Andy

houseoftracks
07-04-2006, 01:30 AM
Hi Andy

Yes, I think I did. Here is the PHP file:

<html>
<head>
<title>Upload</title>
<body>
<?php
$uploaddir = '/home/housscom/public_html/uploads/';
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
echo '<pre>';
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
echo "File is valid, and was successfully uploaded.\n";
} else {
echo "Possible file upload attack!\n";
}
?>
</body>
</html>

I then uploaded this file to my server. However, I do not understand the direction to "place both files in the same directory on your webserver" What other file are they referring to? Is this the proper script to enable the form I am looking to use?

Thanks
Bill

Andy128
07-04-2006, 02:08 AM
Bill-
I just uploaded a file with your form (small wav file) and it seemed to work. Let me know what you received.

Andy

houseoftracks
07-04-2006, 05:33 AM
Andy,
I have nothing in my e-mail inbox. Should I be looking elsewhere?

Thanks
Bill

houseoftracks
07-04-2006, 05:36 AM
Bill-
I just uploaded a file with your form (small wav file) and it seemed to work. Let me know what you received.

Andy


OOOh Found it! I went to my Cpanel and it is in my "upload" folder. How do we get it to e-mail me as an attachment with the rest of the form?

Thanks!
Bill

navaldesign
07-04-2006, 05:41 AM
The above script DOES NOT send you any email. It simply uploads the file in your public_html/uploads folder. Click Index of /uploads (http://www.houseoftracks.com/uploads/)

to see the file that Andy has uploaded.

Please note that the script that you have used, by itself only uploads the file. It doesn't allow for any other information to be filled in the form, neither it performs checking for file type, file size etc. It also doesn't send you any email in your mailbox to let you know that a new file has been uploaded. This script was not intended for stand alone use, but as a part of a larger script that would do the rest of the job.

houseoftracks
07-04-2006, 04:47 PM
Thank you Naval. That will save me some hair!! Can yopu please advise how I can get that form to function?

Thanks again
Bill

House Of Tracks, Online Recording Studio, Bass Tracks, Guitar Tracks, Drum Tracks, Backing Tracks (http://www.houseoftracks.com)

Andy128
07-04-2006, 05:42 PM
If you re-look at the link in my post above - scroll down to Navals last post. There he gives a link to someone who posted a similar problem/request. I believe that if you follow that thread- you will be able to figure out how it is done.

I am afraid I am if little help as I have not had the need to upload files and therefore, have never written a script for it.

Andy

houseoftracks
07-04-2006, 07:43 PM
If you re-look at the link in my post above - scroll down to Navals last post. There he gives a link to someone who posted a similar problem/request. I believe that if you follow that thread- you will be able to figure out how it is done.

I am afraid I am if little help as I have not had the need to upload files and therefore, have never written a script for it.

Andy

Yes Andy I saw that script. I believe it is for videos or images, as opposed to MP3's. I wouldnt know where to begin modifying it or if it could be modified for MP3 files

Bill

navaldesign
07-04-2006, 09:03 PM
Upoloading has nothing to do with mp3 or wav or, anyway, the file type. If you have an upload script, it will upload anything. Just take that script and modify it- if you need to - to suit your needs.