Jump to content


Photo

mailing list problems


  • Please log in to reply
3 replies to this topic

#1 cuekillar

cuekillar
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 12 October 2006 - 11:46 PM

when u type ur address in and hit submit nothing happens and it just resets, although it did make the email_list.txt file but wont add anythign into it... Im completely lost, any thoughts

theres the site http://www.nintendo..../send_email.php


===CODE====
<?php
// join the mail list?
if ($php_script_list == "yes")

if(file_exists("email_list.txt"))
{
$newfile = fopen("email_list.txt", "r");
while(!feof($newfile))
{
$duplicate = fgetss($newfile, 255);
// is email address submitted already on file?
if(eregi("$from", $duplicate))
{
print("This email <strong>$from</strong>");
print(" is already in the database. <br>Please go back");
print(" and uncheck the mail list box");
fclose($newfile);
exit;
}
}
fclose($newfile);
$addemail = fopen("email_list.txt", "a");
fputs($addemail, "$from\n");
fclose($addemail);
}
else
{
// since file doesn't already exist, let's create for first time
$newfile = fopen("email_list.txt", "a");
fputs($newfile, "$from\n");
fclose($newfile);
chmod("email_list.txt", 0666);
}

?>


<form action="" method="POST">
e-mail:<input type="text" size="22" name="from" value="urisp@urisp.com"><br>
Let me recieve newsletters!<input type="checkbox" name="php_script_list" value="yes"><br><br>
Enter your message and click submit!<input type="submit" name="submit" value="Submit">


====END CODE====

#2 cuekillar

cuekillar
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 12 October 2006 - 11:58 PM

also how could I add a message that appears when some1 joins the list or a redirected page saying thanks or somthing?


thanks in advanced :)

#3 tomfmason

tomfmason
  • Staff Alumni
  • Advanced Member
  • 1,696 posts
  • Locationstealing your wifi

Posted 13 October 2006 - 12:12 AM

try using fwrite instead of fputs.

Traveling East in search of instruction, and West to propagate the knowledge I have had gained.

current projects: pokersource

My Blog | My Pastebin | PHP Validation class | Backtrack linux


#4 cuekillar

cuekillar
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 13 October 2006 - 02:42 AM

it worked thanks




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users