Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 24th Apr 2010, 10:39 AM   #1
Check The Abstract.
War Room Member
 
Social Experts's Avatar
 
Join Date: 2010
Posts: 435
Thanks: 9
Thanked 137 Times in 42 Posts
Default
Quick Programming Help
Share on: 
fb share twitter share gplus share more share

Hey I have a website perfectballhandling.com and I want the user to be able to press the get updates button enter their email and it saves to mail.php on my server. can you tell me what i'm doing wrong?

Chill.
Social Experts is offline  
Unread 24th Apr 2010, 11:39 AM   #2
HyperActive Warrior
War Room Member
 
senderbot's Avatar
 
Join Date: 2010
Posts: 220
Thanks: 1
Thanked 25 Times in 23 Posts
Default
Re: Quick Programming Help
Share on: 
fb share twitter share gplus share more share

Hi,

Its probably something to do with your mail.php file. Have you edited it to email the input to your email address?

If you are not sure you could post the mail.php content here and someone might be able to give you a better idea as to what you've done wrong.

Cheers

Max

PornStarStamina is for sale! - Buy the book rights and website! or Just Download the Book For FREE! - Check it out!
senderbot is offline  
Unread 24th Apr 2010, 12:31 PM   #3
Check The Abstract.
War Room Member
 
Social Experts's Avatar
 
Join Date: 2010
Posts: 435
Thanks: 9
Thanked 137 Times in 42 Posts
Default
Re: Quick Programming Help
Share on: 
fb share twitter share gplus share more share

what i want the site to do is save the email address's imputed to the mail.php file. so all the emails will be in the file

Chill.
Social Experts is offline  
Unread 24th Apr 2010, 12:36 PM   #4
Active Warrior
 
Join Date: 2010
Posts: 54
Thanks: 6
Thanked 1 Time in 1 Post
Default
Re: Quick Programming Help
Share on: 
fb share twitter share gplus share more share

Do you have a database like MySql? Or do you just want the emails emailed to you?
sovarn is offline  
Unread 24th Apr 2010, 12:56 PM   #5
Check The Abstract.
War Room Member
 
Social Experts's Avatar
 
Join Date: 2010
Posts: 435
Thanks: 9
Thanked 137 Times in 42 Posts
Default
Re: Quick Programming Help
Share on: 
fb share twitter share gplus share more share

i just want the emails saved to mail.php. but if it's easier then yeah i'll have them emailed to me

Chill.
Social Experts is offline  
Unread 24th Apr 2010, 01:38 PM   #6
Advanced Warrior
War Room Member
 
apoorv.parijat's Avatar
 
Join Date: 2010
Location: New Delhi, IN
Posts: 978
Thanks: 93
Thanked 340 Times in 59 Posts
Default
Re: Quick Programming Help
Share on: 
fb share twitter share gplus share more share

Create a 'email.txt' file and change it's permission to writable.
Place this script in mail.php

-----------------------------------------------------------------------
<?php
$fp = fopen('email.txt','r+');
if(!$fp)
{
echo "Create the file first.";
}else{
$present = FALSE;
while (!feof($fp))
{
$email = fgets($fp);
if ($_POST['email'] == trim($email)){
$present = TRUE;
}
}
if (!$present){
fwrite($fp, $_POST['email']."\n");
echo "Email :".$email.' added.';
}
fclose($fp);
}
?>
-----------------------------------------------------------------------

The only assumption in this script is that it expects 'email' in a post request.Make sure it receives one or edit the script to your needs.

The emails are stored in the 'email.txt' file you just created.
Let me know if you have a problem.
apoorv.parijat is offline  
Unread 24th Apr 2010, 02:13 PM   #7
Check The Abstract.
War Room Member
 
Social Experts's Avatar
 
Join Date: 2010
Posts: 435
Thanks: 9
Thanked 137 Times in 42 Posts
Default
Re: Quick Programming Help
Share on: 
fb share twitter share gplus share more share

oh my god dude it worked! thanks !!!

Chill.
Social Experts is offline  
Unread 24th Apr 2010, 02:31 PM   #8
Advanced Warrior
War Room Member
 
apoorv.parijat's Avatar
 
Join Date: 2010
Location: New Delhi, IN
Posts: 978
Thanks: 93
Thanked 340 Times in 59 Posts
Default
Re: Quick Programming Help
Share on: 
fb share twitter share gplus share more share

You are welcome mate.

apoorv.parijat is offline  
Closed Thread


Bookmarks

Tags
programming, quick


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 02:13 PM.