Guest User

Untitled

a guest
Jul 17th, 2018
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.66 KB | None | 0 0
  1. <doCTyPe html>
  2. <head>
  3. <title>VG Events: Ask the Staffs</title>
  4.  
  5. </head>
  6. <body>
  7.  
  8. <?php
  9. /* Turtles */
  10.  
  11. // to easily config defaults
  12. $to = "infection@evildemonz.net";
  13. $subject = "Habbo.VG Event: Question the Staff";
  14.  
  15. // If submitted
  16. if ($_POST['submit']) {
  17.  
  18. // basic form validation
  19. if(!isset($_POST['username'])) { echo 'enter a username'; } else { $name = strip_tags( $_POST['username'] ); }
  20. if(!isset($_POST['email'])) { echo 'enter an email'; } else { $email = strip_tags( $_POST['email'] ); }
  21. if(!isset($_POST['question'])) { echo 'enter a question'; } else { $quest = strip_tags( $_POST['question'] ); }
  22. if(!isset($_POST['staff'])) { echo 'select a staff member'; } else { $staff = $_POST['staff']; }
  23.  
  24.  
  25. if ( $name && $email && $quest && $staff ) { // if everything is set and ok
  26.  
  27. // Begin Email Message Body
  28. $message = 'Habbo Name: ' . $senderName . '<br />';
  29. $message .= 'My Question is for: <' . $staff . '><br />';
  30. $message .= 'Answer: ' . $quest;
  31. $headers = 'From: ' . $email;
  32.  
  33. mail( $to, $subject, $message, $headers);
  34.  
  35. $thanks = 'Thanks ' . $name . ', your answers has been submitted.';
  36. $answer = 'You answered ' . $quest;
  37.  
  38. } // end if name && email && etc.
  39.  
  40. echo $thanks; // echo thank you
  41. echo $answer; // echo you answered
  42.  
  43. } else { // form not submitted so show the form ?>
  44.  
  45. <form action="<?php $_SERVER['PHP_SELF']; ?>" method="post">
  46. <p>
  47. <select name="staff">
  48. <option>Which Staff is this for?</option>
  49. <option value="Various" <?php if(isset($senderStaff1)) { echo 'selected="selected"'; } ?>>Various</option>
  50. <option value="Hex" <?php if(isset($senderStaff2)) { echo 'selected="selected"'; } ?>>Hex</option>
  51. <option value="Blair" <?php if(isset($senderStaff3)) { echo 'selected="selected"'; } ?>>Blair</option>
  52. <option value="Jinx" <?php if(isset($senderStaff4)) { echo 'selected="selected"'; } ?>>Jinx</option>
  53. </select>
  54. </p>
  55. <p>
  56. <label for="username">Habbo Name:
  57. <input name="username" type="text" id="username" size="40" maxlength="45" value="<?php if(isset($_POST['username'])) { echo $_POST['username']; } ?>" /></label>
  58. </p>
  59. <p>
  60. <label for="email">Habbo Email:
  61. <input name="email" type="text" id="email" size="40" maxlength="45" value="<?php if(isset($_POST['email'])) { echo $_POST['email']; } ?>" /></label>
  62. </p>
  63. <p>
  64. <label for="question">What is your question?:<br />
  65. <textarea name="question" id="question" rows="5" cols="45"><?php if(isset($_POST['question'])) { echo $_POST['question']; } ?></textarea></label>
  66. </p>
  67. <p>
  68. <input type="submit" id="submit" name="submit" value="Submit" />
  69. </p>
  70. </form>
  71.  
  72. <?php } // end of ELSE not submitted so show form ?>
  73.  
  74. </html>
  75. </body>
Add Comment
Please, Sign In to add comment