-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathadd.php
28 lines (25 loc) · 815 Bytes
/
add.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
session_start();
if($_SESSION['user']){
$user=$_SESSION['user'];
}
else{
header("location:index.php");
}
if($_SERVER['REQUEST_METHOD']=="POST")
{
date_default_timezone_set("Africa/Kampala");
$amount=mysql_real_escape_string($_POST['amount']);
$details=mysql_real_escape_string($_POST['details']);
$time = strftime("%T");
$date = strftime("%B %d, %Y");
mysql_connect("localhost", "root","") or die(mysql_error());
mysql_select_db("ATM") or die("Cannot connect to database");
mysql_query("INSERT INTO Passbook (amount,date_transaction,details,user) VALUES ('$amount','$date','$details','$user')");
Print '<script>alert("Successful Deposit Made.");window.location.assign("balance.php");</script>';
}
else
{
header("location:home.php");
}
?>