Just installed a simple form that asks for name, email and select a file to upload. Uploads file alright but I do not receive an email notification about the upload. What did I miss??
Scott
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It's hard to tell just from your post. I would know better if I could see the forma and the processor.php file.
What version of the generator are you using?
Have you checked with your host to see if the php mail function should work?
In version 2.09 sometimes this line causes problems:
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
but since you are uploading files it might be in use. You can try removing it but be prepared to put it back if teh file upload no longer works.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes, you can have both an email and a file for the same form. You just need to enter the email address and click update, then choose file and enter the filename (e.g., formdata.txt) and click update again. Same for the database option.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Just installed a simple form that asks for name, email and select a file to upload. Uploads file alright but I do not receive an email notification about the upload. What did I miss??
Scott
It's hard to tell just from your post. I would know better if I could see the forma and the processor.php file.
What version of the generator are you using?
Have you checked with your host to see if the php mail function should work?
In version 2.09 sometimes this line causes problems:
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
but since you are uploading files it might be in use. You can try removing it but be prepared to put it back if teh file upload no longer works.
I have no idea which version of the generator I am using the generator from the following link: http://phpformgen.sourceforge.net/new_demo/phpformgen/
The form is sitting at: http://cheapfullcolorprinting.net/form25331/form.html
<?php
$where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/"));
session_start();
if( ($_SESSION['security_code']==$_POST['security_code']) && (!empty($_POST['security_code'])) ) {
// File upload handling
if($_FILES['field_3']['name']!=''){
$field_3_filename = "file_3_".date("sihdmY").substr($_FILES['field_3']['name'],strlen($_FILES['field_3']['name'])-4);
if(!move_uploaded_file($_FILES['field_3']['tmp_name'], "./files/".$field_3_filename)){
die("File " . $_FILES['field_3']['name'] . " was not uploaded.");
}
}
// File upload handling
if($_FILES['field_4']['name']!=''){
$field_4_filename = "file_4_".date("sihdmY").substr($_FILES['field_4']['name'],strlen($_FILES['field_4']['name'])-4);
if(!move_uploaded_file($_FILES['field_4']['tmp_name'], "./files/".$field_4_filename)){
die("File " . $_FILES['field_4']['name'] . " was not uploaded.");
}
}
$fileLine = "Name: " . $_POST['field_1'] . "
Your Email: " . $_POST['field_2'] . "
Upload Image 1: " . $_POST['field_3'] . "
Upload Image 2: " . $_POST['field_4'] . "
";
$filename = '';
if (is_writable($filename)) {
if (!$handle = fopen($filename, 'a'))
{
echo "Cannot open file ($filename)";
exit;
}
if (fwrite($handle, $fileLine) === FALSE) {
echo "Cannot write to file ($filename)";
exit;
}
fclose($handle);
} else {
echo "The file is not writable";
}
include("confirm.html");
}
else {
echo "Invalid Captcha String.";
}
?>
There is no mail function. You should go back to the generator and make sure you select the email notification option under delivery method.
Use this link to get back to edit your form.
http://phpformgen.sourceforge.net/new_demo/phpformgen/page_home.php?form_id=25331
Am I able to still have the file uploaded to the sever AND an email notification go out to me?
I notice that I am only able to select one of three choices...
Database
Email
File
Thanks for the assistance
Scott
When you are editing your form page and you select a file upload field, this is completely separate from the notification method.
Yes, you can have both an email and a file for the same form. You just need to enter the email address and click update, then choose file and enter the filename (e.g., formdata.txt) and click update again. Same for the database option.