-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnewPlan_script.php
30 lines (25 loc) · 949 Bytes
/
newPlan_script.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
29
30
<?php
// It will not allow direct access to this file by any user.
if(!isset($_SERVER['HTTP_REFERER'])){
// redirect them to your desired location
header('location:index.php');
exit;
}
require 'includes/common.php';
$initialBudget = $_POST['initialBudget'];
$initialBudget = mysqli_real_escape_string($con, $initialBudget);
$peoples = $_POST['peoples'];
$peoples = mysqli_real_escape_string($con, $peoples);
// check whether given input is greater than zero or not.
if($initialBudget <= 0){
echo "<script>alert('Budget must be greater than 0')</script>";
echo "<script>location.href='new_plan.php'</script>";
}
if($peoples <= 0 ){
echo "<script>alert('Minimum 1 user must be require')</script>";
echo "<script>location.href='new_plan.php'</script>";
}
if($initialBudget > 0 && $peoples > 0) {
header("location:plan_details.php?initialBudget=$initialBudget&&peoples=$peoples");
}
?>