E-42/add_member.php

70 lines
1.9 KiB
PHP
Raw Normal View History

<?php
if(!isset($_GET['department'])){
header('Location: /');
die;
}
// check if department is valid
$departmemt = htmlentities(strtoupper($_GET['department']));
if(empty($departmemt) || !preg_match('/^[A-Z]-[0-9]*$/', $departmemt)){
header('Location: /' );
die();
}
?>
<!DOCTYPE html>
<HTML lang="en">
<HEAD>
<META http-equiv="Content-type" content="text/html;charset=UTF-8"/>
<TITLE>Add New Member - Porto Space Team</TITLE>
<LINK rel="stylesheet" href="https://diogo.site/assets/css/main.css" type="text/css"/>
<LINK rel="stylesheet" href="/style.css" type="text/css"/>
<LINK rel="shortcut icon" href="about:blank"/>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@48,400,0,0"/>
<META name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"/>
</HEAD>
<BODY>
<HEADER>
<DIV id="header-content">
<H1><? echo($departmemt);?> - Porto Space Team</H1>
<NAV>
<UL>
<LI><A href="/">Back</A></LI>
</UL>
</NAV>
</DIV>
</HEADER>
<HR/>
<MAIN>
<H2>Add New Member </H2>
<form action="/action/action_add_member.php" method="GET">
<label for="name">Member Name </label>
<input id="name" type="text" name = "name"/>
<input type="hidden" name ="department" value = "<? echo($departmemt)?>">
<br>
<input type="submit" value ="Add Member"/>
</form>
</MAIN>
<HR/>
<FOOTER>
<P><SMALL>This website's source code is <A href="https://codeberg.org/portospaceteam/E-42">hosted here</A>.</SMALL>
</P>
<P><SMALL>Unless stated otherwise, you can assume <A href="https://creativecommons.org/licenses/by-sa/4.0/">Attribution-ShareAlike 4.0 International (CC BY-SA
4.0)</A>.</SMALL></P>
</FOOTER>
</BODY>
</HTML>