Activity Stream
48,167 MEMBERS
6755 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1.     
    #1
    Member
    Website's:
    GoogleStore.org

    Exclamation [PHP] Newsletter Subscription Form -MailHandler Script

    Hello Coders,
    I have coded a website(html with js), where I want to place a Newsletter/updates subscription box.
    I have coded the design and html for the same, but unable to code the PHP mail-handler.
    I have searched through Google and now, I have something in my mind....

    1. Is it possible to create a DB for all registered emails, and can access get a complete full/incremental updates in email list through some logins?

    2. Is it only a mail notification for me that some one registered himself for newletter and I have to add his mail id in my list manually?

    3. Is there any auto grouping concept like, I have to send mail to only one ID and it will automatically sent to all registered mail ids which can be fetched from DB?

    Please suggest me an appropriate and best solution.

    BTW, my HTML form code is as below:

    Code: 
    <!--subscribe form here-->
    <form id="subform" method="post" action="subscribe/subscribe.php">
    <fieldset>
    <p><input name="email" id="email" onfocus="if (this.value == 'Email') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Email';}" value="Email" class="required email" /></p>
    <div class="button button-orange"> <span class="form_button clearfix"><input class="sub_submit" name="submit" value="subscribe" type="submit" /></span> </div>
    <div id="result_sub"></div></fieldset></form><!--subscribe form ends-->
    <div class="clear"></div></div></div><!--box ends-->
    <div class="clear"></div></div></div></div><!--section for subscribe ends-->

    Thanks for your support and co-operation.
    Regards,
    sf
    St0neF!sh Reviewed by St0neF!sh on . [PHP] Newsletter Subscription Form -MailHandler Script Hello Coders, I have coded a website(html with js), where I want to place a Newsletter/updates subscription box. I have coded the design and html for the same, but unable to code the PHP mail-handler. I have searched through Google and now, I have something in my mind.... 1. Is it possible to create a DB for all registered emails, and can access get a complete full/incremental updates in email list through some logins? 2. Is it only a mail notification for me that some one registered Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Member
    you're solution is

    Add the following code to your HTML page:


    Code: 
    <form method="POST" action="enter the URL to your PHP page here">
    <p>Name: <input type="text" name="Name" size="20"></p>
    <p>Email: <input type="text" name="Email" size="20"></p>
    <p><input type="submit" value="Submit" name="Submit"></p>
    </form>
    Create a new PHP file (e.g. subscribe.php) and place it on your webserver.

    Please update the URL in the HTML form.

    Code: 
    
    <?php
    
    ## CONFIG ##
    
    # LIST EMAIL ADDRESS
    $recipient = "enter the lists email address here";
    
    # SUBJECT (Subscribe/Remove)
    $subject = "Subscribe";
    
    # RESULT PAGE
    $location = "enter the URL of the result page here";
    
    ## FORM VALUES ##
    
    # SENDER
    $email = $_REQUEST['Email'] ;
    
    # MAIL BODY
    $body .= "Name: ".$_REQUEST['Name']." \n";
    $body .= "Email: ".$_REQUEST['Email']." \n";
    # add more fields here if required
    
    ## SEND MESSGAE ##
    
    mail( $recipient, $subject, $body, "From: $email" ) or die ("Mail could not be sent.");
    
    ## SHOW RESULT PAGE ##
    
    header( "Location: $location" );
    ?>
    Now save both files to your webserver and click on "Submit".
    The php script will not work on your local computer - please upload it first.

  4.     
    #3
    Member
    Website's:
    GoogleStore.org
    Quote Originally Posted by ankeshhimesh View Post
    you're solution is

    Add the following code to your HTML page:
    ........
    .........
    ..........

    Now save both files to your webserver and click on "Submit".
    The php script will not work on your local computer - please upload it first.

    If I am not wrong, you forgot to mention the bottom tag:
    I have already told before that I have Google'd it, and finding the exact solution probably from a coder....

  5.     
    #4
    Member
    This site is using a hacked database of W junction
    Last edited by Gavo; 4th Jan 2015 at 02:11 PM.

  6.     
    #5
    Member
    Website's:
    GoogleStore.org
    Quote Originally Posted by Gavo View Post
    There are loads of mailing lists scripts, just install one and add the form data to your site, pommo is one but there will be far better updated ones.
    I know that there are lots of scripts available and thats why I have raised some questions... And also want to get suggestions and personal experiences from other members as well as want to know that which one is better and can be implemented easily with max possibilities....

    Rgds,
    sf

  7.     
    #6
    Member
    Website's:
    ImageUpload.ca DownloadTorrent.ca CapitalBank.ca Back-links.ca
    To setup what you had mentioned, you will likely need to learn a little bit.
    You can create a secure admin panel, or otherwise upload/remove the .php script which will use a 'while' function to mass send your mail to the mailing list.

    You will however have to collect those mails into a database first..
    Including something like the following into the mentioned contact form after setting up a database will let you acquire those.

    <?php
    include("config.php");

    if(isset($_POST['subscribe'])) {
    $submail = $_POST['email'];

    $result = mysql_query("SELECT email FROM subscribers WHERE email='$submail'") or die(mysql_error());
    if (mysql_num_rows($result)==1) echo " ";
    else {
    $sql = "INSERT INTO subscribers (email) VALUES ('$submail')";
    $query = mysql_query($sql);}
    }

    ?>


    50% Off Coupon: KWWHhalfoff || Backlink Affiliate Program: http://earn.back-links.ca

  8.     
    #7
    Member
    Website's:
    GoogleStore.org
    I cant get you...
    Just let me know what will be the simple procedure for getting someones mail ID(who have entered their ID to receive the newsletter) into my mail ID...
    Please come with complete code, I am quite noob in PHP...

  9.     
    #8
    Member
    Website's:
    ImageUpload.ca DownloadTorrent.ca CapitalBank.ca Back-links.ca
    If you are only looking to receive a simple email containing the subscriber's email, the script mentioned previously before my post will work fine.

    You will then need to collect the emails and put them into a text file or list for later mailing - which too will have to be done manually..
    This gets tedious fast, especially if you are getting plenty of subscribers.


    50% Off Coupon: KWWHhalfoff || Backlink Affiliate Program: http://earn.back-links.ca

  10.     
    #9
    Member
    Website's:
    GoogleStore.org
    I have tried that before, but something slipped, I don't know what, but didn't worked...
    Tell me one thing bro, my domain is not yet propagated... is there any issue occurred due to that reason?

    My site is still in development phase, and can be browsed through temp url only...

  11.     
    #10
    Member
    Website's:
    ImageUpload.ca DownloadTorrent.ca CapitalBank.ca Back-links.ca
    You will need to have the script online/hosted to run properly, because it is a PHP file. Try it on a sub domain, or when it is setup.
    Using an html to call a php file on localhost will not work as you want.

    Here is the form (contact.php) I use personally, very simplistic and versatile (commented out the extras)

    <?php
    if(isset($_POST['contact'])) {



    $sendmail = 'receivinginbox@mail.com';
    $clientmail = $_POST['email'];
    $name = $_POST['name'];
    $message = $_POST['message'];



    // if ($clientmail == '') {
    // header('Location: contact.php?error=incomplete');
    // exit();
    // }

    // if ($message == '') {
    // header('Location: contact.php?error=incomplete');
    // exit();
    // }

    // if ($name == '') {
    // header('Location: contact.php?error=incomplete');
    // exit();
    // }


    //Send Mail

    $subject = "New message From ".$name;

    $sendmessage = "You have received a message from ".$name." at the contact address ".$clientmail."

    They said:

    ------------------------------------

    ".$message."

    ------------------------------------

    This message was sent from MyWebsite.com
    ";

    mail($sendmail, $subject, $sendmessage);

    header('Location: contact.php?mail=sent');
    exit();

    }

    ?>
    <?php
    //if($_GET["mail"] == "sent")
    // echo '<p style=" padding-left: 15px; color: #666666;"><b>Thanks for your message - We strive to answer all responses in 24 hours</b></p>';
    //if($_GET["error"] == "incomplete")
    // echo '<p style=" padding-left: 15px; color: red;"><b>Error - Please fill in the form completely!</b></p>';
    ?>
    <form action="" method="post" id="contact" name="contact" class="submitform" />
    <div><label>Name*</label><input type="text" name="name" /></div>
    <div><label>Email*</label><input type="text" name="email" /></div>
    <div><label>Message*</label><textarea name="message"></textarea></div>
    <div class="send-wrap">
    <div class="alignleft">
    <input class="send" type="submit" name="contact" id="contact" value="Send">
    </div>
    <span class="alignright">* required</span>
    </div>
    </form>


    50% Off Coupon: KWWHhalfoff || Backlink Affiliate Program: http://earn.back-links.ca

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 3
    Last Post: 30th Mar 2012, 04:22 PM
  2. Newsletter Box - Free PSD
    By Kr?niiK in forum Graphics Area
    Replies: 0
    Last Post: 7th Feb 2012, 08:02 PM
  3. form calculation script ?
    By MoWarez in forum Webmaster Discussion
    Replies: 3
    Last Post: 14th Dec 2011, 01:47 PM
  4. Email Newsletter Header
    By sarah1709 in forum Graphics Area
    Replies: 1
    Last Post: 18th Nov 2011, 04:16 PM

Tags for this Thread

BE SOCIAL