tylercaiden Posted January 11, 2008 Share Posted January 11, 2008 Hi everyone, i need my web form to send the info submitted as a txt file and not just an email... here is my current code... <?php $email = $_REQUEST['email'] ; $zip = $_REQUEST['zip'] ; $name = $_REQUEST['name'] ; $phone = $_REQUEST['phone'] ; $order1 = $_REQUEST['RadioGroup1'] ; mail( "[email protected]", "subject line", "$order1\n $zip\n $name\n $email\n $phone\n", "From: [email protected]" ); header( "Location: thankyou.html" ); ?> anyone know of a way to do this? i guess i need it to write the form as a txt on the server then attach it to an email with a subject line. Link to comment https://forums.phpfreaks.com/topic/85581-web-form-sending-a-file/ Share on other sites More sharing options...
nikefido Posted January 11, 2008 Share Posted January 11, 2008 googled it, one of the first ones - an example here: http://www.codewalkers.com/c/a/Email-Code/PHP-Email-Attachment-v2-UPDATED-091106/ this one might be better: http://www.drquincy.com/resources/tutorials/webserverside/sendemailattachmentphp/ Link to comment https://forums.phpfreaks.com/topic/85581-web-form-sending-a-file/#findComment-436718 Share on other sites More sharing options...
tylercaiden Posted January 11, 2008 Author Share Posted January 11, 2008 googled it, one of the first ones - an example here: http://www.codewalkers.com/c/a/Email-Code/PHP-Email-Attachment-v2-UPDATED-091106/ this one might be better: http://www.drquincy.com/resources/tutorials/webserverside/sendemailattachmentphp/ im not sure, but it doesn't look like this code does write. i need it to right the data from the form to a text file first and send it, not attach a file from the users machine. Link to comment https://forums.phpfreaks.com/topic/85581-web-form-sending-a-file/#findComment-436728 Share on other sites More sharing options...
nikefido Posted January 11, 2008 Share Posted January 11, 2008 googled it, one of the first ones - an example here: http://www.codewalkers.com/c/a/Email-Code/PHP-Email-Attachment-v2-UPDATED-091106/ this one might be better: http://www.drquincy.com/resources/tutorials/webserverside/sendemailattachmentphp/ im not sure, but it doesn't look like this code does write. i need it to right the data from the form to a text file first and send it, not attach a file from the users machine. well you need to do both, right? look up fwrite() on php.net: http://us2.php.net/fwrite Link to comment https://forums.phpfreaks.com/topic/85581-web-form-sending-a-file/#findComment-436737 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.