Advertisement
Guest User

Untitled

a guest
Apr 21st, 2018
302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.18 KB | None | 0 0
  1. <!doctype html>
  2. <html>
  3.  
  4. <head>
  5.  
  6. <script>
  7. function enableSubmit(){
  8. document.getElementById("send").disabled = false;
  9. }
  10. </script>
  11.  
  12. <?php
  13. $credentialfile = fopen("/home/admin/landingpage_mysql_creds.txt", "r") or die("Unable to open file!");
  14. $creds = explode(" ", fread($credentialfile, filesize("/home/admin/landingpage_mysql_creds.txt")));
  15.  
  16. $servername = "localhost";
  17. $username = trim($creds[0]);
  18. $password = trim($creds[1]);
  19. try {
  20. $conn = new PDO("mysql:host=$servername;dbname=LandingPage", $username, $password);
  21. // set the PDO error mode to exception
  22.  
  23. $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  24. // use exec() because no results are returned
  25. $sql = "SELECT * FROM domains WHERE domainname = \"" . str_ireplace('www.', '', $_SERVER['SERVER_NAME']) . "\"";
  26. // echo $sql;
  27. $data = $conn->query($sql);
  28. foreach ($data as $row) {
  29. $domain_name = $row["domainname"];
  30. $value = $row["value"];
  31. $image_url = $row["image_url"];
  32. $description = $row["description"];
  33. }
  34. } catch (PDOException $e) {
  35. echo "ERROR " . $sql . "<br>" . $e->getMessage();
  36. }
  37. $conn = null;
  38.  
  39. // Email address verification
  40. function isEmail($email)
  41. {
  42. return filter_var($email, FILTER_VALIDATE_EMAIL);
  43. }
  44. if ($_POST) {
  45. // Check Captcha
  46. captcha;
  47. if(isset($_POST['g-recaptcha-response'])){
  48. $captcha=$_POST['g-recaptcha-response'];
  49. }
  50. $secretKey = "6LdsMFQUAAAAAIRbP6hYmBs37ONsYiIhJWOaEHKn";
  51. $ip = $_SERVER['REMOTE_ADDR'];
  52. $response=file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".$secretKey."&response=".$captcha."&remoteip=".$ip);
  53. $responseKeys = json_decode($response,true);
  54. if(intval($responseKeys["success"]) == 1) {
  55.  
  56. // Enter the email where you want to receive the message
  57. $emailTo = 'lain21us@gmail.com';
  58. // $emailTo_2 = 'rrdein@gmx.com';
  59. $clientEmail = addslashes(trim($_POST['email']));
  60. $subject = 'Domain Inquiry for ' . $domain_name;
  61. $message = addslashes(trim($_POST['message']));
  62. $antispam = addslashes(trim($_POST['antispam']));
  63. $offer = addslashes(trim($_POST['offer']));
  64. $name = addslashes(trim($_POST['name']));
  65.  
  66. $array = array(
  67. 'emailMessage' => $clientEmail,
  68. 'messageMessage' => $message,
  69. 'antispamMessage' => $antispam,
  70. 'offerAmount' => $offer,
  71. 'offererName' => $name
  72. );
  73.  
  74. if (! isEmail($clientEmail)) {
  75. $array['emailMessage'] = 'Invalid email!';
  76. }
  77. if ($message == '') {
  78. $array['messageMessage'] = 'Empty message!';
  79. }
  80. if ($offer == '') {
  81. $array['offerAmount'] = 'Invalid Offer!';
  82. }
  83. if ($name == '') {
  84. $array['offererName'] = 'Invalid Name Field!';
  85. }
  86.  
  87. if (isEmail($clientEmail) && $message != '' && $offer != '' && $name != '') {
  88. // Send email
  89. /////// Reconsider Statements Below
  90. $headers = "From: " . $clientEmail . " <" . $clientEmail . ">" . "\r\n" . "Reply-To: " . $clientEmail;
  91. mail($emailTo, $subject, "From Name: " . $name . PHP_EOL . "From Email: " . $clientEmail . PHP_EOL . "Offer Amount: " . $offer . PHP_EOL . PHP_EOL . $message, $headers);
  92. mail($emailTo, $subject, "From Name: " . $name . PHP_EOL . "From Email: " . $clientEmail . PHP_EOL . "Offer Amount: " . $offer . PHP_EOL . PHP_EOL . $message, $headers);
  93. // mail($emailTo_2, $subject, "From Name: " . $name . PHP_EOL . "From Email: " . $clientEmail . PHP_EOL . "Offer Amount: " . $offer . PHP_EOL . PHP_EOL . $message, $headers);
  94. // mail($emailTo_2, $subject, "From Name: " . $name . PHP_EOL . "From Email: " . $clientEmail . PHP_EOL . "Offer Amount: " . $offer . PHP_EOL . PHP_EOL . $message, $headers);
  95.  
  96.  
  97. // Publish to SNS topic
  98. /////// Consider Switching to Azure since SNS SMS is no longer working
  99. require '/home/admin/aws-sdk/aws-autoloader.php';
  100. // $client = Aws\Sns\SnsClient;
  101. $client = new Aws\Sns\SnsClient([
  102. 'version' => 'latest',
  103. 'region' => 'us-west-2'
  104. ]);
  105. $result = $client->publish(array(
  106. 'TopicArn' => 'arn:aws:sns:us-west-2:462766680256:landingpage_notifications',
  107. // Message is required
  108. 'Message' => "From Name: " . $name . PHP_EOL . "From Email: " . $clientEmail . PHP_EOL . "Offer Amount: " . $offer . PHP_EOL . PHP_EOL . $message,
  109. 'Subject' => $subject
  110. ));
  111. }
  112.  
  113. // insert into database
  114. $conn = new PDO("mysql:host=$servername;dbname=LandingPage", $username, $password);
  115. $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  116. // //$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)";
  117. // //$conn->prepare($sql)->execute();
  118. // / //$sql_result = $conn->query($sql);
  119. // $sql = "INSERT INTO messages_received (id,from_name,from_email,domain_name,offer,message,date) VALUES (?,?,?,?,?,?,?)";
  120. $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)");
  121. $id = 0;
  122. $date = date('Y-m-d H:i:s');
  123. $stmt->bindParam(':id', $id);
  124. $stmt->bindParam(':from_name', $name);
  125. $stmt->bindParam(':from_email', $clientEmail);
  126. $stmt->bindParam(':domain_name', $domain_name);
  127. $stmt->bindParam(':offer', $offer);
  128. $stmt->bindParam(':message', $message);
  129. $stmt->bindParam(':date', $now);
  130. // $stmt->bind_param(0,$name,$clientEmail,$domain_name,$offer,$message,$date);
  131. $stmt->execute();
  132. }
  133. }
  134. ?>
  135.  
  136. <!-- Load Recaptcha API -->
  137. <script src='https://www.google.com/recaptcha/api.js'></script>
  138.  
  139. <meta charset="utf-8">
  140.  
  141. <!-- Page Title -->
  142. <title><?php echo $domain_name ?> is for sale!</title>
  143.  
  144. <!-- Page Description -->
  145. <meta name="description" content="<?php echo $description ?>">
  146.  
  147. <!-- Set the viewport to the device's screen width -->
  148. <meta name="viewport" content="width=device-width, initial-scale=1">
  149.  
  150. <!-- Icon -->
  151. <link rel="shortcut icon" href="assets/ico/favicon.ico"
  152. type="image/x-icon" />
  153. <link rel="apple-touch-icon" href="assets/ico/favicon.png">
  154.  
  155. <!-- Scripts and styles -->
  156. <!-- Styles for all browsers and IE 10+ -->
  157. <!--[if !IE]>-->
  158. <link rel="stylesheet" href="assets/css/screen.css">
  159.  
  160.  
  161. <style>
  162.  
  163. /* Button */
  164. .send-btn {
  165. background-color: #C05862;
  166. }
  167.  
  168. .send-btn:hover {
  169. background-color: #c76b73;
  170. }
  171. /* Price tag */
  172. .tag-outline path {
  173. fill: #C05862;
  174. }
  175. /* Footer heading */
  176. .footer .title {
  177. color: #C05862;
  178. }
  179.  
  180. /* Background image */
  181. body {
  182. background-image: url("<?php echo $image_url ?>");
  183. }
  184.  
  185. /* Background tint */
  186. /*body:after {
  187. background-color: rgba(50,47,72, .63);
  188. }*/
  189. /* Price tag background */
  190. .tag-fill path {
  191. fill: #29273c;
  192. }
  193. /* Footer background */
  194. .footer {
  195. background-color: rgba(14, 13, 20, .63);
  196. }
  197. /* Footer link hover */
  198. .footer a:hover {
  199. background-color: #322F48;
  200. }
  201. /* More Domains button */
  202. .more-domains-btn {
  203. background-color: rgba(14, 13, 20, .63);
  204. }
  205.  
  206. .more-domains-btn:hover, .more-domains-btn:focus {
  207. background-color: #322F48;
  208. }
  209. /* Domain Portfolio link */
  210. .domains a:hover {
  211. background-color: #322F48;
  212. }
  213. /* Offer form heading */
  214. .offer-form .title {
  215. color: #322F48;
  216. }
  217.  
  218. /* Narrow screen background styles */
  219. @media ( max-width : 480px) {
  220. .header {
  221. background-image: url('<?php echo $image_url ?>');
  222. }
  223. .header:after {
  224. background-color: rgba(50, 47, 72, .63);
  225. }
  226. }
  227. </style>
  228.  
  229. <!--<![endif]-->
  230. <!-- Basic styles for older browsers, IE 9 and below -->
  231. <!--[if lte IE 9]>
  232. <link rel="stylesheet" href="assets/css/old-ie.css">
  233. <![endif]-->
  234. <!-- Include jQuery with local fallback -->
  235. <script src="assets/js/jquery.min.js"></script>
  236. <script>window.jQuery || document.write('<script src="assets/js/jquery-1.11.3.min.js"><\/script>')</script>
  237.  
  238. <!-- jQuery plugins -->
  239. <script src="assets/js/plugins.js"></script>
  240.  
  241. <!-- JavaScript that runs on document load and document ready -->
  242. <script src="assets/js/main.js"></script>
  243.  
  244. <!-- Load fonts -->
  245. <script type="text/javascript">
  246. WebFontConfig = {
  247. google: {
  248. families: [ 'Open+Sans:700italic,800italic:latin', 'Open+Sans+Condensed:300:latin' ]
  249. }
  250. };
  251. (function() {
  252. var wf = document.createElement('script');
  253. wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
  254. '://ajax.googleapis.com/ajax/libs/webfont/1.5.18/webfont.js';
  255. wf.type = 'text/javascript';
  256. wf.async = 'true';
  257. var s = document.getElementsByTagName('script')[0];
  258. s.parentNode.insertBefore(wf, s);
  259. })(); </script>
  260.  
  261. <!-- Google Analytics -->
  262.  
  263. </head>
  264. <body>
  265. <div class="main-wrap">
  266.  
  267. <!-- Title and price -->
  268. <header class="header">
  269. <div class="header-inner">
  270. <h1 class="title">
  271. <span><?php echo $domain_name; ?></span>
  272. </h1>
  273. <span class="subtitle" style=""> is for sale! </span>
  274. <div class="price-tag" style="">
  275. <span class="price">$<?php echo $value; ?></span> <span
  276. class="caption"><abbr title="estimated">est.</abbr> value</span>
  277. <svg class="tag-outline" xmlns="http://www.w3.org/2000/svg"
  278. xmlns:xlink="http://www.w3.org/1999/xlink" width="100%"
  279. height="100%" viewbox="0 0 157 87" version="1.1"
  280. xml:space="preserve" stroke-linejoin="round">
  281. <g id="tag-outline">
  282. <path
  283. 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"
  284. fill="#c05862" />
  285. <path
  286. 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"
  287. fill="#c05862" />
  288. </g>
  289. </svg>
  290. <svg class="tag-fill" xmlns="http://www.w3.org/2000/svg"
  291. xmlns:xlink="http://www.w3.org/1999/xlink" width="100%"
  292. height="100%" viewbox="0 0 157 86" version="1.1"
  293. xml:space="preserve" stroke-linejoin="round">
  294. <path id="tag-fill"
  295. 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"
  296. fill="#28273c" style="fill-opacity:0.63;" />
  297. </svg>
  298. </div>
  299. </div>
  300. </header>
  301. <!-- Offer form -->
  302. <section class="main">
  303. <div class="main-inner">
  304. <form action=<?php echo htmlspecialchars($domain_name); ?>
  305. method="post" class="offer-form" id="offer-form">
  306. <h2 class="title">make your offer</h2>
  307. <p class="description">
  308. <?php echo $description ?>
  309. </p>
  310. <div class="form-error animated shake" style="display: none;">
  311. <span aria-hidden="true" class="icon li_pen"></span>
  312. <p>Please correct the form where indicated and resubmit, thanks!</p>
  313. <ul></ul>
  314. </div>
  315.  
  316. <div class="form-success animated zoomInDown"
  317. style="display: none;">
  318. <span aria-hidden="true" class="icon li_like"></span>
  319. </div>
  320.  
  321. <div class="fields">
  322. <!-- Domain Select Field -->
  323. <!-- Offer Field -->
  324. <div class="field-wrapper border">
  325. <label for="offer" class="offer-label">Offer</label> <input
  326. type="text" name="offer" id="offer" placeholder="offer ($)*"
  327. class="text-field" required minlength="2" value="">
  328. </div>
  329. <!-- Name Field -->
  330. <div class="field-wrapper border">
  331. <label for="name" class="name-label">Full Name</label> <input
  332. type="text" name="name" id="name" placeholder="full name*"
  333. class="text-field" required minlength="2" value="">
  334. </div>
  335. <!-- Email Field -->
  336. <div class="field-wrapper border">
  337. <label for="email" class="email-label">Email</label> <input
  338. type="text" name="email" id="email" placeholder="email*"
  339. class="email-field" required minlength="5" value="">
  340. </div>
  341. <div class="domain-name-field">
  342. <input type="hidden" id="url" name="url"
  343. value="<?php echo $_SERVER['SERVER_NAME']; ?>" />
  344. <!-- Message Field -->
  345. </div>
  346. <div class="field-wrapper border">
  347. <label for="email" class="message-label">Message</label>
  348. <textarea name="message" id="message" placeholder="message"
  349. class="textarea-field"></textarea>
  350. </div>
  351. <!-- Anti-spam Trap -->
  352. <div class="antispam">
  353. Leave this empty: <input type="text" name="antispam">
  354. </div>
  355. <!-- Recaptcha Field -->
  356. <div class="g-recaptcha" data-sitekey="" data-callback="enableSubmit"></div>
  357.  
  358. <div class="field-wrapper send-btn-wrapper">
  359. <input type="submit" id="send" name="send" value="send" class="send-btn">
  360. </div>
  361. </div>
  362. <!-- /fields -->
  363. </form>
  364. </div>
  365. <!-- /main-inner -->
  366. </section>
  367. <!-- /main -->
  368. </div>
  369.  
  370. <!-- My Contact Details -->
  371. <footer class="footer">
  372. <h3 class="title">contact</h3>
  373. <a class="email" href="mailto:rrdein@gmx.com,steamcheapcom@gmail.com">rrdein@gmx.com
  374. <br> steamcheapcom@gmail.com
  375. </a> <a class="phone" href="tel:1-916-451-6235">+1 1-916-451-6235
  376. (phone) <br> +1 1-916-451-6235 (sms)
  377. </a> <a class="twitter" href="https://twitter.com/rrdein">@rrdein</a>
  378. <br>
  379. <!-- Website Goes Here
  380. <a href="http://www.radiantdomains.com">Radiant Domains</a> -->
  381.  
  382. <!-- COPYRIGHT NOTICE
  383. <small class="copyright">
  384. &copy;2017. All Rights Reserved. </small> -->
  385. </footer>
  386.  
  387. <!-- My Domain Portfolio -->
  388. <!-- MORE DOMAINS SECTION, COMMENTED FOR NOW BECAUSE IT REQUIRES PHP
  389. <aside class="portfolio" id="portfolio">
  390. <ul class="domains" id="domains">
  391. <li>
  392. <a href="index.html">
  393. apk.com </a>
  394. </li>
  395. <li>
  396. <a href="https://web.archive.org/web/20170702205708/http://dxb.com/">
  397. dxb.com </a>
  398. </li>
  399. <li>
  400. <a href="https://web.archive.org/web/20170702205708/http://lefty.com/">
  401. lefty.com </a>
  402. </li>
  403. </ul>
  404.  
  405.  
  406. <div class="more-domains-btn-wrap">
  407. <button id="more-domains-btn" class="more-domains-btn">
  408. <span aria-hidden="true" class="li_world"></span> &nbsp; more domains
  409. </button>
  410. </div>
  411.  
  412.  
  413. </aside>
  414.  
  415.  
  416. </body>
  417.  
  418. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement