Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- UserSpice 4
- An Open Source PHP User Management System
- by the UserSpice Team at http://UserSpice.com
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
- error_reporting(E_ALL);
- ini_set('display_errors', 1);
- ini_set("allow_url_fopen", 1);
- ?>
- <?php
- require_once 'users/init.php';
- require_once $abs_us_root.$us_url_root.'users/includes/header.php';
- require_once $abs_us_root.$us_url_root.'users/includes/navigation.php';
- ?>
- <?php //if (!securePage($_SERVER['PHP_SELF'])){die();} ?>
- <div id="page-wrapper">
- <div class="container-fluid">
- <!-- Page Heading -->
- <div class="row">
- <div class="col-sm-12">
- <h1 class="page-header">
- Refer a Friend
- </h1>
- <?php
- if(!empty($_POST)){
- $email = Input::get('email');
- if (filter_var($email, FILTER_VALIDATE_EMAIL)) { //the email address looks valid
- $params = array(
- 'fname'=>$user->data()->fname,
- 'lname'=>$user->data()->lname,
- 'username'=>$user->data()->username,
- 'id'=>$user->data()->id,
- 'sitename'=>"This is the name of your site",
- );
- $to = rawurlencode($email);
- $subject = 'Request to join '.$settings->site_name;
- $body = email_body('_email_refer.php',$params);
- $mail_result = email($to,$subject,$body);
- $mail_result=email($to,$subject,$body);
- if($mail_result){
- echo '<div class="alert alert-success" role="alert">Mail sent successfully</div><br/>';
- }else{
- echo '<div class="alert alert-danger" role="alert">Mail ERROR</div><br/>';
- }
- }
- }
- ?>
- <form class="" action="" method="post">
- <label for="">Please enter a friend's email to refer them!</label>
- <input type="text" name="email" value="" required>
- <input type="submit" name="submit" value="Refer!">
- </form>
- <!-- Content Ends Here -->
- </div> <!-- /.col -->
- </div> <!-- /.row -->
- </div> <!-- /.container -->
- </div> <!-- /.wrapper -->
- <?php require_once $abs_us_root.$us_url_root.'users/includes/page_footer.php'; // the final html footer copyright row + the external js calls ?>
- <!-- Place any per-page javascript here -->
- <?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