This is my first time using this program so this is probably a pretty simple question.
I built a form with a field to upload an image. When I get the email saying the form has been submitted or look in the data file all I see for the image is something like this: http://files/01_39_34_ .
Where do I find the images? Did I do something wrong during the setup? I don't think it is a file size issue or anything like that. Thanks in advance for your help.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
looks like one of the functions/env variables is not returning the correct location of your server. That would be due to a server configuration. In any case, you can still find your uploaded files in: <directory where phpform is installed>/use/form_name/files/
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have two forms that I thought were identical for two separate sites to upload up to 6 pictures at a time with descriptions. One form displays the uploaded file address as above like this:
so my question would be... is it the form or is it the process.php file that is acting up.
the files do get uploaded to the files folder, I guess I am just looking for the aesthetics and the process to be correct with the information that it should tell me..... would remaking the forms fix it or is it a process.php tweak?
thanks in advance.... I really appreciate your work and love the phpformgen program....
Brook
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This is a not so common failure but it does occur. The processor.php file uses a variable called $where_form_is and the value is taken from a PHP stored value that it supposed to represent the current folder (where the processor.php file is located).
If the value is not available in your hosts version of PHP then you can either remove the value and hard code the other variables that use it, or hard code this value and leave the others alone. My preference is for the later. Hard code the $where_form_is variable to the location of your processor.php file.
Change this:
$where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/"));
to this
$where_form_is="http://www.mydomain.us/phpform/use/#########/";
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am still having a problem with this. I look in my process.php file and when looking for $where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/")); the closest thing I see is $where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/")); which is a bit different. I have tried messing around with that to change it like mentioned above but keep getting an error. What on this line of code do I need to change?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Joe Sousa, I have the same $where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/")); What did you change to make it work? can't seem to figure out where to edit it to add "http://www.mydomain.us/phpform/use/#########/"; .. Thanks man any info is appreciated.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am also having this same issue. I tried to hard code that line however the files still does not appear on my server and on the confirmation page I get "array" as the result for the file upload. Any help is greatly appreciated.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you want to email a copy of your process.php file and a link to the form to me I would be happy to look at it. Without more information it would be impossible to say what is wrong with your form.
Most times these issues are server or installtion related. Did you try adjusting the permissions of the associated forms and files?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The permissions are set correctly. The issue is that the file is not in the "files" folder or any folder on my server. When you complete the form and are taken to the confirmation page it says "array" for the file upload area.
Here is the process.php file:
<?php
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
pt_register('POST','FirstName');
pt_register('POST','LastName');
pt_register('POST','EmailAddress');
pt_register('POST','Address');
pt_register('POST','City');
pt_register('POST','State');
pt_register('POST','Zip');
pt_register('POST','Phone');
pt_register('POST','Mobile');
pt_register('POST','Birthday');
pt_register('POST','PleasetellushowyoumeettherequirementsandwhyyouthinkyouwillbeagoodPetSpecialist');
$PleasetellushowyoumeettherequirementsandwhyyouthinkyouwillbeagoodPetSpecialist=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $PleasetellushowyoumeettherequirementsandwhyyouthinkyouwillbeagoodPetSpecialist);$UploadResume=$HTTP_POST_FILES['UploadResume'];
if($HTTP_POST_FILES['UploadResume']['tmp_name']==""){ }
else if(!is_uploaded_file($HTTP_POST_FILES['UploadResume']['tmp_name'])){
$error.="<li>The file, ".$HTTP_POST_FILES['UploadResume']['name'].", was not uploaded!";
$errors=1;
}
if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$EmailAddress)){
$error.="<li>Invalid email address entered";
$errors=1;
}
if($errors==1) echo $error;
else{
$image_part = date("h_i_s")."_".$HTTP_POST_FILES['UploadResume']['name'];
$image_list[11] = $image_part;
copy($HTTP_POST_FILES['UploadResume']['tmp_name'], "files/".$image_part);
$where_form_is="http://www.grovepetservice.com/forms/use/JobApplication/";
$message="First Name: ".$FirstName."
Last Name: ".$LastName."
Email Address: ".$EmailAddress."
Address: ".$Address."
City: ".$City."
State: ".$State."
Zip: ".$Zip."
Phone: ".$Phone."
Mobile: ".$Mobile."
Birthday: ".$Birthday."
Please tell us how you meet the requirements and why you think you will be a good Pet Specialist: ".$PleasetellushowyoumeettherequirementsandwhyyouthinkyouwillbeagoodPetSpecialist."
Upload Resume: ".$where_form_is."files/".$image_list[11]."
";
$message = stripslashes($message);
mail("info@grovepetservice.com","Form Submitted at your website",$message,"From: phpFormGenerator");
?>
<!-- This is the content of the Thank you page, be careful while changing it -->
<h2>Thank you!</h2>
<table width=50%>
<tr><td>First Name: </td><td> <?php echo $FirstName; ?> </td></tr>
<tr><td>Last Name: </td><td> <?php echo $LastName; ?> </td></tr>
<tr><td>Email Address: </td><td> <?php echo $EmailAddress; ?> </td></tr>
<tr><td>Address: </td><td> <?php echo $Address; ?> </td></tr>
<tr><td>City: </td><td> <?php echo $City; ?> </td></tr>
<tr><td>State: </td><td> <?php echo $State; ?> </td></tr>
<tr><td>Zip: </td><td> <?php echo $Zip; ?> </td></tr>
<tr><td>Phone: </td><td> <?php echo $Phone; ?> </td></tr>
<tr><td>Mobile: </td><td> <?php echo $Mobile; ?> </td></tr>
<tr><td>Birthday: </td><td> <?php echo $Birthday; ?> </td></tr>
<tr><td>Please tell us how you meet the requirements and why you think you will be a good Pet Specialist: </td><td> <?php echo $PleasetellushowyoumeettherequirementsandwhyyouthinkyouwillbeagoodPetSpecialist; ?> </td></tr>
<tr><td>Upload Resume: </td><td> <?php echo $UploadResume; ?> </td></tr>
</table>
<!-- Do not change anything below this line -->
<?php
}
?>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I tried this version of your form and initially got the same results. After spending a few minutes adding debug code I found that for some reason the file would not POST properly. I have not found the exact reason yet but when I tried a different file it worked as expected.
I don't think there is a problem with your form. Have you tried different file types and/or different files?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It seems to not have a problem uploading txt or rtf. However everything else, jpg, html, doc its just not showing up in the "files" folder. Also, every file type continues to have "array" as the result for the upload. And if the file name has spacing it can mess up the link thats emailed.
Thanks so much for you help! Have you found what can be causing this issue?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Did you rty my last suggestion?
You can fix the "array" problem by changing this line
Upload Resume: ".$where_form_is."files/".$image_list[11]."";
to
Upload Resume: ".$where_form_is."files/".$image_part."";
This should fix the array problem.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello I am having the same issues. However with the fix above, I can upload only files with .txt, i cannot upload any other file format? What should i do?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This is my first time using this program so this is probably a pretty simple question.
I built a form with a field to upload an image. When I get the email saying the form has been submitted or look in the data file all I see for the image is something like this: http://files/01_39_34_ .
Where do I find the images? Did I do something wrong during the setup? I don't think it is a file size issue or anything like that. Thanks in advance for your help.
looks like one of the functions/env variables is not returning the correct location of your server. That would be due to a server configuration. In any case, you can still find your uploaded files in: <directory where phpform is installed>/use/form_name/files/
I have two forms that I thought were identical for two separate sites to upload up to 6 pictures at a time with descriptions. One form displays the uploaded file address as above like this:
http://files/12_17_51_scan0050.jpg
the other one works like advertised like this:
http://www.mydomain.us/phpform/use/#########/files/12_34_40_image_12065.jpg
so my question would be... is it the form or is it the process.php file that is acting up.
the files do get uploaded to the files folder, I guess I am just looking for the aesthetics and the process to be correct with the information that it should tell me..... would remaking the forms fix it or is it a process.php tweak?
thanks in advance.... I really appreciate your work and love the phpformgen program....
Brook
This is a not so common failure but it does occur. The processor.php file uses a variable called $where_form_is and the value is taken from a PHP stored value that it supposed to represent the current folder (where the processor.php file is located).
If the value is not available in your hosts version of PHP then you can either remove the value and hard code the other variables that use it, or hard code this value and leave the others alone. My preference is for the later. Hard code the $where_form_is variable to the location of your processor.php file.
Change this:
$where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/"));
to this
$where_form_is="http://www.mydomain.us/phpform/use/#########/";
"Excellent" works like a charm now....
thanks again.
Brook
I am still having a problem with this. I look in my process.php file and when looking for $where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/")); the closest thing I see is $where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/")); which is a bit different. I have tried messing around with that to change it like mentioned above but keep getting an error. What on this line of code do I need to change?
nevermind. figured it out. thanks.
Joe Sousa, I have the same $where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/")); What did you change to make it work? can't seem to figure out where to edit it to add "http://www.mydomain.us/phpform/use/#########/"; .. Thanks man any info is appreciated.
I am also having this same issue. I tried to hard code that line however the files still does not appear on my server and on the confirmation page I get "array" as the result for the file upload. Any help is greatly appreciated.
If you want to email a copy of your process.php file and a link to the form to me I would be happy to look at it. Without more information it would be impossible to say what is wrong with your form.
Most times these issues are server or installtion related. Did you try adjusting the permissions of the associated forms and files?
Hi TNT,
Thanks for the prompt response :)
The permissions are set correctly. The issue is that the file is not in the "files" folder or any folder on my server. When you complete the form and are taken to the confirmation page it says "array" for the file upload area.
Here is the process.php file:
<?php
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
pt_register('POST','FirstName');
pt_register('POST','LastName');
pt_register('POST','EmailAddress');
pt_register('POST','Address');
pt_register('POST','City');
pt_register('POST','State');
pt_register('POST','Zip');
pt_register('POST','Phone');
pt_register('POST','Mobile');
pt_register('POST','Birthday');
pt_register('POST','PleasetellushowyoumeettherequirementsandwhyyouthinkyouwillbeagoodPetSpecialist');
$PleasetellushowyoumeettherequirementsandwhyyouthinkyouwillbeagoodPetSpecialist=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $PleasetellushowyoumeettherequirementsandwhyyouthinkyouwillbeagoodPetSpecialist);$UploadResume=$HTTP_POST_FILES['UploadResume'];
if($HTTP_POST_FILES['UploadResume']['tmp_name']==""){ }
else if(!is_uploaded_file($HTTP_POST_FILES['UploadResume']['tmp_name'])){
$error.="<li>The file, ".$HTTP_POST_FILES['UploadResume']['name'].", was not uploaded!";
$errors=1;
}
if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$EmailAddress)){
$error.="<li>Invalid email address entered";
$errors=1;
}
if($errors==1) echo $error;
else{
$image_part = date("h_i_s")."_".$HTTP_POST_FILES['UploadResume']['name'];
$image_list[11] = $image_part;
copy($HTTP_POST_FILES['UploadResume']['tmp_name'], "files/".$image_part);
$where_form_is="http://www.grovepetservice.com/forms/use/JobApplication/";
$message="First Name: ".$FirstName."
Last Name: ".$LastName."
Email Address: ".$EmailAddress."
Address: ".$Address."
City: ".$City."
State: ".$State."
Zip: ".$Zip."
Phone: ".$Phone."
Mobile: ".$Mobile."
Birthday: ".$Birthday."
Please tell us how you meet the requirements and why you think you will be a good Pet Specialist: ".$PleasetellushowyoumeettherequirementsandwhyyouthinkyouwillbeagoodPetSpecialist."
Upload Resume: ".$where_form_is."files/".$image_list[11]."
";
$message = stripslashes($message);
mail("info@grovepetservice.com","Form Submitted at your website",$message,"From: phpFormGenerator");
?>
<!-- This is the content of the Thank you page, be careful while changing it -->
<h2>Thank you!</h2>
<table width=50%>
<tr><td>First Name: </td><td> <?php echo $FirstName; ?> </td></tr>
<tr><td>Last Name: </td><td> <?php echo $LastName; ?> </td></tr>
<tr><td>Email Address: </td><td> <?php echo $EmailAddress; ?> </td></tr>
<tr><td>Address: </td><td> <?php echo $Address; ?> </td></tr>
<tr><td>City: </td><td> <?php echo $City; ?> </td></tr>
<tr><td>State: </td><td> <?php echo $State; ?> </td></tr>
<tr><td>Zip: </td><td> <?php echo $Zip; ?> </td></tr>
<tr><td>Phone: </td><td> <?php echo $Phone; ?> </td></tr>
<tr><td>Mobile: </td><td> <?php echo $Mobile; ?> </td></tr>
<tr><td>Birthday: </td><td> <?php echo $Birthday; ?> </td></tr>
<tr><td>Please tell us how you meet the requirements and why you think you will be a good Pet Specialist: </td><td> <?php echo $PleasetellushowyoumeettherequirementsandwhyyouthinkyouwillbeagoodPetSpecialist; ?> </td></tr>
<tr><td>Upload Resume: </td><td> <?php echo $UploadResume; ?> </td></tr>
</table>
<!-- Do not change anything below this line -->
<?php
}
?>
I tried this version of your form and initially got the same results. After spending a few minutes adding debug code I found that for some reason the file would not POST properly. I have not found the exact reason yet but when I tried a different file it worked as expected.
I don't think there is a problem with your form. Have you tried different file types and/or different files?
It seems to not have a problem uploading txt or rtf. However everything else, jpg, html, doc its just not showing up in the "files" folder. Also, every file type continues to have "array" as the result for the upload. And if the file name has spacing it can mess up the link thats emailed.
Thanks so much for you help! Have you found what can be causing this issue?
You can fix the "array" problem by changing this line
Upload Resume: ".$where_form_is."files/".$image_list[11]."";
to
Upload Resume: ".$where_form_is."files/".$image_part."";
Also remove this line from your form file and I think most of your problems will go away.
<input type='hidden' name='MAX_FILE_SIZE' value='50'>
That definitely fixed the issue with the file not uploading however, I still get the the file upload result as array. ??
Did you rty my last suggestion?
You can fix the "array" problem by changing this line
Upload Resume: ".$where_form_is."files/".$image_list[11]."";
to
Upload Resume: ".$where_form_is."files/".$image_part."";
This should fix the array problem.
Hello I am having the same issues. However with the fix above, I can upload only files with .txt, i cannot upload any other file format? What should i do?