| Author |
Message |
idaryl first grade
Joined: 09 Oct 2006 Posts: 10
|
Posted: Mon Oct 09, 2006 2:22 pm Post subject: Do I ask a question about the newsletter script here |
|
|
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
|
Posted: Thu Oct 12, 2006 11:35 pm Post subject: |
|
|
You mean??
|
|
| Back to top |
|
 |
idaryl first grade
Joined: 09 Oct 2006 Posts: 10
|
Posted: Fri Oct 13, 2006 1:17 am Post subject: |
|
|
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
|
Posted: Fri Oct 13, 2006 4:57 pm Post subject: |
|
|
I think, it depend on script condition before execute the process.
|
|
| Back to top |
|
 |
guitarman fourth grade
Joined: 04 Nov 2005 Posts: 724
|
Posted: Fri Oct 13, 2006 11:45 pm Post subject: |
|
|
CUrrently it's not, but of course it can modify to send the email to admin as well 
|
|
| Back to top |
|
 |
idaryl first grade
Joined: 09 Oct 2006 Posts: 10
|
Posted: Sat Oct 14, 2006 8:31 am Post subject: |
|
|
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
|
Posted: Sat Oct 14, 2006 12:42 pm Post subject: |
|
|
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
|
Posted: Sat Oct 14, 2006 1:06 pm Post subject: |
|
|
Oh my bad javascript:emoticon(' ')- 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(' ')
|
|
| Back to top |
|
 |
guitarman fourth grade
Joined: 04 Nov 2005 Posts: 724
|
Posted: Sat Oct 14, 2006 4:42 pm Post subject: |
|
|
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
|
Posted: Sun Oct 15, 2006 6:40 am Post subject: |
|
|
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 |
|
 |
|