<?php
$from = $_POST['email'] ;
$nick = $_POST['nick'] ;
$ident = $_POST['ident'] ;
$serv = $_POST['server'] ;
$reason = $_POST['reason'] ;
$headers = "From: noreply@jamminbnc.net";
$subject = "BNC Application: $from :IRC Nick $nick";
if (!$from || !$nick || !$ident || !$serv || !$reason) {die("You did not fill out the form fully. All fields are required.");}
if ($serv == "Freedom") { $admin = "email";}
if ($serv == "Pandora") { $admin = "email";}
if ($serv == "Empire") { $admin = "email";}
if ($serv == "Vortex") { $admin = "hotmail.co.uk";}
if ($serv == "Sexy") { $admin = "@hotmail.co.uk";}
if ($serv == "Electric") { $admin = "@gmail.com";}
if ($serv == "Sin") { $admin = "";}
$body = "Dear JamminBNC BNC Administrator,\n\nPlease review the following BNC application as the applicant applied for your server:\nEmail: $from\nIRC Nick: $nick\nIdent: $ident\nPreferred Server: $serv\nReason for wanting BNC: $reason";
mail($admin, $subject, $body, $headers);
$headers2 = "From: noreply@jamminbnc.net";
$subject2 = "Re: BNC Application";
$autoreply = "Hi,\n\nYou or someone else has applied for a BNC from #JamminBNC on the SwiftIRC network. If you did not fill the application form in, then you can safely ignore this e-mail.\n\nIf you did apply: Thank you for your BNC application at JamminBNC.net. Somebody will get back to you as soon as possible, usually within 48 hours, most likely on the network. If you have any more questions, please consult our website at www.JamminBNC.net or visit our IRC channel at irc.swiftirc.net #JamminBNC\n\nApplication Details:\nIRC Nick: $nick\nEmail: $from\nIdent: $ident\nPreferred Server: $serv\n Reason for BNC: $reason\n\nIf you have no idea about this email it would be advised to add this email to your spam filter option on your email options, as someone may be abusing our form. Please do not reply to this, your reply will not be read.\n\nRegards,\nJamminBNC Site Administration";
mail($from, $subject2, $autoreply, $headers2);
header( "Location: http://www.jamminbnc.net/thankyou.html" );
?>