recruiting.php (nefunkční mailform)
Kde je chyba?
php
<?php
mb_internal_encoding("UTF-8");
$announce = '';
if (isset($_GET['sucess']))
$announce = 'You sucefully requested for a guild membership.';
if ($_POST)
{
if (isset($_POST['nickname']) && $_POST['nickname'] &&
isset($_POST['email']) && $_POST['email'] &&
isset($_POST['message']) && $_POST['message'] &&
isset($_POST['strategy']) && $_POST['strategy'] &&
isset($_POST['year']) && $_POST['year'] == date('Y'))
{
$head = 'From:' . $_POST['email'];
$head .= "\nMIME-Version: 1.0\n";
$head .= "Content-Type: text/html; charset=\"utf-8\"\n";
$adress = '[email protected]';
$subject = 'Guild Application';
$sucess = mb_send_mail($adress, $subject, $_POST['message'], $_POST['strategy'], $head);
if ($sucess)
{
$announce = 'You sucefully requested for a guild membership.';
header('Location: mailform.php?sucess=yes');
exit;
}
else
$announce = 'Not a sucess. All text areas are necessary!';
}
else
$announce = 'Not a sucess. All text areas are necessary!';
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Animated Fortification Guild</title>
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<style>
textarea {display: block; width: 90%; height: 85px; margin-left:auto;margin-right: auto;}
</style>
</head>
<body>
<header>
<h1 class="title">Animated Fortification Guild & Fansite</h1>
<nav>
<ol>
<li><a href="/tribute.html">Contribute</a></li>
<li><a href="/videos.html">Videos</a></li>
<li><a href="/guides.html">Guides</a></li>
<li><a href="/about_game.html">Crowfall</a></li>
<li><a href="/index.html">Homeland</a></li>
</ol>
</nav>
<nav>
<ol class="secretol">
<li class="secretli"><a href="/secret/commandship.html">Command</a></li>
<li class="secretli"><a href="/secret/fcrafters.html">Crafters</a></li>
<li class="secretli"><a href="/secret/fmembers.html">Members</a></li>
<li class="secretli"><a href="/secret/fallies.html">Alliance</a></li>
</ol>
</nav>
<h2> Another Brave Warrior Joining Us?</h2>
</header>
<article>
<header>
<h3>Send a Request</h3>
</header>
<section>
<p>We are happy to see you here. An elite troops like you are certainly welcomed. All you need to do is to submit a following form. Or you can ask additional questions personally to the leader.</p>
<?php
if ($announce)
echo('<p>' . htmlspecialchars($announce) . '</p>');
$nickname = (isset($_POST['nickname'])) ? $_POST['nickname'] : '';
$email = (isset($_POST['email'])) ? $_POST['email'] : '';
$message = (isset($_POST['message'])) ? $_POST['message'] : '';
$strategy = (isset($_POST['strategy'])) ? $_POST['strategy'] : '';
?>
<form method="POST">
<table>
<tr>
<td>Nickname</td>
<td><input name="nickname" type="text" value="<?= htmlspecialchars($nickname) ?>" /></td>
</tr>
<tr>
<td>Email</td>
<td><input name="email" type="email" value="<?= htmlspecialchars($email) ?>" /></td>
</tr>
<tr>
<td>Current year (antispam)</td>
<td><input name="year" type="number" /></td>
</tr>
</table>
<p align="center">What do you expect from joining our side?</p>
<textarea name="message" placeholder="I hope to join Animated Fortification, because..." value="<?= htmlspecialchars($message) ?>"></textarea><br>
<p align="center">Write a bit about your gameplay style</p>
<textarea name="strategy" placeholder="I prefer meele weapons, heavy axes, maces and those that do huge DPS. I am usually first person who charges and I predict Champion with Myrmidon to be my favourite classes. When it comes to crafting, I really enjoy runemastery." value="<?= htmlspecialchars($strategy) ?>"></textarea><br>
<input type="submit" value="Send" />
</form>
</section>
</article>
<aside>
<h3>Recruiting in Progress</h3>
<p>We recruit new glorious warriors to join our side. Join your strength with ours and whole world will tremble before our collective myth.</p>
</aside>
<endora>
<footer>
<p>©2016 All rights reserved. This website and most of its content is owned by Animated Fortification guild. Some of the art is property of ArtCraft and is used under limited permission license.</p>
</footer>
</html>
Neformátovaný
Přidáno: 13.8.2016
Expirace: Neuvedeno