-
Notifications
You must be signed in to change notification settings - Fork 1
/
text.php
72 lines (63 loc) · 3.82 KB
/
text.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
session_start();
if(!$_SESSION['auth']){
header('location: index.php');
}
else{
if($_POST){
$_SESSION['error_text'] = '';
$big=0;
include('connection.php');
$area_m = $_POST['area_m'];
$radius_m = $_POST['radius_m'];
$perimeter_m = $_POST['perimeter_m'];
$compactness_m = $_POST['compactness_m'];
$concave_points_m = $_POST['concave_points_m'];
$concavity_m = $_POST['concavity_m'];
$fractional_dimension_m = $_POST['fractional_dimension_m'];
$smoothness_m = $_POST['smoothness_m'];
$symmetry_m = $_POST['symmetry_m'];
$texture_m = $_POST['texture_m'];
$area_se = $_POST['area_se'];
$radius_se = $_POST['radius_se'];
$perimeter_se = $_POST['perimeter_se'];
$compactness_se = $_POST['compactness_se'];
$concave_points_se = $_POST['concave_points_se'];
$concavity_se = $_POST['concavity_se'];
$fractional_dimension_se = $_POST['fractional_dimension_se'];
$smoothness_se = $_POST['smoothness_se'];
$symmetry_se = $_POST['symmetry_se'];
$texture_se = $_POST['texture_se'];
$area_worst = $_POST['area_worst'];
$radius_worst = $_POST['radius_worst'];
$perimeter_worst = $_POST['perimeter_worst'];
$compactness_worst = $_POST['compactness_worst'];
$concave_points_worst = $_POST['concave_points_worst'];
$concavity_worst = $_POST['concavity_worst'];
$fractional_dimension_worst = $_POST['fractional_dimension_worst'];
$smoothness_worst = $_POST['smoothness_worst'];
$symmetry_worst = $_POST['symmetry_worst'];
$texture_worst = $_POST['texture_worst'];
$user_id = $_SESSION['user_id'];
if(!preg_match("/^[0-9.]*$/",$area_m) || !preg_match("/^[0-9.]*$/",$radius_m) || !preg_match("/^[0-9.]*$/",$perimeter_m) || !preg_match("/^[0-9.]*$/",$compactness_m) || !preg_match("/^[0-9.]*$/",$concave_points_m) || !preg_match("/^[0-9.]*$/",$concavity_m) || !preg_match("/^[0-9.]*$/",$fractional_dimension_m) || !preg_match("/^[0-9.]*$/",$smoothness_m) || !preg_match("/^[0-9.]*$/",$symmetry_m) || !preg_match("/^[0-9.]*$/",$texture_m) || !preg_match("/^[0-9.]*$/",$area_se) || !preg_match("/^[0-9.]*$/",$radius_se) || !preg_match("/^[0-9.]*$/",$perimeter_se) || !preg_match("/^[0-9.]*$/",$compactness_se) || !preg_match("/^[0-9.]*$/",$concave_points_se) || !preg_match("/^[0-9.]*$/",$concavity_se) || !preg_match("/^[0-9.]*$/",$fractional_dimension_se) || !preg_match("/^[0-9.]*$/",$smoothness_se) || !preg_match("/^[0-9.]*$/",$symmetry_se) || !preg_match("/^[0-9.]*$/",$texture_se) || !preg_match("/^[0-9.]*$/",$area_worst) || !preg_match("/^[0-9.]*$/",$radius_worst) || !preg_match("/^[0-9.]*$/",$perimeter_worst) || !preg_match("/^[0-9.]*$/",$compactness_worst) || !preg_match("/^[0-9.]*$/",$concave_points_worst) || !preg_match("/^[0-9.]*$/",$concavity_worst) || !preg_match("/^[0-9.]*$/",$fractional_dimension_worst) || !preg_match("/^[0-9.]*$/",$smoothness_worst) || !preg_match("/^[0-9.]*$/",$symmetry_worst) || !preg_match("/^[0-9.]*$/",$texture_worst)){
$big++;
$_SESSION['invalid_text'] = "Invalid data";
}
if($big == 0){
date_default_timezone_set('Asia/Kolkata');
$time = date('Y-m-d H:i:s');
$query = "INSERT INTO patient_data VALUES (null,$radius_m,$texture_m,$perimeter_m,$area_m,$smoothness_m,$compactness_m,$concavity_m,$concave_points_m,$symmetry_m,$fractional_dimension_m,$radius_se,$texture_se,$perimeter_se,$area_se,$smoothness_se,$compactness_se,$concavity_se,$concave_points_se,$symmetry_se,$fractional_dimension_se,$radius_worst,$texture_worst,$perimeter_worst,$area_worst,$smoothness_worst,$compactness_worst,$concavity_worst,$concave_points_worst,$symmetry_worst,$fractional_dimension_worst,'','','$time',$user_id)";
$res = mysqli_query($conn,$query);
if($res){
header("location: result.php");
}
else{
header('location: app.php#text-data');
}
}
else{
header('location: app.php#text-data');
}
}
}
?>