-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
64 lines (55 loc) · 1.66 KB
/
index.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
<?php
//start session
session_start();
// Include all the output functions
require_once('form.php');
// populate input fields into the session using a sub-array
$_SESSION['myForm'] = $_POST;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>CZ Batphone</title>
<link href="main.css" rel="stylesheet">
</head>
<body>
<div class="wrapper">
<div class="form-header">
<h1>BatPhone</h1>
</div>
<div class="report-form">
<?php
// contact form
if (isset($_POST['submitted']) && ('true' == $_POST['submitted'])) {
// checks if the form is submitted and then processes it
process_form();
} else {
// else prints the form
print_form();
}
?>
</div>
<div id="textarea_feedback"></div>
</div>
<div class="footer">
<span class="blurb">BatPhone is a web-to-SMS interface for anonymously contacting house level managers at Casa Zimbabwe</span>
<br>
<a href="https://github.com/krackistan/batphone">Source</a>
<a href="https://github.com/krackistan/batphone/issues">Bug Reports</a>
<a href="mailto:tc@ischool.berkeley.edu">Help</a>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#textarea_feedback').html('0/160');
$('textarea').keyup(function() {
var text_length = $('textarea').val().length;
$('#textarea_feedback').html(text_length + '/160');
});
});
</script>
</body>
</html>
<?php session_destroy(); //unset session data ?>