November 1, 201214 yr Hi, i am new to php and need to send attachments to my email through a form how can i do it? i have the html but no php
November 3, 201214 yr Simplest method: <?php // if file is uploaded... if(is_uploaded_file($_FILES["name_in_form"]["tmp_name"])) { // ...move it from temporary directory to destination directory move_uploaded_file($_FILES["filename"]["tmp_name"], "/path/to/file/".$_FILES["filename"]["name"]); } else { // ...else an error is returned echo("upload error"); } ?> "name_in_form" is the name of the attribute "name" in the your html form Edited November 3, 201214 yr by way
Create an account or sign in to comment