-
Notifications
You must be signed in to change notification settings - Fork 1
/
contacts.php
58 lines (49 loc) · 1.48 KB
/
contacts.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
<?php
$TITLE="Contacts";
require_once "header.php";
?>
<h2>Contacts</h2>
<form class="form-horizontal" method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>" >
<div class="form-group">
<label class="control-label col-sm-2" for="name">Name:</label>
<div class="col-sm-10">
<input type="text" name="name" class="form-control" placeholder="First Last" required>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="email">Email:</label>
<div class="col-sm-10">
<input type="email" name="email" class="form-control" placeholder="Enter email" required>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="email">Message:</label>
<div class="col-sm-10">
<textarea class="form-control" rows="5" name="message" required></textarea>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<input type="hidden" name="subject" value="Contacts-AirRun">
<button type="submit" id="submit" name="submit" class="btn btn-default">Send</button>
</div>
</div>
</form>
<?php
if (isset($_POST['submit'])) {
echo "<p style=\"color:red\">Thank you for contacting us!</p>";
}
?>
<div class="container-fluid">
<h4>Company directory</h4>
<?php
$dir = getcwd();
$file = fopen("$dir/contacts.txt", "r");
while (! feof($file)) {
while ($string = fgets($file)) {
echo "$string<br>";
}
}
?>
</div>
<?php require_once "footer.php" ?>