<?

/*
         _____   ____ |__|  |__   ____ _____ ___  __ ____   ____ 
        /  ___\ / ___\|  |  |  \_/ __ \\__  \\  \/ // __ \ /    \
        \  \___/ /_/  >  |   Y  \  ___/ / __ \\   /\  ___/|   |  \
         \___  >___  /|__|___|  /\___  >____  /\_/  \___  >___|  /
             \/_____/         \/     \/     \/          \/     \/
*/

	$email = $_POST['email'];
	$url1 = $_POST['url1'];
	$url2 = $_POST['url2'];
	$url3 = $_POST['url3'];
	$url4 = $_POST['url4'];
	$url5 = $_POST['url5'];
	$ok = false;
	if ($email != "") {
		$subject = "Here are your URL's from " . $site_name . "!";
		$message = "Your uploaded image is now available from anywhere on the Internet!\n\n\n";
		if ($url1 != "") {
			$message .= "To link directly for viewing on a page:\n\n";
			$message .= "$url1\n\n";
		}
		if ($url2 != "") {
			$message .= "To link to your image directly:\n\n";
			$message .= "$url2\n\n";
		}
		if ($url3 != "") {
			$message .= "To link to your image in HTML:\n\n";
			$message .= "$url3\n\n";
		}
		if ($url4 != "") {
			$message .= "To post in a message board:\n\n";
			$message .= "$url4\n\n";
		}
		if ($url5 != "") {
			$message .= "Link directly to thumbnail in JPEG format:\n\n";
			$message .= "$url5\n\n";
		}
		$message .= "\nThank you for using " . $site_name . " for your image hosting.\n\n";
		$message .=  $site_name . "\n";
		$message .=  $support_email . "\n";
		$headers .= "From: " . $site_name . " <" . $support_email . ">\r\n";
		mail($email, $subject, $message, $headers);

		// add email to database
		$link = mysql_connect($db_server, $db_user, $db_password) or die("Could not connect to the database.");
		mysql_select_db($db_name) or die("Could not select the database.");
		$query = "update images set email = '$email' where idx = '$idx'";
		mysql_query($query) or die("Database entry failed.");
		mysql_close($link);

		$ok = true;
	}
?>