ballouta Posted March 23, 2008 Share Posted March 23, 2008 Hello all i searched google for a simple contact form with one attachment option but i didnt find what i need. Would you please give me some usefull links to download a simple code and test it? I know how to make a php form and submit it, but never seen the attach code, i would see this code and understand it. thanks 4 u all in advance Quote Link to comment https://forums.phpfreaks.com/topic/97499-form-attach-code/ Share on other sites More sharing options...
eddierosenthal Posted March 23, 2008 Share Posted March 23, 2008 i guess you are talking about emailing and sending along an attachment. check out the php class phpmailer it has options for that. i sent somebody else along to find out how to email html and they were happy... Quote Link to comment https://forums.phpfreaks.com/topic/97499-form-attach-code/#findComment-498893 Share on other sites More sharing options...
MadTechie Posted March 23, 2008 Share Posted March 23, 2008 Do you mean something likes this <form method="post" enctype="multipart/form-data"> <p>Pictures: <input type="file" name="pictures" /> <input type="text" name="Name" /> <input type="submit" value="Send" /> </p> </form> <?php if(isset($_POST['submit'])) { echo $_POST['Name']; //Create a folder called upload with write access $dir = dirname(__FILE__)."\upload"; $tmp_name = $_FILES["pictures"]["tmp_name"]; $name = $_FILES["pictures"]["name"]; move_uploaded_file($tmp_name, "$dir/$name"); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/97499-form-attach-code/#findComment-498900 Share on other sites More sharing options...
ballouta Posted March 23, 2008 Author Share Posted March 23, 2008 Thank you eddierosenthal, i will check PHPmailer on google and see how does it work and test my code. Thank you MadTechie, does this code only uploads pictures? or it takes any file type 'as I want'? do i put this code in a php file and run it? sorry i am not professional, where do the site visitor writes his email address before submitting the form? have a nice day Quote Link to comment https://forums.phpfreaks.com/topic/97499-form-attach-code/#findComment-498916 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.