User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 370,609 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,073 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser:
Views: 2087 | Replies: 2
Reply
Join Date: Mar 2007
Posts: 3
Reputation: Slavis81 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Slavis81 Slavis81 is offline Offline
Newbie Poster

Help Newbie php question. how to create a mailing list?

  #1  
Mar 23rd, 2007
Hello, I am a newbie coder and I am trying to find a way to create a php mailing list.

Ive tried looking around but have only succeeded in becoming more lost and confused.

I would like the users to enter their email address into the text box and click submit and have the email addresses seperated by ;'s and imported into a .txt file on my server.

I will then copy the email addy's and import them into my emailing software.

Some options I would also like is a redirect to a page thanking them for adding their email to my list. I would obviously make the page but if nayone knows how to redirect with in the php file that would be excellent.

I am also interested in knowing if there could be a way to validate the email so that it is in proper email form ie 123@acb.com.

Thank you very much for any and all help.
Last edited by Slavis81 : Mar 23rd, 2007 at 5:48 pm. Reason: correction
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Mar 2007
Posts: 3
Reputation: Slavis81 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Slavis81 Slavis81 is offline Offline
Newbie Poster

Help Re: Newbie php question. how to create a mailing list?

  #2  
Mar 31st, 2007
[php]<?php
$email = $_POST['email'];
$data = "list.txt";
$open = fopen($data, "a");
fwrite($open, $email . "\n" );
fclose($open);
echo '<form style="visibility:hidden" action="http://www.stukface.com" method="post" name="theForm" id="theForm"><input type="hidden" name="NextPage" value=""> <input name="email" type="text" value="' . $_POST['email'] . '"><input type="submit" name="Submit22" value="submit" alt="submit"></form>';
echo '<SCRIPT LANGUAGE="JavaScript"> javascript:document.forms[0].submit() </script>'
?>[/php]

Here is some code i found, it seems to work but the redirect isn't working correctly. Does anyone know what is wrong?
Reply With Quote  
Join Date: Mar 2007
Posts: 13
Reputation: elderp is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
elderp elderp is offline Offline
Newbie Poster

Re: Newbie php question. how to create a mailing list?

  #3  
Jun 23rd, 2007
Here is a piece of a redirect from one of my pages:
//insert new record
$pfw_result = mysql_query($pfw_strQuery);
if (!$pfw_result) {
die('Invalid query: ' . mysql_error());
}
mysql_close($pfw_link);

echo("<p align='center'><font face='Arial' size='3' color='#FF0000'>Congrats, you are on the list!</font></p>");
include("footer.html");
?>

The last part just gives them a closing message and the include part is a javascript that closes it out. I am assuming you know a bit about java if not let me know and I will post a footer script for you. Hope this helps.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb MySQL Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the MySQL Forum

All times are GMT -4. The time now is 6:40 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC