ndwest12
11-04-2009, 08:07 PM
I had a thread about this on another section (hope i'm not breaking any rules here) To make a long story(thread) short here is the other thread explaining the situation http://www.codingforums.com/showthread.php?t=181358
But the hosting company has e-mailed me back the problem and that is that the file can't be submitted to their server because they don't have a shared temp folder like others.
so basically the area of my php code needs to point to a different accessable folder is what I've gathered.
This is the code
<?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_7']['name']!=''){
$field_12_filename = "file_7_".date("sihdmY").substr($_FILES['field_7']['name'],strlen($_FILES['field_7']['name'])-4);
if(!move_uploaded_file($_FILES['field_7']['tmp_name'], "./files/".$field_7_filename)){
die("File " . $_FILES['field_7']['name'] . " was not uploaded.");
}
}
mail("blank@yahoo.com","phpFormGenerator - Form submission","Form data:
First Name: " . $_POST['field_1'] . "
Last Name: " . $_POST['field_2'] . "
Job Name: " . $_POST['field_3'] . "
Phone: " . $_POST['field_5'] . "
E-Mail: " . $_POST['field_4'] . "
Questions / Comments: " . $_POST['field_6'] . "
Submit File: ".$where_form_is."files/".$field_7_filename." (original file name: " . $_FILES['field_7']['name'] . ")
powered by phpFormGenerator.
");
include("confirmsubmit.html");
}
else {
echo "Invalid Captcha String.";
}
?>
is there a way i can create a folder that will be writtable on the server that can store these to be emailed and attached?
But the hosting company has e-mailed me back the problem and that is that the file can't be submitted to their server because they don't have a shared temp folder like others.
so basically the area of my php code needs to point to a different accessable folder is what I've gathered.
This is the code
<?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_7']['name']!=''){
$field_12_filename = "file_7_".date("sihdmY").substr($_FILES['field_7']['name'],strlen($_FILES['field_7']['name'])-4);
if(!move_uploaded_file($_FILES['field_7']['tmp_name'], "./files/".$field_7_filename)){
die("File " . $_FILES['field_7']['name'] . " was not uploaded.");
}
}
mail("blank@yahoo.com","phpFormGenerator - Form submission","Form data:
First Name: " . $_POST['field_1'] . "
Last Name: " . $_POST['field_2'] . "
Job Name: " . $_POST['field_3'] . "
Phone: " . $_POST['field_5'] . "
E-Mail: " . $_POST['field_4'] . "
Questions / Comments: " . $_POST['field_6'] . "
Submit File: ".$where_form_is."files/".$field_7_filename." (original file name: " . $_FILES['field_7']['name'] . ")
powered by phpFormGenerator.
");
include("confirmsubmit.html");
}
else {
echo "Invalid Captcha String.";
}
?>
is there a way i can create a folder that will be writtable on the server that can store these to be emailed and attached?