-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpoet.php
More file actions
29 lines (26 loc) · 1.02 KB
/
poet.php
File metadata and controls
29 lines (26 loc) · 1.02 KB
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
<?php
include 'connect.php';
if(isset($_POST)){
$reg_id_poet = $_POST['reg_id_poet'];
$sql_u="SELECT firstname,lastname, email, phone, college, gender FROM users where id='$reg_id_poet'";
$res_u=mysqli_query($conn, $sql_u) or die(mysqli_error($conn));
if(mysqli_num_rows($res_u) > 0){
while($row = mysqli_fetch_array($res_u)){
$sql = "INSERT INTO poetry(id,firstname,lastname,email,phone,college,gender) VALUES ('$reg_id_poet','$row[0]','$row[1]','$row[2]','$row[3]','$row[4]','$row[5]')";
$to= $row[2];
}
if(mysqli_query($conn,$sql)){
$from = "info@helix20.com";
$subject = 'Registration For Helix-20';
$message = "You are Successfully Registered for Poetry.\nAll the Best, See you at the venue:-Main block Conference Hall\nTimestamp:-18 Feb. 2020, 11:00AM - 01:00PM\nIf you have any queries regarding the contest, feel free to get in touch with us.\n\nRegards,\nHelix-20";
$headers="From: ".$from;
mail($to,$subject,$message,$headers);
echo "1";
}else{
echo '0';
}
}else{
echo "0";
}
}
?>