View Single Post
  #3 (permalink)  
Old 09-07-2008, 03:43 PM
RyanTuosto RyanTuosto is offline
Banned
 
Join Date: Aug 2008
Posts: 8
Credits: 0
Rep Power: 0
RyanTuosto is on a distinguished road
Default Re: Form comes back completely blank? Help!

Code:
<?PHP 
$to = "my@email.com";
$subject = "New Order"; 
$headers = "http://www.mockup-markup.com"; 
$forward = 0; 
$location = "yoursite.com";
$timestamp = date('Y-m-d_His');
mkdir('/home/content/r/t/u/rtuosto/html/clients/uploads/' . $timestamp);
$target_file = '/home/content/r/t/u/rtuosto/html/clients/uploads/' . $timestamp . '/' . basename($_FILES['file']['name']);

$date = date ("l, F jS, Y"); 
$time = date ("h:i A"); 




$msg = "Below is the result of your feedback form. It was submitted on $date at $time.\n\n"; 



if ($_SERVER['REQUEST_METHOD'] == "POST") {
    foreach ($_POST as $key => $value) { 
        $msg .= ucfirst ($key) ." : ". $value . "\n"; 
    }
}
else {
    foreach ($_GET as $key => $value) { 
        $msg .= ucfirst ($key) ." : ". $value . "\n"; 
    }
}

mail($to, $subject, $msg, $headers); 
if ($forward == 1) { 
    header ("Location:$location"); 
} 
else { 
} 

if (move_uploaded_file($_FILES['file']['tmp_name'], $target_file)) {
	// Succeeded
	
} else {	
}

?>
Reply With Quote