Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html>
- <head>
- <script>
- function enableSubmit(){
- document.getElementById("send").disabled = false;
- }
- </script>
- <?php
- $credentialfile = fopen("/home/admin/landingpage_mysql_creds.txt", "r") or die("Unable to open file!");
- $creds = explode(" ", fread($credentialfile, filesize("/home/admin/landingpage_mysql_creds.txt")));
- $servername = "localhost";
- $username = trim($creds[0]);
- $password = trim($creds[1]);
- try {
- $conn = new PDO("mysql:host=$servername;dbname=LandingPage", $username, $password);
- // set the PDO error mode to exception
- $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- // use exec() because no results are returned
- $sql = "SELECT * FROM domains WHERE domainname = \"" . str_ireplace('www.', '', $_SERVER['SERVER_NAME']) . "\"";
- // echo $sql;
- $data = $conn->query($sql);
- foreach ($data as $row) {
- $domain_name = $row["domainname"];
- $value = $row["value"];
- $image_url = $row["image_url"];
- $description = $row["description"];
- }
- } catch (PDOException $e) {
- echo "ERROR " . $sql . "<br>" . $e->getMessage();
- }
- $conn = null;
- // Email address verification
- function isEmail($email)
- {
- return filter_var($email, FILTER_VALIDATE_EMAIL);
- }
- if ($_POST) {
- // Check Captcha
- captcha;
- if(isset($_POST['g-recaptcha-response'])){
- $captcha=$_POST['g-recaptcha-response'];
- }
- $secretKey = "6LdsMFQUAAAAAIRbP6hYmBs37ONsYiIhJWOaEHKn";
- $ip = $_SERVER['REMOTE_ADDR'];
- $response=file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".$secretKey."&response=".$captcha."&remoteip=".$ip);
- $responseKeys = json_decode($response,true);
- if(intval($responseKeys["success"]) == 1) {
- // Enter the email where you want to receive the message
- $emailTo = 'lain21us@gmail.com';
- // $emailTo_2 = 'rrdein@gmx.com';
- $clientEmail = addslashes(trim($_POST['email']));
- $subject = 'Domain Inquiry for ' . $domain_name;
- $message = addslashes(trim($_POST['message']));
- $antispam = addslashes(trim($_POST['antispam']));
- $offer = addslashes(trim($_POST['offer']));
- $name = addslashes(trim($_POST['name']));
- $array = array(
- 'emailMessage' => $clientEmail,
- 'messageMessage' => $message,
- 'antispamMessage' => $antispam,
- 'offerAmount' => $offer,
- 'offererName' => $name
- );
- if (! isEmail($clientEmail)) {
- $array['emailMessage'] = 'Invalid email!';
- }
- if ($message == '') {
- $array['messageMessage'] = 'Empty message!';
- }
- if ($offer == '') {
- $array['offerAmount'] = 'Invalid Offer!';
- }
- if ($name == '') {
- $array['offererName'] = 'Invalid Name Field!';
- }
- if (isEmail($clientEmail) && $message != '' && $offer != '' && $name != '') {
- // Send email
- /////// Reconsider Statements Below
- $headers = "From: " . $clientEmail . " <" . $clientEmail . ">" . "\r\n" . "Reply-To: " . $clientEmail;
- mail($emailTo, $subject, "From Name: " . $name . PHP_EOL . "From Email: " . $clientEmail . PHP_EOL . "Offer Amount: " . $offer . PHP_EOL . PHP_EOL . $message, $headers);
- mail($emailTo, $subject, "From Name: " . $name . PHP_EOL . "From Email: " . $clientEmail . PHP_EOL . "Offer Amount: " . $offer . PHP_EOL . PHP_EOL . $message, $headers);
- // mail($emailTo_2, $subject, "From Name: " . $name . PHP_EOL . "From Email: " . $clientEmail . PHP_EOL . "Offer Amount: " . $offer . PHP_EOL . PHP_EOL . $message, $headers);
- // mail($emailTo_2, $subject, "From Name: " . $name . PHP_EOL . "From Email: " . $clientEmail . PHP_EOL . "Offer Amount: " . $offer . PHP_EOL . PHP_EOL . $message, $headers);
- // Publish to SNS topic
- /////// Consider Switching to Azure since SNS SMS is no longer working
- require '/home/admin/aws-sdk/aws-autoloader.php';
- // $client = Aws\Sns\SnsClient;
- $client = new Aws\Sns\SnsClient([
- 'version' => 'latest',
- 'region' => 'us-west-2'
- ]);
- $result = $client->publish(array(
- 'TopicArn' => 'arn:aws:sns:us-west-2:462766680256:landingpage_notifications',
- // Message is required
- 'Message' => "From Name: " . $name . PHP_EOL . "From Email: " . $clientEmail . PHP_EOL . "Offer Amount: " . $offer . PHP_EOL . PHP_EOL . $message,
- 'Subject' => $subject
- ));
- }
- // insert into database
- $conn = new PDO("mysql:host=$servername;dbname=LandingPage", $username, $password);
- $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- // //$sql = "CREATE TABLE IF NOT EXISTS messages_received (id INT NOT NULL AUTOINCREMENT, from_name VARCHAR(300), from_email VARCHAR(256), domain_name VARCHAR(500), offer FLOAT, message VARCHAR(5000), date DATE)";
- // //$conn->prepare($sql)->execute();
- // / //$sql_result = $conn->query($sql);
- // $sql = "INSERT INTO messages_received (id,from_name,from_email,domain_name,offer,message,date) VALUES (?,?,?,?,?,?,?)";
- $stmt = $conn->prepare("INSERT INTO messages_received (id,from_name,from_email,domain_name,offer,message,date) VALUES (:id,:from_name,:from_email,:domain_name,:offer,:message,:date)");
- $id = 0;
- $date = date('Y-m-d H:i:s');
- $stmt->bindParam(':id', $id);
- $stmt->bindParam(':from_name', $name);
- $stmt->bindParam(':from_email', $clientEmail);
- $stmt->bindParam(':domain_name', $domain_name);
- $stmt->bindParam(':offer', $offer);
- $stmt->bindParam(':message', $message);
- $stmt->bindParam(':date', $now);
- // $stmt->bind_param(0,$name,$clientEmail,$domain_name,$offer,$message,$date);
- $stmt->execute();
- }
- }
- ?>
- <!-- Load Recaptcha API -->
- <script src='https://www.google.com/recaptcha/api.js'></script>
- <meta charset="utf-8">
- <!-- Page Title -->
- <title><?php echo $domain_name ?> is for sale!</title>
- <!-- Page Description -->
- <meta name="description" content="<?php echo $description ?>">
- <!-- Set the viewport to the device's screen width -->
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <!-- Icon -->
- <link rel="shortcut icon" href="assets/ico/favicon.ico"
- type="image/x-icon" />
- <link rel="apple-touch-icon" href="assets/ico/favicon.png">
- <!-- Scripts and styles -->
- <!-- Styles for all browsers and IE 10+ -->
- <!--[if !IE]>-->
- <link rel="stylesheet" href="assets/css/screen.css">
- <style>
- /* Button */
- .send-btn {
- background-color: #C05862;
- }
- .send-btn:hover {
- background-color: #c76b73;
- }
- /* Price tag */
- .tag-outline path {
- fill: #C05862;
- }
- /* Footer heading */
- .footer .title {
- color: #C05862;
- }
- /* Background image */
- body {
- background-image: url("<?php echo $image_url ?>");
- }
- /* Background tint */
- /*body:after {
- background-color: rgba(50,47,72, .63);
- }*/
- /* Price tag background */
- .tag-fill path {
- fill: #29273c;
- }
- /* Footer background */
- .footer {
- background-color: rgba(14, 13, 20, .63);
- }
- /* Footer link hover */
- .footer a:hover {
- background-color: #322F48;
- }
- /* More Domains button */
- .more-domains-btn {
- background-color: rgba(14, 13, 20, .63);
- }
- .more-domains-btn:hover, .more-domains-btn:focus {
- background-color: #322F48;
- }
- /* Domain Portfolio link */
- .domains a:hover {
- background-color: #322F48;
- }
- /* Offer form heading */
- .offer-form .title {
- color: #322F48;
- }
- /* Narrow screen background styles */
- @media ( max-width : 480px) {
- .header {
- background-image: url('<?php echo $image_url ?>');
- }
- .header:after {
- background-color: rgba(50, 47, 72, .63);
- }
- }
- </style>
- <!--<![endif]-->
- <!-- Basic styles for older browsers, IE 9 and below -->
- <!--[if lte IE 9]>
- <link rel="stylesheet" href="assets/css/old-ie.css">
- <![endif]-->
- <!-- Include jQuery with local fallback -->
- <script src="assets/js/jquery.min.js"></script>
- <script>window.jQuery || document.write('<script src="assets/js/jquery-1.11.3.min.js"><\/script>')</script>
- <!-- jQuery plugins -->
- <script src="assets/js/plugins.js"></script>
- <!-- JavaScript that runs on document load and document ready -->
- <script src="assets/js/main.js"></script>
- <!-- Load fonts -->
- <script type="text/javascript">
- WebFontConfig = {
- google: {
- families: [ 'Open+Sans:700italic,800italic:latin', 'Open+Sans+Condensed:300:latin' ]
- }
- };
- (function() {
- var wf = document.createElement('script');
- wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
- '://ajax.googleapis.com/ajax/libs/webfont/1.5.18/webfont.js';
- wf.type = 'text/javascript';
- wf.async = 'true';
- var s = document.getElementsByTagName('script')[0];
- s.parentNode.insertBefore(wf, s);
- })(); </script>
- <!-- Google Analytics -->
- </head>
- <body>
- <div class="main-wrap">
- <!-- Title and price -->
- <header class="header">
- <div class="header-inner">
- <h1 class="title">
- <span><?php echo $domain_name; ?></span>
- </h1>
- <span class="subtitle" style=""> is for sale! </span>
- <div class="price-tag" style="">
- <span class="price">$<?php echo $value; ?></span> <span
- class="caption"><abbr title="estimated">est.</abbr> value</span>
- <svg class="tag-outline" xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink" width="100%"
- height="100%" viewbox="0 0 157 87" version="1.1"
- xml:space="preserve" stroke-linejoin="round">
- <g id="tag-outline">
- <path
- d="M143.87 82.33c5.14 0 9.33-4.19 9.33-9.33l0-59.7c0-5.14-4.19-9.33-9.33-9.33l-111.93 0c-3.24 0-6.19 1.64-7.91 4.38l-18.65 29.85c-1.88 3-1.88 6.89 0 9.89l18.65 29.85c1.71 2.74 4.67 4.38 7.91 4.38l111.93 0ZM143.87 0.25c7.2 0 13.06 5.86 13.06 13.06l0 59.7c0 7.2-5.86 13.06-13.06 13.06l-111.93 0c-4.53 0-8.67-2.29-11.07-6.14l-18.65-29.85c-2.63-4.2-2.63-9.64 0-13.84l18.65-29.85c2.4-3.84 6.54-6.14 11.07-6.14l111.93 0Z"
- fill="#c05862" />
- <path
- d="M31.94 51.74c4.73 0 8.58-3.85 8.58-8.58 0-4.73-3.85-8.58-8.58-8.58 -4.73 0-8.58 3.85-8.58 8.58 0 4.73 3.85 8.58 8.58 8.58M31.94 33.08c5.56 0 10.07 4.52 10.07 10.07 0 5.56-4.52 10.07-10.07 10.07 -5.56 0-10.07-4.52-10.07-10.07 0-5.56 4.52-10.07 10.07-10.07"
- fill="#c05862" />
- </g>
- </svg>
- <svg class="tag-fill" xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink" width="100%"
- height="100%" viewbox="0 0 157 86" version="1.1"
- xml:space="preserve" stroke-linejoin="round">
- <path id="tag-fill"
- d="M31.99 33.12c5.52 0 10 4.49 10 10 0 5.52-4.49 10-10 10 -5.52 0-10-4.49-10-10 0-5.52 4.49-10 10-10M2.47 50l18.53 29.64c2.39 3.82 6.5 6.09 11 6.09l111.15 0c7.15 0 12.97-5.82 12.97-12.97l0-59.28c0-7.15-5.82-12.97-12.97-12.97l-111.15 0c-4.5 0-8.61 2.28-11 6.09l-18.53 29.64c-2.61 4.18-2.61 9.57 0 13.75"
- fill="#28273c" style="fill-opacity:0.63;" />
- </svg>
- </div>
- </div>
- </header>
- <!-- Offer form -->
- <section class="main">
- <div class="main-inner">
- <form action=<?php echo htmlspecialchars($domain_name); ?>
- method="post" class="offer-form" id="offer-form">
- <h2 class="title">make your offer</h2>
- <p class="description">
- <?php echo $description ?>
- </p>
- <div class="form-error animated shake" style="display: none;">
- <span aria-hidden="true" class="icon li_pen"></span>
- <p>Please correct the form where indicated and resubmit, thanks!</p>
- <ul></ul>
- </div>
- <div class="form-success animated zoomInDown"
- style="display: none;">
- <span aria-hidden="true" class="icon li_like"></span>
- </div>
- <div class="fields">
- <!-- Domain Select Field -->
- <!-- Offer Field -->
- <div class="field-wrapper border">
- <label for="offer" class="offer-label">Offer</label> <input
- type="text" name="offer" id="offer" placeholder="offer ($)*"
- class="text-field" required minlength="2" value="">
- </div>
- <!-- Name Field -->
- <div class="field-wrapper border">
- <label for="name" class="name-label">Full Name</label> <input
- type="text" name="name" id="name" placeholder="full name*"
- class="text-field" required minlength="2" value="">
- </div>
- <!-- Email Field -->
- <div class="field-wrapper border">
- <label for="email" class="email-label">Email</label> <input
- type="text" name="email" id="email" placeholder="email*"
- class="email-field" required minlength="5" value="">
- </div>
- <div class="domain-name-field">
- <input type="hidden" id="url" name="url"
- value="<?php echo $_SERVER['SERVER_NAME']; ?>" />
- <!-- Message Field -->
- </div>
- <div class="field-wrapper border">
- <label for="email" class="message-label">Message</label>
- <textarea name="message" id="message" placeholder="message"
- class="textarea-field"></textarea>
- </div>
- <!-- Anti-spam Trap -->
- <div class="antispam">
- Leave this empty: <input type="text" name="antispam">
- </div>
- <!-- Recaptcha Field -->
- <div class="g-recaptcha" data-sitekey="" data-callback="enableSubmit"></div>
- <div class="field-wrapper send-btn-wrapper">
- <input type="submit" id="send" name="send" value="send" class="send-btn">
- </div>
- </div>
- <!-- /fields -->
- </form>
- </div>
- <!-- /main-inner -->
- </section>
- <!-- /main -->
- </div>
- <!-- My Contact Details -->
- <footer class="footer">
- <h3 class="title">contact</h3>
- <a class="email" href="mailto:rrdein@gmx.com,steamcheapcom@gmail.com">rrdein@gmx.com
- <br> steamcheapcom@gmail.com
- </a> <a class="phone" href="tel:1-916-451-6235">+1 1-916-451-6235
- (phone) <br> +1 1-916-451-6235 (sms)
- </a> <a class="twitter" href="https://twitter.com/rrdein">@rrdein</a>
- <br>
- <!-- Website Goes Here
- <a href="http://www.radiantdomains.com">Radiant Domains</a> -->
- <!-- COPYRIGHT NOTICE
- <small class="copyright">
- ©2017. All Rights Reserved. </small> -->
- </footer>
- <!-- My Domain Portfolio -->
- <!-- MORE DOMAINS SECTION, COMMENTED FOR NOW BECAUSE IT REQUIRES PHP
- <aside class="portfolio" id="portfolio">
- <ul class="domains" id="domains">
- <li>
- <a href="index.html">
- apk.com </a>
- </li>
- <li>
- <a href="https://web.archive.org/web/20170702205708/http://dxb.com/">
- dxb.com </a>
- </li>
- <li>
- <a href="https://web.archive.org/web/20170702205708/http://lefty.com/">
- lefty.com </a>
- </li>
- </ul>
- <div class="more-domains-btn-wrap">
- <button id="more-domains-btn" class="more-domains-btn">
- <span aria-hidden="true" class="li_world"></span> more domains
- </button>
- </div>
- </aside>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement