Need help with this html/cgi/whatever it needs ..

Kazi

Senior member
Jun 7, 2001
637
0
0
Ok earlier i was askin for some help but didnt get much help but i got it done. Now I need to be able to let the user upload a small picture, no more then 50K. Is there anyone out there who has this knoledge? I have access to CGI and PHP and some others. If you look on the page, it shows a place called 'Picture' I need a text box and like a browse button. I need it so when they hit submit it sends the picture from their HD to my email address along with all the information they input.

http://www.smith-extreme.com/anandtech/Form.htm

Any help is greatly appreciated.
 

teknodude

Member
Apr 11, 2002
186
0
0
I would personally recommend you use PHP. A quick search on Google dug up this PHP upload script: http://ksv.hypermart.net/php/, and this page with equally useful scripts: http://www.hotscripts.com/PHP/Scripts_and_Programs/File_Manipulation/Upload_Systems/.

If you want to write your own upload script then I suggest you check out the file upload section of the PHP manual: http://www.php.net/manual/en/features.file-upload.php.

It shouldn't be too difficult to limit the file upload size to 50KB; at least one of the scripts on hotscripts.com offers this feature.

As to the form itself, you will require this in your opening <form> tag: enctype="multipart/form-data"
To get the file browse field you want something similar to: <input type="file" name="photofile" size="25">

I wouldn't recommend that you make the form send the data and photos directly to your e-mail address as it easily up the possibility for spamming and unwanted files. I would suggest you create a simple system PHP system such as:

- Have a folder on the server which the photos are stored in (needs full write access).
- A text file to store the inputted data that could be included in a PHP page to display the data along with the photo.
- When a submission is made you are e-mailed a notfication so you can go check out what's been added.

I would be perfectly happy to help you code such a system if you like.

Hope that answers some of your questions, good luck :)

Simon Plenderleith
 

Kazi

Senior member
Jun 7, 2001
637
0
0
I dont know how to code PHP so I wouldnt know where to go there. Only thing i know i html and basic C++. Ill check those links out and if i get stuck ill come back :) Thanks teknodude