The following files exists in this folder. Click to view.
transfer.php29 lines ASCII Unix (LF)
<?php
session_start();
include('check_login.php');
include('functions.php');
$amount = 0;
if($_POST['amount']<=0){
header('location: home.php');
exit();
}
if(isset($_POST['type'])){
if($_POST['type'] == 'withdraw'){
$amount = -1*$_POST['amount'];
}
else{
$amount = $_POST['amount'];
}
add($_SESSION['user'] . $_SESSION['userid'], $_POST['account'], $_POST['type'], $amount);
}
else{
$amount = $_POST['amount'];
add($_SESSION['user'] . $_SESSION['userid'], $_POST['account1'], 'transfer', -1*$amount);
add($_SESSION['user'] . $_SESSION['userid'], $_POST['account2'], 'transfer', $amount);
}
header('location: home.php');
exit();
?>