-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnamadanemail.php
74 lines (55 loc) · 2.08 KB
/
namadanemail.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
73
<?php
include("konekmysqli.php");
// if (!empty($_POST))
// {
// $output = '';
// $fullname = mysqli_real_escape_string($connect, $_POST["fullname"]);
// $email = mysqli_real_escape_string($connect, $_POST["email"]);
// $query = "INSERT INTO 'user_info' (user_name, user_mail) VALUES ('$fullname', $email)";
// if (mysqli_query($connect, $query))
// {
// $output .= "<script type='text/javascript'>
// window.onload=function()
// {
// alert('SUCCESFULLY CONNECTED');
// }";
// }
// echo $output;
// }
$usernama = $_POST['nama'];
$q1 = $_POST['q1'];
$q2 = $_POST['q2'];
$q3 = $_POST['q3'];
$q4 = $_POST['q4'];
$q5 = $_POST['q5'];
$q6 = $_POST['q6'];
$q7 = $_POST['q7'];
$q8 = $_POST['q8'];
$q9 = $_POST['q9'];
$q10 = $_POST['q10'];
$sql = "INSERT INTO user (name, q1, q2, q3, q4, q5, q6, q7, q8, q9, q10) VALUES
('$usernama', '$q1', '$q2', '$q3', '$q4', '$q5', '$q6', '$q7', '$q8', '$q9', '$q10')";
$query = mysqli_query($db, $sql);
if ($query > 0) {
echo "<script type='text/javascript'>alert('SUKSES DONG');</script>";
if ($q1 == 5 && $q2 == 5)
{
echo "alert('ini coba')";
// header('Location: istj.php?status=sukses');
}else{
echo "<script type='text/javascript'>alert('yah gagal');</script>";
}
} else {
echo "<script type='text/javascript'>alert('yah datanya belom kesimpen');</script>";
}
// $sql1 = "SELECT q1, q2, q3, q4, q5, q6, q7, q8, q9, q10 FROM user";
// $query1 = mysqli_query($db, $sql);
// $result = mysqli_fetch_assoc($query1);
// if ($q1 == 5 && $q2 == 5)
// {
// echo "<script type='text/javascript'>alert("WAGELASEH KAMU<br/>I S T J<br/>kaya aq :)");</script>";
// header('Location: istj.php?status=sukses');
// }else{
// echo "<script type='text/javascript'>alert("yah gagal");</script>";
// }
?>