-
Notifications
You must be signed in to change notification settings - Fork 0
/
registration-form.php
41 lines (34 loc) · 1.2 KB
/
registration-form.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
<?php
$name = $_POST['name'];
$mailfrom = $_POST['email'];
$from = "[email protected]";
$subject = "New Registration from " . $name;
$phone = $_POST['phone'];
$city = $_POST['city'];
$headers ="From: Contact Form <$from>\n";
$headers.="MIME-Version: 1.0\n";
$headers.="Content-type: text/html; charset=iso 8859-1";
ob_start();
?>
Hi There!<br /><br />
<?php echo ucfirst( $name ); ?> has submitted a project!
<br /><br />
Name: <?php echo ucfirst( $name ); ?><br />
Email: <?php echo $mailfrom; ?><br />
Subject: <?php echo $subject; ?><br />
Phone: <?php echo $phone; ?><br />
City: <?php echo $city; ?>
<br />
<br />
============================================================
<?php
$body = ob_get_contents();
ob_end_clean();
$to = '[email protected]';
$s = mail($to,$subject,$body,$headers,"-t -i -f $from");
if( $s == 1 ){
echo '<div class="alert alert-success" role="alert"> Your message has been sent successfully.</div>';
}else{
echo '<div class="alert alert-danger" role="alert">Your message sending failed!</div>';
}
?>