Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?PHP session_start( ); ?>
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8" />
- <title>Character Suggestor</title>
- <style>
- h1{
- background:rgba(255,255,255, 0.7);
- border: solid;
- }
- body{
- background-image: url("graphic/brawlBack.jpg");
- }
- #leftPane{
- border: solid;
- width: 49%;
- text-align:center;
- height: 50vw;
- float: left;
- background:rgba(255,255,255, 0.7);
- }
- #rightPane{
- text-align:center;
- width: 49%;
- height: 50vw;
- float: right;
- border:solid;
- background:rgba(255,255,255, 0.7);
- }
- </style>
- <?PHP
- $charIdeas = array("Gronk, AG, Orc",
- "Steplin, KL, Knight",
- "Distran, ScC, Demon",
- "Iltoc, SpB, Elf");
- ?>
- </head>
- <body>
- <h1 style="text-align: center">Brawlhalla Character Suggestions</h1>
- <div id="leftPane">
- <h2>Suggestion</h2>
- <form action="index.php" method="POST" name="frmAdd" id="frmAdd">
- Legend Name:<br>
- <input type="text" name="lgnName"><br>
- Class:<br>
- <input type="text" name="class"><br><br>
- Weapon Set:<br>
- <select name="wpnSet">
- <option value="SpB">Spear & Bow</option> // I was only able to get the first form to work.
- <option value="AG">Axe & Gaunlet</option>
- <option value="ScC">Scythe & Cannon</option>
- <option value="KL">Katars & Lance</option>
- </select> <br><br>
- <input type ="submit" name="btnAdd" id="btnAdd" value = "submit">
- </form>
- </div>
- <div id="rightPane">
- <h2>Submitted (Name, Weapons, Class)</h2>
- <?PHP
- /*/
- echo "DEBUG: \$charIdeas ";
- print_r($charIdeas);
- //*/
- //*/
- echo "DEBUG:\$_POST []<pre>";
- print_r($_POST);
- echo "</pre><br>";
- //*/
- $length = count($charIdeas);
- for($count=0; $count < $length; $count++ )
- {
- echo $charIdeas[$count] . "<br>";
- }
- if(array_key_exists('lgnName', $_POST)){
- echo "<h2>Thanks for your response!</h2>";
- $charIdeas = unserialize(urldecode($_SESSION['listOnServer']));
- array_push($charIdeas, $_POST['lgnName'] . ", " . $_POST['wpnSet'] . ", " . $_POST['class']);
- $_SESSION['listOnServer'] = urlencode(serialize($charIdeas));
- }
- else {
- echo "<h2>Please Submit Your Response In The Left Pane</h2>";
- $_SESSION['listOnServer'] = urlencode(serialize($charIdeas));
- }
- ?>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement