•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 426,127 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 1,710 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: Programming Forums
Views: 2310 | Replies: 2
![]() |
| |
•
•
Join Date: Mar 2007
Posts: 3
Reputation:
Rep Power: 0
Solved Threads: 0
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.
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
•
•
Join Date: Mar 2007
Posts: 3
Reputation:
Rep Power: 0
Solved Threads: 0
[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?
$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?
•
•
Join Date: Mar 2007
Posts: 13
Reputation:
Rep Power: 2
Solved Threads: 0
Here is a piece of a redirect from one of my pages:
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.
•
•
•
•
//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.
![]() |
•
•
•
•
•
•
•
•
DaniWeb MySQL Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Need help with php mailing list/redirect (PHP)
- how to create mailing list (MySQL)
- Help with contact/mailing list database design... (Database Design)
- Mailing list script (Growing an Online Community)
Other Threads in the MySQL Forum
- Previous Thread: How to count sum of values in the table?
- Next Thread: Moving database to new server


Hybrid Mode