Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: Email PHP Code

  1. #1
    New Coder
    Join Date
    Aug 2010
    Posts
    35
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Email PHP Code

    Hello Every One,Here I am writing the full code of signup file of my website.
    I need That while someone registers A welcome mail should be sent to that user.It should contain image if wanted and graphics and simple text and links..Please help me..And any coder here who have knowledge of php and smarty plz contact me..

    Here is the php code of that file,the website is made with php and smarty so there is a language file too..

    PHP Code:
    <?
    $page 
    "signup";
    include 
    "header.php";

    if (isset ( 
    $_POST ['task'] )) {
        
    $task $_POST ['task'];
    } else {
        
    $task "";
    }

    // SET ERROR VARS
    $is_error 0;
    $error_message "";

    // IF USER IS ALREADY LOGGED IN, FORWARD TO USER HOME PAGE
    if ($user->user_exists != 0) {
        
    header "Location: user_home.php" );
        exit ();
    }

    // PROCESS INPUT FROM FIRST STEP (OR DOUBLE CHECK VALUES), CONTINUE TO SECOND STEP (OR SECOND STEP PROCESSING)
    if ($task == "register") {
        
    $signup_email $_POST ['signup_email'];
        
    $signup_mobile $_POST ['signup_mobile'];
        
    $signup_firstname $_POST ['signup_firstname'];
        
    $signup_lastname $_POST ['signup_lastname'];
        
    $signup_birthday $_POST ['Birthday_Day'];
        
    $signup_birthmonth $_POST ['Birthday_Month'];
        
    $signup_birthyear $_POST ['Birthday_Year'];
        
    $signup_birthtime "$signup_birthyear-$signup_birthmonth-$signup_birthday";
        
    $signup_gender $_POST ['signup_gender'];

        
    // CHECK TERMS OF SERVICE AGREEMENT IF NECESSARY
        
    if ($setting [setting_signup_tos] != 0) {
            
    $signup_agree $_POST ['signup_agree'];
            if (
    $signup_agree != 1) {
                
    $is_error 1;
                
    $error_message $signup [1];
            }
        }

        
    // RETRIEVE AND CHECK SECURITY CODE IF NECESSARY
        
    if ($setting [setting_signup_code] != 0) {
            
    session_start ();
            
    $code $_SESSION ['code'];
            if (
    $code == "") {
                
    $code randomcode ();
            }
            
    $signup_secure $_POST ['signup_secure'];

            if (
    $signup_secure != $code) {
                
    $is_error 1;
                
    $error_message $signup [2];
            }
        }

        if (
    $signup_gender != && $signup_gender != 2) {
            
    $is_error 1;
            
    $error_message "Please select your gender.";
        }

        if (! 
    $signup_birthday || ! $signup_birthmonth || ! $signup_birthyear) {
            
    $is_error 1;
            
    $error_message "Please select your birth day";
        }

        if (
    $signup_firstname == "") {
            
    $is_error 1;
            
    $error_message "Please enter your first name";
        }
        
        if (
    $signup_lastname == "") {
            
    $is_error 1;
            
    $error_message "Please enter your last name";
        }
        
        
    // CHECK USER ERRORS
        
    $new_user = new swimsms_user ();
        
    $new_user->user_account $signup_email$signup_mobile );
        if(
    $new_user->is_error == && is_error == 0){
            
    $is_error $new_user->is_error;
            
    $error_message $new_user->error_message;
        }
        
        
    // IF THERE IS NO ERROR, CONTINUE TO STEP 2 OR PROCESS STEP 2
        
    if ($is_error == 0) {

            
    $result 1;

            
    $new_user->user_create $signup_email$signup_mobile""$signup_firstname$signup_lastname$signup_birthtime$signup_gender );

            
    // IF THERE WAS AN ERROR, GO BACK TO STEP 1
        
    } else {
            
    $task "register";
        }

    } else {
        
    $result 0;
        
    $signup_birthtime "--";
    }

    // ASSIGN VARIABLES AND INCLUDE FOOTER
    $smarty->assign 'result'$result );
    $smarty->assign 'error_message'$error_message );
    $smarty->assign 'signup_email'$signup_email );
    $smarty->assign 'signup_mobile'$signup_mobile );
    $smarty->assign 'signup_firstname'$signup_firstname );
    $smarty->assign 'signup_lastname'$signup_lastname );
    $smarty->assign 'signup_birthtime'$signup_birthtime );
    $smarty->assign 'signup_gender'$signup_gender );
    $smarty->assign 'signup_secure'$signup_secure );
    $smarty->assign 'signup_agree'$signup_agree );

    include 
    "footer.php";
    ?>

  • #2
    New Coder
    Join Date
    Aug 2010
    Posts
    35
    Thanks
    2
    Thanked 0 Times in 0 Posts
    no1 to help me?

  • #3
    New Coder
    Join Date
    Nov 2010
    Posts
    30
    Thanks
    2
    Thanked 2 Times in 2 Posts


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •