I’m using this php code for an upload form :
[code=php]<?php
include(“global.inc.php”);
$errors=0;
$error=”The following errors occured while processing your form input.<ul>”;
$Upload=$HTTP_POST_FILES[‘Upload’];
if($HTTP_POST_FILES[‘Upload’][‘tmp_name’]==””){ }
else if(!is_uploaded_file($HTTP_POST_FILES[‘Upload’][‘tmp_name’])){
$error.=”<li>The file, “.$HTTP_POST_FILES[‘Upload’][‘name’].”, was not uploaded!”;
$errors=1;
}
if($errors==1) echo $error;
else{
$image_part = date(“h_i_s”).”_”.$HTTP_POST_FILES[‘Upload’][‘name’];
$image_list[0] = $image_part;
copy($HTTP_POST_FILES[‘Upload’][‘tmp_name’], “files/”.$image_part);
$where_form_is=”http”.($HTTP_SERVER_VARS[“HTTPS”]==”on”?”s”:””).”://”.$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),”/”));
$message=”Upload: “.$where_form_is.”/files/”.$image_list[0].”
“;
$message = stripslashes($message);
mail(“[email protected]”,”Avatar Upload”,$message,”From: [email protected]”);
$make=fopen(“admin/data.dat”,”a”);
$to_put=””;
$to_put .= $where_form_is.”/files/”.$image_list[0].”
“;
fwrite($make,$to_put);
header(“Refresh: 0;url=http://www.hp-ships.com/thanks.html”);
?><?php
}
?>
Which works fine. It sends an email with the file, however I need to be sent the other 4 pieces of information in the form.
Is there any way of intergrating the following code with the upload code?
[code=php]$message = “Name: {$_POST[‘name’]}n”;
$message .= “Email = {$_POST[’email’]}n”;
$message .= “Sship: {$_POST[‘pship’]}n”;
$message .= “Sship2: {$_POST[‘pship2’]}n”;
Otherwise, how do I configure my upload script so it also sends name, email, pship and pship2 as well as the file?
Any suggestions would be much appreciated.
?