I would like to know how to complete one of two things. Either have a submit button work with two .php files. Or how to combine the following:
[code=php]
<?PHP
$to = “[email protected]”;
$subject = “From form”;
$headers = “From: Form Mailer”;
$forward = 1;
$location = “random.com”;
$date = date (“l, F jS, Y”);
$time = date (“h:i A”);
$msg = “Below is the result of a request from random.com. It was submitted on $date at $time.nn”;
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 {
echo “Thank you for submitting your request!”;
}
?>
with the following:
[code=php]<?php
$uploaddir = “uploads”;
if(is_uploaded_file($_FILES[‘file’][‘tmp_name’]))
{
move_uploaded_file($_FILES[‘file’][‘tmp_name’],$uploaddir.’/’.$_FILES[‘file’][‘name’]);
}
print “Upload Completed!”;
?>
any help would be greatly apperciated.