Jump to content

[SOLVED] Automated email not Email (Initiated by Page load)


maxudaskin

Recommended Posts

mysql_select_db($database_LeadHost, $LeadHost);
$id = $_REQUEST['appid'];

  $subject = "Application Denied" ;
$message = "Hello ".$fname." ".$lname.",<br><br>Your application to Virtual Zoom Airlines has been denied.<br><br>REASON:<br>---------------------------------------------------------<br><br>". $reason ."<br><br---------------------------------------------------------<br><br>Feel free to contact us for assistance, but please do not reply to this email.<br><br><br>Regards,<br>Virtual ZOOM Airlines Management";
mail($email, "Subject: $subject", $message, "From: [email protected]" );
if (mysql_query("DELETE FROM `applications` WHERE `id`='{$id}'")){
  echo "Application Denied and Deleted.";
} else {
    die('Error: ' . mysql_error());
}
}

 

All the variables are there, but not in the excerpt I posted... Am I doing anything wrong?

 

<?php if($logged_in){
						if ($_SESSION['type'] = 1){
						?><?php
$accept = $_REQUEST["accept"];
$deny = $_REQUEST["deny"];
$reason = $_REQUEST['reason'];
if(isset($accept))
{
$id = $_REQUEST["appid"];
$hub = $_REQUEST["hub"];
$temppid = rand(1001,3999);
$fname = $_REQUEST["fname"];
$lname = $_REQUEST["lname"];
$email = $_REQUEST["email"];
$pass = md5($_POST['pass']);
$password = $_REQUEST['pass'];
$position = $_REQUEST["position"];
$type = $_REQUEST["role"];
$appdate = $_REQUEST["appdate"];
$birthday = $_REQUEST["birthday"];
$country = $_REQUEST["country"];
$vatsim = $_REQUEST["vatsim"];
$ivao = $_REQUEST["ivao"];
$ip = $_REQUEST["ip"];

$result = mysql_query("SELECT * FROM `users` WHERE `pid`='{$temppid}'");
if (mysql_num_rows($result) == 1)
{
$pidcheck = 1;
}
else
{
$pidcheck = 0;
}
do
  {
  $temppid++;
  }
while ($pidcheck==1);
if ($pidcheck==0);
{
$pid = $temppid;
}

mysql_select_db($removed, $removed);

mysql_query("INSERT INTO users (appid, fname, lname, email,  pass,  hub, birthday, country, vatsim, ivao, position, ip, acceptdate, appdate, type, pid)
VALUES
('$id','$fname','$lname','$email','$pass','$hub','$birthday','$country','$vatsim','$ivao','$position','$ip', NOW( ), '$appdate', '$type', '$pid')");

echo "1 user added...";
echo "<br>";
echo "<br>";
echo "Thank you For Using Max removed removed Administration Script.";
$subject = "Application Accepted" ;
$message = "Hello ".$fname." ".$lname.",

Your application to Virtual Zoom Airlines has been accepted.

You may now login to the website using the user name and password you registered with:

Pilot ID: ".$temppid."
Password: ".$password."
Do not lose this as we cannot retrieve it after this point.
Position: " . $position . "

Be sure to register for the forums and check out the latest NOTAMS before your first flight.

Feel free to contact us for assistance, but please do not reply to this email.


Regards,
Virtual ZOOM Airlines Management";
mail($email, "$subject", $message, "From: [email protected]");


	$conpirep = mysql_connect($removed, $removed, $removed) or trigger_error(mysql_error(),E_USER_ERROR);
						mysql_select_db('removed',$removed);
	mysql_query("CREATE TABLE `oom". $temppid ."` (
  `pirepid` int(5) NOT NULL auto_increment,
  `departure` varchar(25) NOT NULL,
  `destination` varchar(25) NOT NULL,
  `flight_id` varchar(10) NOT NULL,
  `route` text NOT NULL,
  `aircraft` varchar(10) NOT NULL,
  `totaltime` varchar(5) NOT NULL,
  `online` varchar(25) NOT NULL,
  `date` varchar(10) NOT NULL,
  `type` varchar(1) NOT NULL default '1',
  PRIMARY KEY  (`pirepid`)
)");
	mysql_close($conpirep);
?>
                                <form id="form1" name="form1" method="get" action="deleteapp.php">
                                  <input name="appid" type="hidden" id="appid" value="<?php echo $id; ?>" />
                                  <input type="submit" name="Submit" value="Validate Acceptance" />
                            </form>
<?php

}else{
mysql_select_db($removed, $removed);
$id = $_REQUEST['appid'];

  $subject = "Application Denied" ;
$message = "Hello ".$fname." ".$lname.",<br><br>Your application to Virtual Zoom Airlines has been denied.<br><br>REASON:<br>---------------------------------------------------------<br><br>". $reason ."<br><br---------------------------------------------------------<br><br>Feel free to contact us for assistance, but please do not reply to this email.<br><br><br>Regards,<br>Virtual ZOOM Airlines Management";
mail($email, "Subject: $subject", $message, "From: [email protected]" );
if (mysql_query("DELETE FROM `applications` WHERE `id`='{$id}'")){
  echo "Application Denied and Deleted.";
} else {
    die('Error: ' . mysql_error());
}
}
}else{ echo 'You are not a staff member...';}
}else{ echo 'You are not logged in.';}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.