-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathaction.php
111 lines (56 loc) · 3.09 KB
/
action.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<?php
require_once("config.php");
$user=$_POST['uname'];
$email=$_POST['email'];
$pass=$_POST['password'];
$password=md5($pass);
$query="INSERT into user(name,pass,status,email) VALUES('$user','$password','user','$email')";
$sq=mysqli_query($con,$query);
// if($sq)
// {
// require 'mail/PHPMailerAutoload.php';
// require_once('mail/class.phpmailer.php');
// $mail = new PHPMailer;
// //$mail->SMTPDebug = 2; // Enable verbose debug output
// $mail->isSMTP(); // Set mailer to use SMTP
// $mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers
// $mail->SMTPAuth = true; // Enable SMTP authentication
// $mail->Username = '[email protected]'; // SMTP username
// $mail->Password = 'shawonruet'; // SMTP password
// $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
// $mail->Port = 587; // TCP port to connect to
// // Add a recipient
// //$mail->addAddress('[email protected]'); // Name is optional
// //$mail->addReplyTo('[email protected]', 'Information');
// //$mail->addCC('[email protected]');
// //$mail->addBCC('[email protected]');
// //$mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
// //$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
// $mail->isHTML(true); // Set email format to HTML
// //$mail->Subject = 'RUET OJ Contest Alert Test';
// //$mail->Body = 'This is the Test Message <b>in bold!</b>';
// //$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
// $mail->setFrom('[email protected]', 'Ruet OJ');
// //echo "$em";
// $mail->addAddress($email,'User');
// $mail->Subject = 'RUET OJ';
// $mail->Body = 'Hi '.$user.' , Thank You For Your Registration.<br> Your Username : '.$user.'<br> Password : '.$pass.'<br>';
// $mail->AltBody = 'Hi '.$user.' , Thank You For Your Registration.<br> Your Username : '.$user.'<br> Password : '.$pass.'<br>';
// if(!$mail->send()) {
// echo 'Message could not be sent.';
// echo 'Mailer Error: ' . $mail->ErrorInfo;
// } else {
// echo 'Message has been sent';
// }
// $mail->ClearAddresses();
// }
if($sq)
{
header("Location:login.php");
}
else
{
header("Location:sign.php?value=fail");
//echo("Username already exists. Failed<br>");
}
?>