Further updates to form

This commit is contained in:
Fred Boniface 2022-09-16 21:14:24 +01:00
parent d8aa2889f5
commit 46841c465e

View File

@ -16,6 +16,26 @@
<body>
<?php
// define form variables and set to empty values (or to the UA)
$subject = $detail = "";
$ua_str = $_SERVER["HTTP_USER_AGENT"];
if ($_SERVER["REQUEST_METHOD"] == "POST" ) {
$subject = validate($_POST["subject"]);
$detail = validate($_POST["detail"]);
// ENTER CODE TO SUBMIT TO GITEA HERE
}
function validate($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
?>
<!-- Main Content Begins -->
<img class="titleimg" src="/assets/title/title.webp"></img>
@ -23,7 +43,7 @@
<p>Give as much detail as possible so we can try to fix the problem.</p>
<form action="/report-issue/submit.php" method="post">
<form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" method="post">
Subject:
<br>
<input type="text" name="subject">
@ -37,7 +57,10 @@
collected alongside the information you provide above and will be
posted to git.fjla.uk/fred.boniface/athena.fb-infra.uk/issues.
<br>
Your user agent is: <?php echo $_SERVER["HTTP_USER_AGENT"]; ?>
<br>
Your user agent is:
<br>
<?php echo $ua_str; ?>
<br>
<input type="submit">
</form>