Quick Programming Help

7 replies
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?
#programming #quick
  • Profile picture of the author senderbot
    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
    Signature
    PornStarStamina is for sale! - Buy the book rights and website! or Just Download the Book For FREE! - Check it out!
    {{ DiscussionBoard.errors[2024102].message }}
  • Profile picture of the author Social Experts
    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
    Signature

    Chill.

    {{ DiscussionBoard.errors[2024253].message }}
    • Profile picture of the author sovarn
      Do you have a database like MySql? Or do you just want the emails emailed to you?
      {{ DiscussionBoard.errors[2024268].message }}
  • Profile picture of the author Social Experts
    i just want the emails saved to mail.php. but if it's easier then yeah i'll have them emailed to me
    Signature

    Chill.

    {{ DiscussionBoard.errors[2024325].message }}
    • Profile picture of the author apoorv.parijat
      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.
      {{ DiscussionBoard.errors[2024433].message }}
  • Profile picture of the author Social Experts
    oh my god dude it worked! thanks !!!
    Signature

    Chill.

    {{ DiscussionBoard.errors[2024546].message }}

Trending Topics