FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Do I ask a question about the newsletter script here
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cambodia eXPlore Forum Index -> Client - Server Side Development
Author Message
idaryl
first grade


Joined: 09 Oct 2006
Posts: 10

PostPosted: Mon Oct 09, 2006 2:22 pm    Post subject: Do I ask a question about the newsletter script here Reply with quote

Can it be formatted to send an email notification to the admin when someone fills in their address?

Back to top
guitarman
fourth grade


Joined: 04 Nov 2005
Posts: 724

PostPosted: Thu Oct 12, 2006 11:35 pm    Post subject: Reply with quote



You mean??

Back to top
idaryl
first grade


Joined: 09 Oct 2006
Posts: 10

PostPosted: Fri Oct 13, 2006 1:17 am    Post subject: Reply with quote

Errr, can the sendEmail script notify the admin when someone fills in the form in the flash file?

Back to top
web_design
first grade


Joined: 04 Jan 2006
Posts: 23
Location: Phnom Penh

PostPosted: Fri Oct 13, 2006 4:57 pm    Post subject: Reply with quote

I think, it depend on script condition before execute the process.

Back to top
guitarman
fourth grade


Joined: 04 Nov 2005
Posts: 724

PostPosted: Fri Oct 13, 2006 11:45 pm    Post subject: Reply with quote

CUrrently it's not, but of course it can modify to send the email to admin as well Smile

Back to top
idaryl
first grade


Joined: 09 Oct 2006
Posts: 10

PostPosted: Sat Oct 14, 2006 8:31 am    Post subject: Reply with quote

Yes please, can you reformat it to send an email - that way I know when someone has entered their email address

Back to top
guitarman
fourth grade


Joined: 04 Nov 2005
Posts: 724

PostPosted: Sat Oct 14, 2006 12:42 pm    Post subject: Reply with quote

idaryl, can you tell us where you use the contact us at? which website?

Back to top
idaryl
first grade


Joined: 09 Oct 2006
Posts: 10

PostPosted: Sat Oct 14, 2006 1:06 pm    Post subject: Reply with quote

Oh my bad javascript:emoticon('Sad')- I forgot to mention this is for the Newletter System - and I want to use it on a site I'm building - as the webmaster I want to be notified when someone enters their email for the newsletter. I don't want to have to check the subscribe.txt every day just to see if anyone has submitted info.javascript:emoticon('Idea')

Back to top
guitarman
fourth grade


Joined: 04 Nov 2005
Posts: 724

PostPosted: Sat Oct 14, 2006 4:42 pm    Post subject: Reply with quote

Oh, okay. here is the step you can change to email to you everytime someone submit the email.

1- Download the zip file, and upzip it.
2- find the file emailSubmit.php and open it.
3- Add the following line in the correct location.
Code:
mail("youremail@domain.com","Newsletter List","someone has registered at the newsletter");

4- Upload the emailSubmit.php to replace the old one and test it in your server.

Okay, and here is the codes inside the emailSubmit.php

Code:
<?php
//get email value from POST variable
$email = trim($_POST['email']);
//add a new line for Each email address
$email .="\n";
//initialize the variable
$fileName = "subscribe.txt";
//open files
if (is_writable($fileName)) {
   if(!$fp = fopen($fileName,"a")){
      echo "status=Can't open the file name $fileName";
      exit;
   }
   if (fwrite($fp,$email) === FALSE) {
      echo "status=Can't write to $fileName";
      exit;
   }
   echo "status=ok";
   //test
   mail("youremail@domain.com","Newsletter List","someone has registered at the newsletter");
   //end test
   fclose($fp);
} else {
   echo "status=The file $fileName is not writable";
}
?>


Back to top
idaryl
first grade


Joined: 09 Oct 2006
Posts: 10

PostPosted: Sun Oct 15, 2006 6:40 am    Post subject: Reply with quote

Tried it as you have shown above and it generates "Problem Occurs" My guess is, its not writing to the database for some reason

Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cambodia eXPlore Forum Index -> Client - Server Side Development All times are GMT + 8 Hours
Goto page 1, 2  Next
Page 1 of 2



by phpBB