-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathadd.php
33 lines (27 loc) · 1.04 KB
/
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
29
30
31
32
33
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
<?php
session_start();
// error_reporting();
include('connection.php');
function jsLog(...$args) {
?>
<script>
console.log(<?= json_encode($args, JSON_THROW_ON_ERROR); ?>);
</script>
<?php }
$hid=$_REQUEST['hid'];
$qid=$_REQUEST['qid'];
$ans=$_REQUEST['answer'];
$link=$_REQUEST['link'];
$query="UPDATE help SET h_ans='$ans', h_link='$link' WHERE h_id=$hid";
$run=mysqli_query($conn,$query);
echo mysqli_affected_rows($conn);
if(mysqli_affected_rows($conn)==1)
{
echo "inside if";
header("Location:help_button.php?qid=".$qid."");
// echo "<script>if(swal('Good job!', 'You have solved the doubt!', 'success')){document.location.href=help_button.php?qid=".$qid.")};</script>";
// echo "<script>if(confirm('You have solved the doubt!')){document.location.href=help_button.php?qid=".$qid."};</script>";
// jsLog(mysqli_error($run));
}
?>