Email Subscription Form

This is one of the important concept The Email Subscription or Newsletter SignUp, This concept is used get the user Name and Email for to Provide our Latest Updates to the clients.

This is several ways to get Email Id from customer first one is to get email and name from user and store it to the text documents (like Notepad)

The second option is to get the Email id from customer and store it to the database table.

The Third one is to  store the Email id and customer name to the Our Email.

In this post i am explain about the First way , That is to store the email and name to the Notepad or Text Documents.

Remaining I will post after a few days....



<title>Simple Email Subscription Form | san web corner</title>
<META NAME='Keywords' lang='en-us' CONTENT='newsletter Signup, mailing list, subscriber, JQuery, PHP, mySQL, sign-up form'>
  <META NAME='description' CONTENT='A newsletter opt-in form using JQuery, PHP, mySQL.'>
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
  <script src="//"></script>
var thankyou = "Thank you";
function signup(thisform) {
    $("#submit, #myResponse")
    params = $("#subform")
    $.post("sub.php", params,
      function(response) {

            display: 'inline',
            color: 'green'
    return false;
td {
  padding: 5px;

  <form onsubmit="return signup(this);return false;" method="post" name="subform" id="subform" action="sub.php">
    <table width="400" border="1" style="border-collapse:collapse;" align="center" ;>
          <label style="display: inline-block;width:135px">Email:</label>
          <input type="email" required id="email" name="email" value="">
          <label style="display: inline-block;width:135px">Name:</label>
          <input type="text" required name="name" id="name" value="">
          <input type="submit" id="submit" name="submit" value="Sign up">
        <div style="width:100%"><span id="Error" style="color:red;display:none;"></span>
        <div id="myResponse" style="DISPLAY:none; text-align:center; width:100%; margin-left:auto; margin-right:auto;"></div>


$email = trim(htmlspecialchars($_REQUEST["email"]));
$name = trim(htmlspecialchars($_REQUEST["name"]));
$pfileName = "mails.txt";
$MyFile = fopen($pfileName, "a");
$nline="\"Email : ".$email."\"" ."----" ."\"Name : ".$name."\"" ."\r\n";
fwrite($MyFile, $nline);

In This I am using html and javascript and php to display error message and display the thanks message and validation.

You have to create one Notepad document name it as a mails 

Your Result Like below :


Post a Comment