Skip to content

Commit 3d6f7f2

Browse files
committed
Added files via upload
1 parent a110135 commit 3d6f7f2

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

src/contact.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!DOCTYPE HTML>
2+
<html>
3+
<body>
4+
5+
<form action="mail.php" method="post">
6+
Name: <input type="text" name="name"><br>
7+
E-mail: <input type="text" name="email"><br>
8+
Subject: <input type="text" name="sub"><br>
9+
Message: <textarea name="msg">
10+
</textarea>
11+
<input type="submit">
12+
</form>
13+
14+
</body>
15+
</html>

src/mail.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
session_start();
4+
include_once 'dbconnect.php';
5+
6+
$res=mysql_query("SELECT * FROM users WHERE user_id=".$_SESSION['user']);
7+
$userRow=mysql_fetch_array($res);
8+
9+
$account = $userRow['username'];
10+
11+
12+
if(!isset($_SESSION['user']))
13+
{
14+
$account = $_POST['name'];
15+
}
16+
17+
18+
19+
$subject = $_POST['sub'];
20+
$txt = $_POST['msg'];
21+
$email = $_POST['email'];
22+
$headers = "From: Ahitt-Industries || " . $email . " || " . $account;
23+
24+
mail($to,$subject,$txt,$headers);
25+
?>

0 commit comments

Comments
 (0)