Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 6 of 6
  1. #1
    Junior Member dgrotz's Avatar
    Join Date
    Mar 2006
    Location
    Harrisburg, PA
    Posts
    3
    Member #
    12907
    I have a form on my web site and want the results to be emailed to me. I am using a small php script that acomplishes this task but when I recieve the email it is blank, I have tried several scripts with the same results. Anyone have any idea what I'm doing wrong?

    Thanks for any and all input,

  2.  

  3. #2
    Senior Member Shani's Avatar
    Join Date
    Nov 2004
    Posts
    1,140
    Member #
    8171
    Please post the script and html.
    Shani

    I have an eye for detail like you'd never believe.

  4. #3
    Junior Member dgrotz's Avatar
    Join Date
    Mar 2006
    Location
    Harrisburg, PA
    Posts
    3
    Member #
    12907
    This is the php script I'm using-



    PHP Code:
    $message $todayis [EST] \n
    Attention: 
    $attn \n
    Message: 
    $notes \n
    From: 
    $visitor ($visitormail)\n
    Additional Info : IP = 
    $ip \n
    Browser Info: 
    $httpagent \n
    Referral : 
    $httpref \n
    "
    ;

    $from "From: $visitormail\r\n";


    mail("dgrotzinger@adelphia.net"$subject$message$from); 


    And here is my form data-

    HTML Code:
    <form action="form.php" method="post" enctype="text/plain" name="Join our mailing list" target="_self" id="Join our mailing list">
          <p align="center"><span class="style10">
         
    
    
          Join Our Mailing List <br>
            e-mail:</span>          
            <input name="email" type="text" id="email" size="15">
            <?php echo $_POST['email']?><br>
              <input type="submit" name="Submit" value="Join">
          </p>
        </form>
    Thanks,

  5. #4
    Senior Member Shani's Avatar
    Join Date
    Nov 2004
    Posts
    1,140
    Member #
    8171
    Please note, I am VERY new to php, so I could be way off, so forgive me if this is not too helpful.

    So, the email you receive... it has no information? does it at least have the following?
    Attention:
    Message:
    From:
    Additional Info :
    Browser Info:
    Referral

    From:
    What the rookie (me) sees:
    In the html, you define the 'email' which is transferred via $_POST as $email to form.php.

    PHP Code:
    mail("dgrotzinger@adelphia.net"$subject$message$from); 
    Dissecting... email is coming to you, $subject (you never define), $message (has a bunch of undefined variables), $from (defined w/ undefined variable).

    In the meantime you never request the result from the form, $email.

    ps... WDF has a really great feature for posting different types of code. It's very similar to html but uses [ ] instead of <>. So, if you are posting code, type in [html] or [php] etc. and then the corresponding end [/]
    Shani

    I have an eye for detail like you'd never believe.

  6. #5
    Senior Member rosland's Avatar
    Join Date
    Jul 2003
    Location
    Norway
    Posts
    1,944
    Member #
    2096
    (Edited your post by adding formatting tags)

    The order of arguments seems to be ok
    (ref this thread: http://www.webdesignforums.net/showthread.php?t=15130)

    I assume there are some additional code on page "form.php", that contains the missing variables ($subject, $todayis, $attn, $notes, $visitor, $visitormail, $ip, $httpagent, $httpref) ?!

    If not, then that's where your problem lies!
    Otherwise, then maybe the problem is as banale as not retrieving the passed variables through $_POST[].

    A form name "variable", is not immediately available as $variable one the processing page, if "register_globals" are set to OFF in your php.ini file (which is, and should be, standard).

    As the recipient is hardcoded ("dgrotzinger@adelphia.net"), that could explain why you are recieving the mail, but without any content.
    S. Rosland

  7. #6
    Junior Member dgrotz's Avatar
    Join Date
    Mar 2006
    Location
    Harrisburg, PA
    Posts
    3
    Member #
    12907
    Thanks for the help everyone, I have figured it out! :smoker:


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 03:57 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com