0 || !preg_match("/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/",$email) || strcmp($end,'pdf') != 0)
{
$_SESSION['error'] = "Error 1: Submit not successful. Check your input. If problem remains contact the webmaster.
File error: " . $_FILES["file"]["error"] . "
E-mail: $email
Filetype: $end";
}
else
{
$fname = uniqid() . "_" . $_FILES["file"]["name"];
if (move_uploaded_file($_FILES["file"]["tmp_name"],"../upload/" . $fname))
{
$emailmsg = "Submission confirmation \n\nTitle: " . $title . "\nAuthor(s): " . $authors . "\nFilename: " . $fname . "\n\nFile sucessfully submitted. Thank you!";
if (!mail("ssba2010@cb.uu.se","Submission","$emailmsg") || !mail($email,"Submission","$emailmsg","From: ssba2010@cb.uu.se") ){
$_SESSION['error'] = "Error 2: Submit not successful. Check your input. If problem remains contact the webmaster.";
}
else {
$_SESSION['success'] = "Your submission was successful. A confirmation email should arrive to the specified adress soon. Thank you for submitting.";
}
}
else
{
$_SESSION['error'] = "Error 3: Submit not successful. Check your input. If problem remains contact the webmaster.";
}
}
}
else
{
$_SESSION['error'] = "Error 4: Submit not successful. Check your input. If problem remains contact the webmaster.
Author: " . $_POST['authors'] . "
Email: " . $_POST['email'] . "
Title: " . $_POST['title'] . "
Filetype: " . $_FILES['file']['type'] . "
Filesize: " . $_FILES['file']['size'] . "
File error: " . $_FILES["file"]["error"];
}
/*if( isset($_SESSION['error']) )
{
echo $_SESSION['error'];
}
else
{
echo "Det ska ha gatt bra";
}*/
session_write_close();
header("Location: /callforpapers.php#msg");
exit;
?>