-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreg.php
61 lines (52 loc) · 1.27 KB
/
reg.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
<?php
session_start();
$name=$_POST['name'];
$phn=$_POST['tel'];
$email=$_POST['email'];
require_once 'Connection.php';
//echo "\'$con\'";
mysql_select_db("test", $con);
$to = $email;
$subject = "Test mail";
$from = "[email protected]";
$headers = "From:" . $from;
$min=1000;
$max=10000;
$phn1= \rand($min,$max);
$email1= rand($min, $max);
$message="Your email address:".$to." password:".$email1;
if(mail($to, $subject, $email1))
{
$fp = fopen("myText.txt","wb");
if( $fp == false ){
}else{
fwrite($fp,$message);
fclose($fp);
$_SESSION['flag']=true;
$_SESSION['name']=$name;
$_SESSION['email']=$email;
}
}
elseif ($to!="") {
$fp = fopen("myText.txt","wb");
if( $fp == false ){
}else{
fwrite($fp,$message);
fclose($fp);
$_SESSION['flag']=true;
$_SESSION['name']=$name;
$_SESSION['email']=$email;
}
}
else {
echo "error";
}
$sql="INSERT INTO registration
VALUES
('$name','$phn','$email','$email1','null','null','null','null','null','null','null','null','null','null','null','null','null','null','null','null','null','null','null')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
header('Location:Signin.php');
mysql_close($con);