Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <body bgcolor="#000">
- <?php
- function ExistsAndIsNotEmpty($name)
- {
- return (isset($_POST[$name]) && !empty($_POST[$name]));
- }
- $tourneyname = (ExistsAndIsNotEmpty('tournamentname')) ? htmlentities($_POST["tournamentname"]) : '';
- $start = (ExistsAndIsNotEmpty('start')) ? htmlentities($_POST["start"]) : '';
- $location = (ExistsAndIsNotEmpty('location')) ? htmlentities($_POST["location"]) : '';
- $prize = (ExistsAndIsNotEmpty('prize')) ? htmlentities($_POST["prize"]) : '';
- $brackets = (ExistsAndIsNotEmpty('brackets')) ? htmlentities($_POST["brackets"]) : '';
- $signup = (ExistsAndIsNotEmpty('signup')) ? htmlentities($_POST["signup"]) : '';
- $stream = (ExistsAndIsNotEmpty('stream')) ? htmlentities($_POST["stream"]) : '';
- $forum = (ExistsAndIsNotEmpty('forum')) ? htmlentities($_POST["forum"]) : '';
- if (isset($_POST['submit']))
- {
- if (!empty($tourneyname)
- && !empty($start)
- && !empty($location)
- && !empty($prize)
- && !empty($brackets)
- && !empty($signup)
- && !empty($stream)
- && !empty($forum))
- {
- $tourneyname = htmlentities($_POST["tournamentname"]);
- $start = htmlentities($_POST["start"]);
- $location = htmlentities($_POST["location"]);
- $prize = htmlentities($_POST["prize"]);
- $brackets = htmlentities($_POST["brackets"]);
- $signup = htmlentities($_POST["signup"]);
- $stream = htmlentities($_POST["stream"]);
- $forum = htmlentities($_POST["forum"]);
- $updatedPosts = <<< HTML
- <tr>
- <td>
- <font color="white">$tourneyname</font>
- </td>
- <td>
- <font color="white">$start</font>
- </td>
- <td>
- <font color="white">$location</font>
- </td>
- <td>
- <font color="white">$prize</font>
- </td>
- <td>
- <font color="white"><a href="$brackets">Brackets</a></font>
- </td>
- <td>
- <font color="white"><a href="$signup">Sign Up</a></font>
- </td>
- <td>
- <font color="white"><a href="$stream">Stream</a></font>
- </td>
- <td>
- <font color="white"><a href="$forum">Forum</a></font>
- </td>
- </tr>
- HTML;
- $fileHandler = fopen("posts.txt", "c");
- fwrite($fileHandler, $updatedPosts);
- fclose($fileHandler);
- }
- else
- {
- echo '<div class="error">';
- if (empty($tourneyname))
- {
- echo 'Please provide the tournament name.<br />';
- }
- if (empty($start))
- {
- echo 'Please provide the tournament start date.<br />';
- }
- if (empty($location))
- {
- echo 'Please provide the tournament location.<br />';
- }
- if (empty($prize))
- {
- echo 'Please provide the prize information for the tournament.<br />';
- }
- if (empty($brackets))
- {
- echo 'Please provide the bracket URL.<br />';
- }
- if (empty($signup))
- {
- echo 'Please provide the sign up URL.<br />';
- }
- if (empty($stream))
- {
- echo 'Please provide the stream URL.<br />';
- }
- if (empty($forum))
- {
- echo 'Please provide the forum URL.<br />';
- }
- echo '</div>';
- }
- }
- ?>
- <form id="form1" name="form1" method="post" action="">
- <table>
- <tr>
- <td><input type="text" name="tournamentname" placeholder="Tournament Name" size="13" maxlength="20" value="<?=$tourneyname; ?>" /></td>
- <td><input type="text" name="start" placeholder="01/01/0101" size="13" maxlength="10" value="<?=$start; ?>" /></td>
- <td><input type="text" name="location" placeholder="SC2: Sentinel Gaming" size="13" maxlength="25" value="<?=$location; ?>" /></td>
- <td><input type="text" name="prize" placeholder="$10" size="13" maxlength="10" value="<?=$prize; ?>" /></td>
- <td><input type="url" name="brackets" placeholder="URL" size="10" value="<?=$brackets; ?>" /></td>
- <td><input type="url" name="signup" placeholder="URL" size="10" value="<?=$signup; ?>" /></td>
- <td><input type="url" name="stream" placeholder="URL" size="10" value="<?=$stream; ?>" /></td>
- <td><input type="url" name="forum" placeholder="URL" size="10" value="<?=$forum; ?>" /> </td>
- </tr>
- <tr>
- <td colspan="8" align="right"><input type="submit" name="submit" id="submit" value="Submit Tournament" /></td>
- </tr>
- </table>
- <table>
- <tr>
- <td><font color="white" size="3"><b>Tournament Name</b></font></td>
- <td><font color="white" size="3"><b>Start</b></font></td>
- <td><font color="white" size="3"><b>Location</b></font></td>
- <td><font color="white" size="3"><b>Prize</b></font></td>
- <td><font color="white" size="3"><b>Brackets</b></font></td>
- <td><font color="white" size="3"><b>Signup</b></font></td>
- <td><font color="white" size="3"><b>Stream</b></font></td>
- <td><font color="white" size="3"><b>Forum</b></font></td>
- </tr>
- <?php include("posts.txt"); ?>
- </table>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement