-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsend.php
72 lines (60 loc) · 3.18 KB
/
send.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
<!DOCTYPE HTML>
<head><title>Mail details</title>
<style>
.seperate{
padding: 10px;
width: 20%;
border-radius: 15px;
outline: inherit;
}
body {background-color: aliceblue;}
</style>
</head>
<?php
$sub='message';
$text = $_GET['text'];
$max = $_GET['max'];
$conn = mysqli_connect('localhost','root','','bot');
$result = mysqli_query($conn,"select * from relation");
if (mysqli_num_rows($result) > 0) {
while($row = mysqli_fetch_array($result,MYSQLI_ASSOC)){
if(strpos($text,$row['name'])!==false || strpos($text,$row['relation'])!==false){
if(strpos($text,'mail')!==false){
$mail = $row['mail'];}
else{$mail=$row['phone'];}
break;}
else{$mail='';}
}}
echo "<center><br><br><br><br><form method='POST' action='mailsender.php'>";
if(strpos($text,'mail')!==false){
if($mail==''){
echo '<br><br>Enter the mail Id  <input list="mail" name="browser" class="seperate" required autocomplete="off" type="email">
<datalist id="mail" class="seperate">';
$result = mysqli_query($conn,"select * from relation");
if (mysqli_num_rows($result) > 0) {
while($row = mysqli_fetch_array($result,MYSQLI_ASSOC)){
echo '<option value="'.$row["mail"].'">';}}
echo '</datalist>';
echo "<br><br>Enter the subject for the mail  <input type='text' name='sub' class='seperate' required autocomplete='off'>";
echo "<br><br>Enter the message  <textarea type='text' name='body' class='seperate' required autocomplete='off'></textarea>";}
else{
echo "<br><br><input type='text' name='mail' value='$mail' hidden class='seperate' autocomplete='off'>";
echo "<br><br>Enter the subject for the mail  <input type='text' name='sub' class='seperate' required autocomplete='off'>";
echo "<br><br>Enter the message  <textarea type='text' name='body' class='seperate' required autocomplete='off'></textarea>";}}
else{
if($mail==''){
echo '<br><br>Enter the phone no  <input list="mail" name="browser" class="seperate" required autocomplete="off">
<datalist id="mail" class="seperate">';
$result = mysqli_query($conn,"select * from relation");
if (mysqli_num_rows($result) > 0) {
while($row = mysqli_fetch_array($result,MYSQLI_ASSOC)){
echo '<option value="'.$row["phone"].'">';}}
echo '</datalist>';
echo "<br><br><input type='text' name='sub' value='$sub' hidden class='seperate' required autocomplete='off'>";
echo "<br><br>Enter the message  <textarea type='text' name='body' class='seperate' required autocomplete='off'></textarea>";}
else{echo "<br><br><input type='text' name='mail' value='$mail' hidden class='seperate' required autocomplete='off'>";
echo "<br><br><input type='text' name='sub' value='$sub' hidden class='seperate' required autocomplete='off'>";
echo "<br><br>Enter the message  <textarea type='text' name='body' class='seperate' required autocomplete='off'></textarea>";}}
echo "<input type='text' name='max' value='$max' hidden class='seperate' required autocomplete='off'>";
echo "<br><br><br><input type='submit' value='DONE' class='seperate'></form></center";
?>