Location: PHPKode > scripts > CSS3 Email Subscription > email-subscription-css/index.php
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"

<html xmlns="http://www.w3.org/1999/xhtml" lang="en">

<!-- Poppup script -->
<script type='text/javascript' charset='utf-8' src='jquery.js'></script>
  <script type='text/javascript' charset='utf-8' src='popbox.js'></script>
    <script type='text/javascript' charset='utf-8'>
<!-- Poppup End -->

<link href="style.css" type="text/css" rel="stylesheet">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />


<!-- Email Validation using JavaScript: starts -->
	<script type="text/javascript">
        function validateForm()
            var x=document.getElementById('textbox').value;
             var atpos=x.indexOf("@");
            var dotpos=x.lastIndexOf(".");
            if (x==null || x=="")
              alert("Please fill the email");
              return false;
            else if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)
              alert("Not a valid e-mail address");
              return false;
                  alert("successfully subscribed");
    <!-- Email Validation using JavaScript: end -->


<div class='popbox'>
   <a class='open round' href='#'>Subscribe Me!</a>
 <!-- subscribtion pop pup box starts -->     
    <div class='box'>
     <form name="form" method="post" onsubmit="return validateForm();">
		<div id="outerbox">
     		<div id="inner1">
        		<div id="text1">Subscribe for your NewsLetter</div>
           		<div id="mailbox"></div>
            <input name="email" type="text" id="textbox" size="30" onclick="this.style.backgroundColor='#f0f0f0'" onblur="this.style.backgroundColor='#ffffff'" value=""/>
    		<div id="inner2"></div>
    		<div id="inner4"></div>
   			<div id="inner3">
        		<div id="text2">I want to receive in my Email</div>
             	<input type="submit" value="Submit" id="submitbutton">

<!-- subscribtion pop pup box ends -->
<!-- PHP script to store email in text document -->
    if(isset($_POST['email'])) {
        $a =$_POST['email']."\n";
        $myFile = "subscriber.txt"; //Change the file name you want.
        $fh = fopen($myFile, 'a') or die("can't open file");
        fwrite($fh, $a);
<!-- PHP Script end -->
Return current item: CSS3 Email Subscription