File: //var/www/html/index.php
<?php
$error = null;
if(isset($_POST['email'])){
require('php/mailchimp/Mailchimp.php'); // You may have to modify the path based on your own configuration.
$api_key = "b050ce2ada43a68bcf43d060271bc605-us19";
$list_id = "5ea54f6a68";
$Mailchimp = new Mailchimp( $api_key );
$Mailchimp_Lists = new Mailchimp_Lists( $Mailchimp );
try
{
$subscriber = $Mailchimp_Lists->subscribe(
$list_id,
array('email' => $_POST['email']), // Specify the e-mail address you want to add to the list.
null, // Set the first name and last name for the new subscriber.
'html', // Specify the e-mail message type: 'html' or 'text'
FALSE, // Set double opt-in: If this is set to TRUE, the user receives a message to confirm they want to be added to the list.
TRUE // Set update_existing: If this is set to TRUE, existing subscribers are updated in the list. If this is set to FALSE, trying to add an existing subscriber causes an error.
);
}
catch (Exception $e)
{
$error = "Caught exception: " . $e;
}
if ( ! empty($subscriber['leid']) )
{
$error = "Subscribed successfully.";
}
else
{
$error = "Subscribe attempt failed.";
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Kosmic Group of Companies</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Premium Bootstrap 4 Landing Page Template" />
<meta name="keywords" content="bootstrap 4, premium, marketing, multipurpose" />
<meta name="author" content="Shreethemes" />
<meta name="Version" content="2.0" />
<!-- favicon -->
<link rel="shortcut icon" href="images/favicon.ico">
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<!-- Icons -->
<link href="css/materialdesignicons.min.css" rel="stylesheet" type="text/css" />
<!-- Magnific -->
<link href="css/magnific-popup.css" rel="stylesheet" type="text/css" />
<!-- Slider -->
<link rel="stylesheet" href="css/owl.carousel.min.css"/>
<link rel="stylesheet" href="css/owl.theme.default.min.css"/>
<!-- Main Css -->
<link href="css/style.css" rel="stylesheet" type="text/css" />
<link href="css/colors/default.css" rel="stylesheet">
</head>
<body>
<!-- Loader -->
<div id="preloader">
<div id="status">
<div class="spinner">
<div class="double-bounce1"></div>
<div class="double-bounce2"></div>
</div>
</div>
</div>
<!-- Loader -->
<!-- Navbar STart -->
<header id="topnav" class="defaultscroll sticky">
<div class="container">
<!-- Logo container-->
<div>
<a class="logo" href="index.html">Kosmic<span class="text-primary">.</span>Group</a>
</div>
<!-- End Logo container-->
<div class="menu-extras">
<div class="menu-item">
<!-- Mobile menu toggle-->
<a class="navbar-toggle">
<div class="lines">
<span></span>
<span></span>
<span></span>
</div>
</a>
<!-- End mobile menu toggle-->
</div>
</div>
</div><!--end container-->
</header><!--end header-->
<!-- Navbar End -->
<!-- Hero Start -->
<section class="bg-half-170 d-table w-100" id="home">
<div class="container">
<div class="row align-items-center">
<div class="col-lg-7 col-md-7">
<div class="title-heading mt-4">
<h1 class="heading mb-3">Kosmic Group <br>of Companies</h1>
<p class="para-desc text-muted">Start working with the Kosmic Group of Companies to create, promote and entertain.</p>
<div class="watch-video mt-4 pt-2">
<a href="http://kosmiceventsja.com" class="btn btn-primary mb-2 mr-2">Kosmic Events</a>
<a href="http://kosmicfarms.com" class="btn btn-primary mb-2 mr-2">Kosmic Farms</a>
</div>
</div>
</div><!--end col-->
<div class="col-lg-5 col-md-5 mt-4 pt-2 mt-sm-0 pt-sm-0">
<img src="images/deal-end.png" alt="">
</div><!--end col-->
</div><!--end row-->
</div><!--end container-->
</section><!--end section-->
<!-- Hero End -->
<!-- Testimonial Start -->
<section class="section">
<div class="container">
<div class="row justify-content-center">
<div class="col-12 text-center">
<div class="section-title mb-4 pb-2">
<h4 class="title mb-4">Subscribe for our Latest Newsletter</h4>
<p class="text-muted para-desc mx-auto mb-0">Stay up-to-date with all <span class="text-primary font-weight-bold">Kosmic</span> news.</p>
<?php if(isset($error)) {?>
<p class="text-muted para-desc mx-auto mb-0"><?php echo($error) ?></p>
<?php } ?>
</div>
</div><!--end col-->
</div><!--end row-->
<div class="row justify-content-center mt-4 pt-2">
<div class="col-lg-7 col-md-10">
<form action="/" method="post">
<div class="form-group">
<div class="input-group mb-3">
<input name="email" id="email" type="email" class="form-control" placeholder="Your email :" required="" aria-describedby="newssubscribebtn">
<div class="input-group-append">
<button class="btn btn-primary submitBnt" type="submit" id="newssubscribebtn">Subscribe</button>
</div>
</div>
</div>
</form><!--end form-->
</div><!--end col-->
</div><!--end row-->
</div><!--end container-->
</section><!--end section-->
<!-- Testimonial End -->
<!-- Footer Start -->
<footer class="footer bg-light">
<div class="container">
<div class="row">
<div class="col-lg-4 col-12 mb-0 mb-md-4 pb-0 pb-md-2">
<a class="logo-footer text-dark" href="#">Kosmic<span class="text-primary">.</span></a>
<p class="mt-4 text-muted">Start working with the Kosmic Group of Companies to create, promote and entertain.</p>
</div><!--end col-->
<div class="col-lg-3 col-md-6 col-12 mt-4 mt-sm-0 pt-2 pt-sm-0">
<h4 class="text-dark footer-head">Companies</h4>
<ul class="list-unstyled footer-list mt-4">
<li><a href="http://kosmiceventsja.com" class="text-muted"><i class="mdi mdi-chevron-right mr-1"></i> Kosmic Events</a></li>
<li><a href="http://kosmicfarmsja.com" class="text-muted"><i class="mdi mdi-chevron-right mr-1"></i> Kosmic Farms</a></li>
</ul>
</div><!--end col-->
<div class="col-lg-5 col-md-6 col-12 mt-4 mt-sm-0 pt-2 pt-sm-0">
<h4 class="text-dark footer-head">Newsletter</h4>
<p class="mt-4 text-muted">Stay up-to-date with all kosmic news via email.</p>
<?php if(isset($error)) {?>
<p class="mt-4 text-muted"><?php echo($error) ?></p>
<?php } ?>
<form action="/" method="post">
<div class="row">
<div class="col-lg-12">
<div class="foot-subscribe foot-white form-group position-relative">
<label class="text-muted">Write your email <span class="text-danger">*</span></label>
<i class="mdi mdi-email ml-3 icons"></i>
<input type="email" name="email" id="emailsubscribe" class="form-control bg-light border pl-5 rounded" placeholder="Your email : " required>
</div>
</div><!--end col-->
<div class="col-lg-12">
<input type="submit" id="submitsubscribe" name="send" class="btn btn-primary w-100" value="Subscribe">
</div><!--end col-->
</div><!--end row-->
</form>
</div><!--end col-->
</div><!--end row-->
</div><!--end container-->
</footer><!--end footer-->
<footer class="footer footer-bar">
<div class="container text-center">
<div class="row align-items-center">
<div class="col-sm-6">
<div class="text-sm-left">
<p class="mb-0">© 2019-20 Kosmic.</p>
</div>
</div><!--end col-->
</div><!--end row-->
</div><!--end container-->
</footer><!--end footer-->
<!-- Footer End -->
<!-- Back to top -->
<a href="#" class="back-to-top rounded text-center" id="back-to-top">
<i class="mdi mdi-chevron-up d-block"></i>
</a>
<!-- Back to top -->
<!-- javascript -->
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.bundle.min.js"></script>
<script src="js/jquery.easing.min.js"></script>
<script src="js/scrollspy.min.js"></script>
<!-- Magnific Popup -->
<script src="js/jquery.magnific-popup.min.js"></script>
<script src="js/magnific.init.js"></script>
<!-- SLIDER -->
<script src="js/owl.carousel.min.js "></script>
<script src="js/owl.init.js "></script>
<!-- Counter -->
<script src="js/counter.init.js "></script>
<!-- Main Js -->
<script src="js/app.js"></script>
</body>
</html>