www/includes/contact.php

35 lines
942 B
PHP
Raw Permalink Normal View History

2019-07-13 15:01:11 +00:00
<?php
include "../config.php";
2019-07-13 17:34:43 +00:00
// This code is licensed under the AGPL 3 or later by ubergeek (https://tildegit.org/ubergeek)
2019-07-13 15:01:11 +00:00
$name = $_GET['contact_name'];
$return_addr = $_GET['email_address'];
2019-07-13 16:16:20 +00:00
$type = $_GET['type'];
2019-07-13 15:01:11 +00:00
$body = $_GET['message'];
$tv = $_GET['tv'];
2019-07-14 00:04:51 +00:00
$destination_addr = "root@thunix.net";
2019-07-13 15:01:11 +00:00
$subject = "Contact Form";
$mailbody = "The following submission via the contact form was recieved:
Real Name: $name
2019-07-13 16:16:20 +00:00
Type: $type
2019-07-13 15:51:48 +00:00
Message: $body";
2019-07-13 15:01:11 +00:00
if ( $tv != "tildeverse" ) {
print "Spam attempt";
2019-07-13 15:13:32 +00:00
header("Location: $site_root/?page=success1");
2019-07-13 15:01:11 +00:00
die();
}
shell_exec("echo '$mailbody' | /usr/bin/mail -s '$subject' -r '$return_addr' $destination_addr ");
2019-07-13 15:01:11 +00:00
// In the future, here, we *should* be able to build a process that
2019-07-13 16:25:00 +00:00
// auto opens an issue in the tildegit project
2019-07-13 15:01:11 +00:00
2019-07-13 15:13:32 +00:00
header("Location: $site_root/?page=success2");
2019-07-13 15:01:11 +00:00
die()
2019-07-13 17:24:36 +00:00
?>