Fix Landing Page

i have a landing page in html coded. i want if someone put valid email and hit subscription then his email address listed my mailchimp list and he will visit my site. how can i do this please help me…

<!DOCTYPE html>
<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="content-type">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Squeeze Template - Simple 32</title>
    <style type="text/css">

      /* Template Created By Martin Chantler - http://reducethehype.com */
      
      html, body {
        margin: 0;
        padding: 0;
      }
      
      html { 
        background: url("http://s15.postimg.org/a3l1fal1n/Stasha_lifestyle17.jpg") no-repeat center center fixed; 
        -webkit-background-size: cover;
        -moz-background-size: cover;
        -o-background-size: cover;
        background-size: cover;
        font-family: Arial,Helvetica,sans-serif;
        text-align: center;
      }
            
      .heading {
        font-size: 2.5em;
        padding: 20px 15px;
        text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
      }
      
      .sub-heading {
        font-size: 1.75em;
        padding: 20px 15px;
        text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
      }
	  .logo{ 
	  float:left;
	  margin-top:20px;
	  margin-left:80px;
	  }
	  .empty{
	  height:160px;
	  }
      .ribbon {
        position: absolute;
        top: 20px;
        left: -10px;
        right: -10px;
        background-color: #9b59b6;
        font-size: 1.5em;
        font-weight: bold;
        text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
        padding-top: 10px;
        padding-bottom: 10px;
      }     
      
      .ribbon:before{
        border: 5px solid #8e44ad;
        border-left-color: transparent;
        border-bottom-color: transparent;
        content: "";
        position: absolute;
        left: 0px;
        bottom: -10px;
      }
      
      .ribbon:after{
        border: 5px solid #8e44ad;
        border-right-color: transparent;
        border-bottom-color: transparent;
        content: "";
        position: absolute;
        right: 0px;
        bottom: -10px;
      }
      
      .box {
        position: relative;
        max-width: 740px;
        width: 90%;
        background-color: rgba(0,0,0,0.5); 
        color: white;
        margin: 5% auto 0;
        border-radius: 10px;
        padding-bottom:16px !important;
        padding-top: 80px !important;
        -webkit-box-shadow: 0 8px 6px -6px black;
        -moz-box-shadow: 0 8px 6px -6px black;
        box-shadow: 0 8px 6px -6px black;
      }
      
      .form-skin {
        width: 80%;
        margin: 20px auto 0;
        font-size: 0;
      }
      
      input[type="text"], input[type="email"], button, input[type="submit"] {
        display: inline;     
        vertical-align: middle;
        font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
        font-size: 20px;  
        border: 0;
        padding-top: 10px;
        padding-bottom: 10px;
      }
       
      input[type="text"], input[type="email"] {
        width: 64%;
        border-top-left-radius: 5px;
        border-bottom-left-radius: 5px;
        color: #333;  
        background-color: white;
        padding-left: 10px;
      }      
      
      button, input[type="submit"] { 
        width: 33%;
        background-color: #9b59b6; 
        background: linear-gradient(#9b59b6, #8e44ad);
        cursor: pointer;
        color: #fff;
        white-space:normal;
        border-top-right-radius: 5px;
        border-bottom-right-radius: 5px;
		text-decoration:none;
      }
      
      button:hover, input[type="submit"]:hover {  
        background-color: #a669c2;
        background: linear-gradient(#aa60c9, #d18fec);
      }
      
      .privacy {
        clear: both;
        margin-top: 20px;
        font-size: .9em;
        color: #ccc;
      }
	  .social {
        margin-top: 50px;
        margin-bottom: 30px;
       }
	  #icons {
	  padding:0 0 0 .3em;
	  list-style: none;
	  width: 40%; 
	  margin:0 auto;
	  }
      #icons  li {
	  display:inline-block;
	   
	  width:25%;
	  text-align: center;
	  margin-left: -.25em;
	  vertical-align: top;
	  }
      #icons  li img {
	  width: 26px;height:27px;
	  
	  display:block;
	  margin:0 auto;
	  }
	  
     @media(max-width: 603px) {
        .ribbon {font-size: 1.25em;}
        input[type="text"], input[type="email"], button, input[type="submit"] {display: block; width: 100%; margin-top: 10px; border-radius: 5px; text-align: center; padding-left: 0;}
      }
        
      @media(max-width: 480px) {
        .ribbon {font-size: 1em;}
        .heading {font-size: 2em;}
        .sub-heading {font-size: 1.5em;}
      }
            
      @media(max-width: 320px) {
        input[type="text"], input[type="email"], button, input[type="submit"] {font-size: 15px;}
      }
            

</style> </head>
  <body>
    <div class="logo">
	    <a href="https:// www.sunsiyam.com"><img src="http://s15.postimg.org/artvy8jrf/logo_4.png" alt="" width="140" height="auto"/></a>
	</div>
	<div class="empty"></div>
    <div class="box">
      <div class="ribbon">INDULGENT LUXURY, AUTHENTIC ENCOUNTERS!</div>
      <div class="heading"> Sign Up For Your Free Wifi! </div>
      
      <div class="form-skin">
        <form method="POST" action="contactengine.php"> <input

            name="ID" value="RocketResponderListName" type="hidden"> <input name="return"

            value="" type="hidden"> <input name="confirm" value="" type="hidden">
          <input placeholder="Enter Your Email" name="email" class="email-input"

            required="required" type="email"> <a href="https://www.sunsiyam.com" style="text-decoration:none;"><button type="submit" class="button">Start Browsing</button></a>
        </form>
      </div>
	  
	  
	    <div class="social">
	        <ul id="icons">
			    <li id="telephone" >
				    <a href="https://www.facebook.com/voboghure.megh.7" style="" target="_blank">
 					    <img class="icon" src="http://s15.postimg.org/fa8jlwcnf/1491575320_facebook_social_media_logo.png" alt="" />
					</a>
				</li>
			
			    <li id="mobile">
				    <a href="https://www.facebook.com/voboghure.megh.7" style="" target="_blank">
 					    <img class="icon" src="http://s15.postimg.org/4bxa3po23/1491575363_twitter_social_media_logo.png" alt="" />
					</a>
				</li>
			
			    <li id="email">
				    <a href="https://www.facebook.com/voboghure.megh.7" style="" target="_blank">
 					    <img class="icon" src="http://s15.postimg.org/r6ntat1qj/1491575391_instagram_social_media_logo.png" alt="" />
					</a>
				</li>
			</ul>
	  </div>
      <div class="privacy"> Privacy Text Goes Here! </div>
    </div>
  </body>
</html>

and php:

<?php

	$EmailFrom = "Your E-mail Addresh";
	$EmailTo = "Your E-mail Addresh";
	$Name = Trim(stripslashes($_POST['Name']));
	$Email = Trim(stripslashes($_POST['Email'])); 

	
	

	// validation
	$validationOK=true;
	if (!$validationOK) {
	  print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
	  exit;
	}

	// prepare email body text
	$Body = "";
	$Body .= "Name: ";
	$Body .= $Name;
	$Body .= "\n";
	$Body .= "Email: ";
	$Body .= $Email;
	$Body .= "\n";
	
	

	// send email 
	$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");

	// redirect to success page 
	if ($success){
	  print "<meta http-equiv=\"refresh\" content=\"0;URL=https://www.sunsiyam.com">";
	}
	else{
	  print "<meta http-equiv=\"refresh\" content=\"0;URL=error.html\">";
	}
?>

Hi, @musfiq47jnu. Welcome to the forums. Could you please post the code from your landing page here so that we can see what you have so far?

Please make sure the code is properly formatted so that it is easier for us to read. To do this, just highlight the code that you pasted here, and select the </> icon that is above the edit area.

1 Like

please see

I have not worked with Mailchimp, so I’m not sure how it stores addresses, presumably using some kind of database.
But the PHP script you have appears to be some kind of simple “form mail” which emails a user’s information to a given address.
However the form processing does not match up the the html form that you posted. The fields do not match.
The html form has two hidden inputs (ID and confirm), an email input (email) and a submit button that is oddly wrapped in an anchor linking to a homepage.

Then the form processing takes values from just two fields, “Name” (not present in the form) and “Email” (with capital E, unlike the “email” field in the form).

The form “validation”:-

	// validation
	$validationOK=true;
	if (!$validationOK) {
	  print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
	  exit;
	}

I really don’t know what to say about that… :grimacing:
Maybe best just delete it, start again and pretend it did not happen. :shifty:
You may want to try a validation filter for emails:-
http://php.net/manual/en/filter.filters.validate.php

Can you explain exactly what it is you want the form to do?

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.