SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    SitePoint Zealot
    Join Date
    Feb 2005
    Posts
    104
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    formsent problems

    Okay here's the deal, everything is emailing just fine......but when the email comes to my inbox...and I open it.....all the the names before the fields are there....but it doesn't show the information from the form...

    here is the code

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <?php
    
    $practice = $_POST['practice'];
    
    $address = $_POST['address'];
    
    $city = $_POST['city'];
    
    $state = $_POST['state'];
    
    $zip = $_POST['zip'];
    
    $contact = $_POST['contact'];
    
    ?>
    
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Untitled Document</title>
    </head>
    
    <body>
    
    <?php
    
    $formsent = mail("rodreading@yahoo.com", "Form Name",  " Name of Practice: $practice\r\n\r\n Practice Address: $address\r\n\r\n City: $city  State: $state  Zip: $zip\r\n\r\n Address: $adress\r\n\r\n ","From: $practice");
    
     
    
    if($formsent == 1)
    
                {
    
                ?>
    
                      </p>
    
                      <h1>Thank you for submitting the form, we will contact you soon <br>
    
                      </h1>
    
                      <p>
    
                        <?php
    
                }
    
    else {
    
                ?>
    
                      <h1 align="center">There was an error . Please try again.
    
                        <?php
    
                }
    
     
    
    $formsent = mail("$email", "Form Name",  " Dear  $name\r\n\r\n Blah Blah Blah Blah ","From: AmericanAllPro");
    
     
    
     
    
                ?>
    
    </body>
    </html>
    Can anyone help me figure this out?
    www.NovThird.com

    The chief export of Chuck Norris is pain.

    www.prematurity.org

  2. #2
    SitePoint Guru mmarif4u's Avatar
    Join Date
    Dec 2006
    Location
    /dev/swat
    Posts
    619
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try using this siple email function:
    Edit it to ur script requirements.

    PHP Code:
    <?php
        $headers 
    'From: CCC Team <support@ccc.com>' "\r\n" .
        
    'Cc: email@yahoo.com' "\r\n" .
        
    'X-Mailer: PHP/' phpversion() ."\r\n".
        
    'MIME-Version: 1.0' "\r\n" .
        
    'Content-type: text/html; charset=iso-8859-1' "\r\n";
        
    $message "
    <b>Dear valued subscriber</b>,<br>


    1.    The following are your account details:-<br><br>

        User Number: " 
    $userid "<br>
        User ID: " 
    $user "<br><br>


    Kindly keep the above information for future references.<br><br>

    Your password will be e-mailed to you after your payment have been confirmed.<br>
    For further information please contact:<br>
    support@CCC.com.<br><br>

    Best regards,<br>
    <b>CCC Team.</b><br>

    "
    ;

        
    mail($email,"Your account details for the ccc Program",$message,$headers);

    ?>

  3. #3
    SitePoint Zealot
    Join Date
    Feb 2005
    Posts
    104
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I appreciate the help, but I really want to get this code that I have been working on figured out, because it has been driving me crazy....
    www.NovThird.com

    The chief export of Chuck Norris is pain.

    www.prematurity.org

  4. #4
    SitePoint Guru mmarif4u's Avatar
    Join Date
    Dec 2006
    Location
    /dev/swat
    Posts
    619
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the script is the same look at the $message body of my email script,
    I add $userid And so on u can add ur form variables there.

  5. #5
    SitePoint Zealot
    Join Date
    Feb 2005
    Posts
    104
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Got ya.... I understand what your saying....But the autoresponder is working great...my prob is...when the fill out the fields....all I get is(just for example):

    Address:
    Name:
    Phone Number:

    ----It's just not sending me the information they filled out
    www.NovThird.com

    The chief export of Chuck Norris is pain.

    www.prematurity.org

  6. #6
    SitePoint Guru mmarif4u's Avatar
    Join Date
    Dec 2006
    Location
    /dev/swat
    Posts
    619
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try this one but change some text according ur email.

    PHP Code:
    <?php 
    $practice 
    $_POST['practice'];
    $address $_POST['address'];
    $city $_POST['city'];
    $state $_POST['state'];
    $zip $_POST['zip'];
    $contact $_POST['contact'];

        
    $headers 'From: CCC Team <support@ccc.com>' "\r\n" 
        
    'Cc: email@yahoo.com' "\r\n" 
        
    'X-Mailer: PHP/' phpversion() ."\r\n"
        
    'MIME-Version: 1.0' "\r\n" 
        
    'Content-type: text/html; charset=iso-8859-1' "\r\n"
        
    $message 
    <b>Dear valued subscriber</b>,<br> 


     The following are your account details:-<br><br> 

        Practice: " 
    $practice "<br>
        Address: " 
    $address "<br>
        City: " 
    $city "<br>
        State: " 
    $state "<br>
        Zip: " 
    $zip "<br> 
        contact: " 
    $contact "<br><br> 


    Kindly keep the above information for future references.<br><br> 

    Your password will be e-mailed to you after your payment have been confirmed.<br> 
    For further information please contact:<br> 
    support@CCC.com.<br><br> 

    Best regards,<br> 
    <b>CCC Team.</b><br> 

    "


      
    $mail=  mail("rodreading@yahoo.com","Your account details for the ccc Program",$message,$headers); 
    if (
    $mail){echo "Email sent";}
    else {echo 
    "Problem with sending";}
    ?>

  7. #7
    SitePoint Wizard bronze trophy devbanana's Avatar
    Join Date
    Apr 2006
    Location
    Pennsylvania
    Posts
    1,736
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have you tried this yourself? Just wondering if perhaps they just aren't filling out the fields. You aren't doing any error checking to make sure they fill out the form, and sometimes a bot or something might come across it.

  8. #8
    SitePoint Guru mmarif4u's Avatar
    Join Date
    Dec 2006
    Location
    /dev/swat
    Posts
    619
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For me i check everything when accepting data from user,
    This is just i give example , now its upto him to enhance it more.
    Using some security features.

  9. #9
    SitePoint Wizard bronze trophy devbanana's Avatar
    Join Date
    Apr 2006
    Location
    Pennsylvania
    Posts
    1,736
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is the method of your form set to post?

  10. #10
    SitePoint Guru mmarif4u's Avatar
    Join Date
    Dec 2006
    Location
    /dev/swat
    Posts
    619
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Difenetly it will be post.
    I am using this email script on another way.
    But i edited the script for the rodreading .

  11. #11
    SitePoint Zealot
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    137
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try this and tell us if there are any error messages output:
    PHP Code:
    <?php error_reporting(E_ALL); ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <?php
    $practice 
    $_POST['practice'];
    $address $_POST['address'];
    $city $_POST['city'];
    $state $_POST['state'];
    $zip $_POST['zip'];
    $contact $_POST['contact'];
    ?>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Untitled Document</title>
    </head>
    <body>
    <?php
    $formsent 
    mail("rodreading@yahoo.com""Form Name",  " Name of Practice: $practice\r\n\r\n Practice Address: $address\r\n\r\n City: $city  State: $state  Zip: $zip\r\n\r\n Address: $adress\r\n\r\n ","From: $practice");
    if(
    $formsent == 1) { ?>
                      </p>
                      <h1>Thank you for submitting the form, we will contact you soon <br>
                      </h1>
                      <p>
    <?php } else { ?>
                      <h1 align="center">There was an error . Please try again.</h1>
    <?php 
    }
    $formsent mail("$email""Form Name",  " Dear  $name\r\n\r\n Blah Blah Blah Blah ","From: AmericanAllPro"); ?>
    </body>
    </html>


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •