-
Notifications
You must be signed in to change notification settings - Fork 0
/
askdb.php
executable file
·48 lines (43 loc) · 1.38 KB
/
askdb.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
<?php
$que=htmlentities($_POST['que']);
$opt1=htmlentities($_POST['opt1']);
$opt2=htmlentities($_POST['opt2']);
$opt3=htmlentities($_POST['opt3']);
$opt4=htmlentities($_POST['opt4']);
$opt5=htmlentities($_POST['opt5']);
mysqli_real_escape_string($que);
mysqli_real_escape_string($opt1);
mysqli_real_escape_string($opt2);
mysqli_real_escape_string($opt3);
mysqli_real_escape_string($opt4);
mysqli_real_escape_string($opt5);
require 'db.php';
date_default_timezone_set('Asia/Kolkata');
if($que&&$opt1&&$opt2)
$dbresult = mysqli_query($conn,"insert into qdb values (' ', '".$que."', '".$opt1."', '".$opt2."', '".$opt3."', '".$opt4."', '".$opt5."', '', '', '', '', '', '".date("d")."', '".date("m")."', '".date("Y")."', '".date("h:i A")."', '1')");
else
header('Location: error.php');
if($dbresult)
{
$to="shilpi.gupta.0041@gmail.com";
$subject="Congo ! Someone asked a Question!";
$header="from: Pollsview <admin@pollsview.tk>";
$message="Hi Shilpi! Someone asked this on Pollsview:\n\n";
$message.=$que;
$sentmail = mail($to,$subject,$message,$header);
$to="rohitmishra2k12@gmail.com";
$subject="Congo ! Someone asked a Question!";
$header="from: Pollsview <admin@pollsview.tk>";
$message="Hi Rohit!\n";
$message.=$que;
$sentmail = mail($to,$subject,$message,$header);
}
if($dbresult)
{
header('Location: index.php');
}
else
{
header('Location: error.php');
}
?>