Hello, I need a php script that makes it possible for a visitor to enter those optional details: His/her name email address telephone further details two radio buttons - face and back and saves it to a text file (data.txt for example). The same script should also have an image uploader and the submit button should both upload the pic to the server and save the form details to the text file(and the text file should not be overwritten).
Thanks for the reply, I definitely would've reffered to the link, had it not been an useless advertisement.
$fh = fopen("datadump.txt", "a") foreach ($_POST as $key=>$value) { $thisline = "$key = $value\n"; fwrite($fh, $thisline); } fwrite($fh, "\n******* END OF RECORD ********\n\n"); fclose($fh); Thats for saving your data to a .txt file as per saving the uploaded files you'll have to mess with file upload functions and $_FILE array (to get the name, tempname, etc). here's a good article for you to follow step by step for the file upload part : http://php.about.com/od/advancedphp/ss/php_file_upload.htm know that when you upload a file, php saves it to a temp location and under a temp name. You will have to then move the temp file to a desired location (using moveuploadedfile() ) and rename it to a desired name (you may also get the original file's name and rename the temp file to it). anyways, you'll find a step by step guide in the URL i posted for the file upload part also, the code above is not tested .. i just wrote it here .. i sometimes make typos, so watch out and also, the file upload part and the saving of your data dump is a dependent of your server's configuration (it should allow the PHP to create and/or modify files). good luck