parent
996d4c50dd
commit
cfc154c407
|
@ -0,0 +1,20 @@
|
|||
;<?php die(); ?>
|
||||
|
||||
[database]
|
||||
db_host = localhost
|
||||
db_database = alumni
|
||||
db_user =
|
||||
db_password =
|
||||
|
||||
[mail]
|
||||
mail_server =
|
||||
mail_port = 25
|
||||
mail_user =
|
||||
mail_address =
|
||||
mail_password =
|
||||
|
||||
[style]
|
||||
title = Alumni Max Emden
|
||||
logo_url = https://max-emden.net/iserv/logo/logo.jpg
|
||||
description = Beschreibender Text
|
||||
privacy_url = https://max-emden.de/wordpress/impressum
|
|
@ -0,0 +1,5 @@
|
|||
create table entries(id bigint auto_increment primary key, name varchar(255), mail varchar(255) unique,
|
||||
year int(4), birthday date, verify bool, vocation varchar(255)
|
||||
);
|
||||
|
||||
create table verify(id bigint primary key, uuid BINARY(16) ,foreign key verify(id) REFERENCES entries(id));
|
|
@ -17,7 +17,7 @@ function returnHeader() {
|
|||
<!Doctype html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<title>Alumni Max Emden</title>
|
||||
<title><?php echo getConfig()["title"] ?></title>
|
||||
<link rel="stylesheet" href="https://unpkg.com/spectre.css/dist/spectre.min.css">
|
||||
<link rel="stylesheet" href="https://unpkg.com/spectre.css/dist/spectre-exp.min.css">
|
||||
<link href="https://cdn.datatables.net/1.10.24/css/jquery.dataTables.min.css" rel="stylesheet">
|
||||
|
|
|
@ -17,7 +17,7 @@ $maxDate = date("m-d-Y", strtotime("-10 years"));
|
|||
<div class="columns">
|
||||
<div class="column col-2"></div>
|
||||
<div class="column col-8">
|
||||
<img class="img-responsive" src="<?php echo $config['logo_url'] ?>" alt="Logo Max-Windmüller Gymnasium"/>
|
||||
<img class="img-responsive" src="<?php echo $config['logo_url'] ?>" alt="Logo der Schule"/>
|
||||
</div>
|
||||
<div class="column col-2"></div>
|
||||
</div>
|
||||
|
@ -56,13 +56,12 @@ $maxDate = date("m-d-Y", strtotime("-10 years"));
|
|||
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="vocation">Tätigkeit</label>
|
||||
<textarea name="vocation" id="vocation" required="required" class="form-input">
|
||||
</textarea>
|
||||
<textarea name="vocation" id="vocation" required="required" class="form-input"></textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-checkbox">
|
||||
<input type="checkbox">
|
||||
<input type="checkbox" id="privacy" name="privacy" required="required">
|
||||
<i class="form-icon"></i>Ich akzeptiere hiermit<a
|
||||
href="<?php echo $config['privacy_url'] ?>" target="_blank"
|
||||
class="font-semibold text-black border-b-2 border-gray-200 hover:border-gray-500">
|
||||
|
|
28
submit.php
28
submit.php
|
@ -1,15 +1,31 @@
|
|||
<?php
|
||||
|
||||
//if ($_SERVER['REQUEST_METHOD'] != "POST") {
|
||||
// die();
|
||||
//}
|
||||
if ($_SERVER['REQUEST_METHOD'] != "POST") {
|
||||
die();
|
||||
}
|
||||
|
||||
require_once 'general.php';
|
||||
require_once 'vendor/autoload.php';
|
||||
|
||||
use PHPMailer\PHPMailer\PHPMailer;
|
||||
|
||||
$name = $_POST['name'];
|
||||
$mail = $_POST['mail'];
|
||||
$year = $_POST['year'];
|
||||
$birthday = $_POST['birthday'];
|
||||
$vocation = $_POST['vocation'];
|
||||
$privacy = $_POST['privacy'];
|
||||
|
||||
//validate here
|
||||
|
||||
|
||||
|
||||
$config = getConfig();
|
||||
|
||||
$mail = new PHPMailer(true);
|
||||
|
||||
$mail->isSMTP();
|
||||
$mail->SMTPAuth = true;
|
||||
$mail->Host = $config['mail_server'];
|
||||
$mail->Port = $config['mail_port'];
|
||||
$mail->Username = $config['mail_user'];
|
||||
|
@ -17,9 +33,13 @@ $mail->Password = $config['mail_password'];
|
|||
|
||||
$mail->From = $config['mail_address'];
|
||||
$mail->FromName = 'Mailer';
|
||||
$mail->addAddress('test@joethei.de', 'Joe User');
|
||||
try {
|
||||
$mail->addAddress('test@joethei.de', 'Joe User');
|
||||
} catch (\PHPMailer\PHPMailer\Exception $e) {
|
||||
}
|
||||
|
||||
$mail->Subject = 'Here is the subject';
|
||||
$mail->AltBody = 'Message without html';
|
||||
$mail->Body = 'This is the HTML message body <b>in bold!</b>';
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue