سؤال

Is there a way to modify my very simple form script to add/process an attachment without uploading to the server or using a library or mime?

$myemail = "google@gmail.com";
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['letter'];
$subject= "FROM SITE!";
$message = "
Name: $name
E-mail: $email
Subject: $subject
Message:
$message";

mail($myemail, $subject, $message);
هل كانت مفيدة؟

المحلول

No unfortunately there is no simple way to do this. First of all you'll HAVE to find a way to upload the file to the server, otherwise your PHP script will not to able to access a file (on your desktop).

If you really want to avoid server side programming, you may want to consider a javascript /hosted solution like FilePicker.io that let's you upload files from your desktop without server-side code, but this still wont' solve your email problem.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top