<?php
/**
 * @author freddy
 * @copyright 2009
 */
// Connect to the database
require('db.php'); 
// Set username and password variables for this script
$username = mysql_real_escape_string($_POST["username"]);
$details = mysql_real_escape_string($_POST["details"]);
$amount = mysql_real_escape_string($_POST["amount"]);
$transstatus = "processing";

		$result= MYSQL_QUERY("INSERT INTO withdrawal (`id`, `username`, `amount`, `details`, `transstatus`, `transdate`) VALUES (NULL, '$username', '$amount', '$details', '$transstatus', CURRENT_TIMESTAMP);");
// Insert same data into the transfers table		
		$resultb= MYSQL_QUERY("INSERT INTO transfers (`id`, `username`, `amount`, `details`, `transstatus`, `transdate`) VALUES (NULL, '$username', '$amount', '$details', '$transstatus', CURRENT_TIMESTAMP);");
		 
echo "Funds Withdrawn!.";

?>
<html>
<body>
<a href="index.php">Home</a>
</body>
</html>