Guest User

Untitled

a guest
Jan 22nd, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. <?php
  2.  
  3. /* Let's prepare the message for the e-mail */
  4. $message = "
  5.  
  6. Name: $user_name
  7. Email: $email
  8. Number: $pass
  9. State: $user_state
  10.  
  11. ";
  12.  
  13.  
  14. /* Send the message using mail() function */
  15. mail($email, $user_name, $message);
  16.  
  17. /* Functions we used */
  18. function check_input($data, $problem='')
  19. {
  20. $data = trim($data);
  21. $data = stripslashes($data);
  22. $data = htmlspecialchars($data);
  23. if ($problem && strlen($data) == 0)
  24. {
  25. show_error($problem);
  26. }
  27. return $data;
  28. }
  29.  
  30. function show_error($myError)
  31. {
  32. ?>
  33. <html>
  34. <body>
  35.  
  36. <b>Please correct the following error:</b><br />
  37. <?php echo $myError; ?>
  38.  
  39. </body>
  40. </html>
  41. <?php
  42.  
  43.  
  44. exit();
  45.  
  46. }
  47. ?>
Add Comment
Please, Sign In to add comment