-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadd.php
More file actions
27 lines (22 loc) · 800 Bytes
/
add.php
File metadata and controls
27 lines (22 loc) · 800 Bytes
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
<?php
//session_start();
include('db.php');
if (isset($_POST['AddExpBtn'])) {
$expdesc = mysqli_real_escape_string($db, $_POST['expdesc']);
$exptype = mysqli_real_escape_string($db, $_POST['exptype']);
$expamt = mysqli_real_escape_string($db, $_POST['expamt']);
date_default_timezone_set("Asia/Kolkata");
$currdate= date("Y-m-d");
$currtime=date("h:i");
$month=date("m");
$year=date("Y");
$sql="INSERT INTO exptable( exptype, expdescp,amount,date,month,year,time)VALUES( '$exptype', '$expdesc','$expamt', '$currdate','$month','$year','$currtime')";
mysqli_query($db,$sql);
echo '<script language="javascript">';
echo 'alert("Expense added!!!")';
echo '</script>';
}else {
echo "ERRRRR!! something went wrogn!!";
}
header("location:index.php");
?>