Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8

Thread: mailing list

  1. #1
    New Coder
    Join Date
    Mar 2004
    Location
    Moscow, ID
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    mailing list

    So I am in a band, and I would like to setup a form so that people can add themselves to a mailling list so that I can send them an email to prior to show. I want it to added on to a pre-existing list, and ideally check the list for the same email address before it adds. I can do this this in C++, however I have no idea where to start with HTML.

    Any suggestions on where I can attain this information?
    Last edited by rudeanduncouth; 04-21-2004 at 10:01 AM.

  • #2
    Senior Coder
    Join Date
    Oct 2003
    Location
    Australia
    Posts
    1,963
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This is going to need a server side language, such as php.
    I'd PM a moderator and ask them to move this to one of the servr-side forums, depending on what languages are supported by your host.
    <plug type="very shameless">A musician eh? you might like it here...</plug>

    I take no responsibility for the above nonsense.


    Left Justified

  • #3
    New Coder
    Join Date
    Mar 2004
    Location
    Moscow, ID
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Does anybody have at least some mailing list code that I can look at and maybe modified to fit? Or at least a site with some free coding?

  • #4
    Senior Coder
    Join Date
    Feb 2004
    Posts
    1,206
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well the first question I'll ask is what program are you using to send your emails? And so what format is your mailing list in currently? Is it merely a text file? or a database? or some XML document? Also, what OS are you running? And how would you go about it with C++?

    Once you get us that information, then we can proceed to give you a hand.

    Edit: Moscow, ID == Moscow, Idaho?? Heard of Moscow, Russia, but... that's kinda cool.


    Sadiq.
    Last edited by sad69; 04-23-2004 at 01:30 AM.

  • #5
    Senior Coder
    Join Date
    Feb 2004
    Posts
    1,206
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well I did a little digging and came up with these links:
    http://tincan.co.uk/phplist
    http://www.hotscripts.com/PHP/Script...List_Managers/

    Hope that helps,
    Sadiq.

  • #6
    New Coder
    Join Date
    Mar 2004
    Location
    Moscow, ID
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    There are not going to very many people on list (I am talking like a max of 25 and that won't be for awhile), so I just plan on using outlook express. I am just going to grab the list off the server and copy the addresses in.

    I am just going to have a simple text file saying, "we have a show....blah, blah, blah"

    I am using Windows XP pro.

    Short of writing the code I would just get the inputted email address, open the file, check for a duplicate, if no duplicate is found, place at the bottom of the list. close the file.

  • #7
    New Coder
    Join Date
    Mar 2004
    Location
    Moscow, ID
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well, crap. What did you search for? I wasn't haven't a lot of luck, but I also didn't really no what language it would be for sure (other than this got moved to the PHP forum).

  • #8
    Senior Coder
    Join Date
    Feb 2004
    Posts
    1,206
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ok, so you want to do this in PHP? First of all, as it seems like this thread was moved here, do you have PHP installed on your server? Because for any of this to work, that's the first step.

    Once you've got that sorted out, we can do the following:
    Ok, so you've got a form on your website written in HTML? I'm assuming it just has a textbox (for the email address) and a submit button. The name attribute of your textbox is important as it will be the variable you'll use to reference the email address. Your form method should be set to POST, and your action should be set to your PHP file (ie. addToMailingList.php or something like that..).

    So now, pushing submit will send the email address to your PHP page for processing. Ok so now in your PHP file you need to open your text file, read it line by line and ensure the email address doesn't exist. If it doesn't exist you append it to the end of the file.

    Here's how:
    PHP Code:
    <?php
     $file_name 
    "mailing_list.txt";
     
    $var_name "email_address";

     if (!(
    $fp fopen($file_name"a+")))  
      exit(
    "Unable to open the input file.");
     
     while (!
    feof($fp)) {  
      
    $buffer fgets($fp1024);  
      if(
    $_POST[$var_name] == $buffer)
       exit(
    "Email address already exists.");
     }
     
     
    fwrite($fp$_POST[$var_name]);
     
    fclose($fp);
    ?>
    I'm pretty sure that'll work. So change $file_name and $var_name accordingly and hopefully that works out for you.

    Sadiq.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •