Advertisement
Guest User

Untitled

a guest
Sep 25th, 2018
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.77 KB | None | 0 0
  1. <?php
  2. /*
  3. UserSpice 4
  4. An Open Source PHP User Management System
  5. by the UserSpice Team at http://UserSpice.com
  6.  
  7. This program is free software: you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation, either version 3 of the License, or
  10. (at your option) any later version.
  11.  
  12. This program is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. GNU General Public License for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. error_reporting(E_ALL);
  21. ini_set('display_errors', 1);
  22. ini_set("allow_url_fopen", 1);
  23. ?>
  24. <?php
  25. require_once 'users/init.php';
  26. require_once $abs_us_root.$us_url_root.'users/includes/header.php';
  27. require_once $abs_us_root.$us_url_root.'users/includes/navigation.php';
  28. ?>
  29.  
  30. <?php //if (!securePage($_SERVER['PHP_SELF'])){die();} ?>
  31. <div id="page-wrapper">
  32. <div class="container-fluid">
  33. <!-- Page Heading -->
  34. <div class="row">
  35. <div class="col-sm-12">
  36. <h1 class="page-header">
  37. Refer a Friend
  38. </h1>
  39. <?php
  40. if(!empty($_POST)){
  41. $email = Input::get('email');
  42. if (filter_var($email, FILTER_VALIDATE_EMAIL)) { //the email address looks valid
  43. $params = array(
  44. 'fname'=>$user->data()->fname,
  45. 'lname'=>$user->data()->lname,
  46. 'username'=>$user->data()->username,
  47. 'id'=>$user->data()->id,
  48. 'sitename'=>"This is the name of your site",
  49. );
  50. $to = rawurlencode($email);
  51. $subject = 'Request to join '.$settings->site_name;
  52. $body = email_body('_email_refer.php',$params);
  53. $mail_result = email($to,$subject,$body);
  54. $mail_result=email($to,$subject,$body);
  55.  
  56. if($mail_result){
  57. echo '<div class="alert alert-success" role="alert">Mail sent successfully</div><br/>';
  58. }else{
  59. echo '<div class="alert alert-danger" role="alert">Mail ERROR</div><br/>';
  60. }
  61. }
  62. }
  63. ?>
  64. <form class="" action="" method="post">
  65. <label for="">Please enter a friend's email to refer them!</label>
  66. <input type="text" name="email" value="" required>
  67.  
  68. <input type="submit" name="submit" value="Refer!">
  69. </form>
  70.  
  71. <!-- Content Ends Here -->
  72. </div> <!-- /.col -->
  73. </div> <!-- /.row -->
  74. </div> <!-- /.container -->
  75. </div> <!-- /.wrapper -->
  76.  
  77.  
  78. <?php require_once $abs_us_root.$us_url_root.'users/includes/page_footer.php'; // the final html footer copyright row + the external js calls ?>
  79.  
  80. <!-- Place any per-page javascript here -->
  81.  
  82. <?php require_once $abs_us_root.$us_url_root.'users/includes/html_footer.php'; // currently just the closing /body and /html ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement