Results 1 to 9 of 9

Thread: mail function debug help

  1. #1
    Join Date
    Jul 2006
    Location
    LittlePenang.com
    Posts
    1,778
    Rep Power
    191

    mail function debug help

    dear coder,

    Recently i search over the net and obtain some mail function code, and trying to add in addition information

    I have create a form (order.htm)and trying to call the (order.php) php code as below
    PHP Code:
    <?php $ip $_POST['ip']; 
    $httpref $_POST['httpref']; 
    $httpagent $_POST['httpagent']; 
    $client $_POST['client']; 
    $clientmail $_POST['clientmail'];
    $clientdomain $_POST['clientdomain'];
    $clientaddress $_POST['clientaddress'];
    $clientphone $_POST['clientphone'];
    $clientpromo $_POST['clientpromo'];
    $clientpackage $_POST['clientpackage'];
    $clientpayment $_POST['clientpayment'];
    $clientcomment $_POST['clientcomment'];


    if (
    eregi('http:'$clientcomment)) {
    die (
    "Do NOT try that! ! ");
    }
    if(!
    $clientmail == "" && (!strstr($clientmail,"@") || !strstr($clientmail,"."))) 
    {
    echo 
    "<h2>Use Back - Enter valid e-mail</h2>\n"
    $badinput "<h2>order was NOT submitted</h2>\n";
    echo 
    $badinput;
    die (
    "Use back! ! ");
    }

    if(empty(
    $client) || empty($clientmail) || empty($clientdomain) || empty($clientaddress) || empty($clientphone) ) {
    echo 
    "<h2>Use Back - fill in all fields (Require)</h2>\n";
    die (
    "Use back! ! "); 
    }

    $todayis date("l, F j, Y, g:i a") ;

    $attn $clientpackage 
    $subject $attn

    $clietcomment stripcslashes($clientcomment); 

    $message $todayis [EST] \n
    Attention: 
    $attn \n
    Subject : 
    $subject \n
    Message: 
    $clientcomment \n 
    From: 
    $Client ($clientmail)\n


    Additional Info : IP = 
    $ip \n
    Browser Info: 
    $httpagent \n
    Referral : 
    $httpref \n
    "
    ;

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


    mail("host@privatehoster.com"$subject$message$from);

    ?>
    display area
    PHP Code:
    <p align="center">
    Date: <?php echo $todayis ?> 
    <br>

    Thank You : <?php echo $client ?> ( <?php echo $clientmail ?> ) 
    <br>


    Thank for purchasing : <?php echo $clientpackage ?>
    <br>
     
    Once we receive the payment, we will send you the login detail at <?php echo $clientmail ?> <br>
     
    <?php $notesout str_replace("\r""<br/>"$clientcomment); 
    echo 
    $notesout?> 
    <br>

    <?php echo $ip ?>
    When I receive the email, the information display are missing,

    the problem probably come from

    mail("host@privatehoster.com", $subject, $message, $from);

    but i have no idea how to modify it...

    can some one give me some guide?
    I blog IT Engineer LIFE at iCalvyn.com

    DreamNetwork If you don't mind Pirated

  2. #2
    Join Date
    Sep 2005
    Location
    in my body lar...
    Posts
    1,325
    Rep Power
    0
    post your html form codes also so that i can do a full test run on my server...

  3. #3
    Join Date
    Jul 2006
    Location
    LittlePenang.com
    Posts
    1,778
    Rep Power
    191
    this is my form coding, appreciate your effort
    Code:
    <form method="post" action="order.php">
    
    <!-- DO NOT change ANY of the php sections -->
    <?php $ip = getenv("REMOTE_ADDR");
    $httpref = getenv ("HTTP_REFERER");
    $httpagent = getenv ("HTTP_USER_AGENT");
    ?>
    
                        <input name="ip" value="<?php echo $ip ?>" type="hidden">
                        <input name="httpref" value="<?php echo $httpref ?>" type="hidden">
                        <input name="httpagent" value="<?php echo $httpagent ?>" type="hidden">
    
        
                        <p>Full Name: <br>
    
        <input name="client" size="35" type="text"> (Require)<br>
    
        &nbsp;Email:<br>
    
        <input name="clientmail" size="35" type="text"> (Require)<br>
    
        Domain:<br>
    
        <input name="clientdomain" size="35" type="text"> (Require)<br>
    
        Address <br>
    
    	<input name="clientaddress" size="35" type="text"> (Require)<br>
    
    	&nbsp; <br>
    
    
        Phone: <br>
    
        <input name="clientphone" size="35" type="text"> (Require)<br>
    
        Promo Code: <br>
    
        <input name="clientpromo" size="35" type="text"> (Optional)<br>
    
    
        </p>
                        <p>Package :<br>
    
        &nbsp;
                        <select name="clientpackage" size="1">
                        <option value=" none ">Select your 'Private' Plan</option>
                        <option value=" Domain Registration ">'Private' Domain Registration RM35.00/year</option>
                        <option value=" Domain Transfer ">'Private' Domain Transfer RM30.00 1st year</option>
                        <option value=" Domain Renew ">'Private' Domain Renew RM35.00 /yearr</option>
                        <option value=" Private 1">'Private' Plan 1 RM99.99/yearr</option>
                        <option value=" Private 2">'Private' Plan 2 (Free Domain) RM189.99/year</option>
                        <option value=" Private 3">'Private' Plan 3 (Free Domain) RM279.99/year</option>
                        <option value=" Private 4">'Private' Plan 4 (Free Domain) RM369.99/year</option>
                        <option value=" Private 5">'Private' Plan 5 (Free Domain) RM459.99/year</option>
                        </select>
     <br>
    
        
        </p>
                        <p>Payment :<br>
    
        &nbsp;
                        <select name="clientpayment" size="1">
                        <option value=" none ">Select your 'Private' Payment Method</option>
                        <option value=" MayBank2u ">May Bank</option>
                        <option value=" Public Bank ">Public Bank</option>
                        <option value=" Paypal ">PayPal</option>
                        </select>
    
    
                    </p>
                        <p> <br>
    
        
        &nbsp;Additional Comment: <br>
    
        &nbsp;<textarea name="clientcomment" rows="4" cols="34"></textarea> <br>
    
        &nbsp;<input value="'Private' Order" type="submit">
    
                    </p>
                      </form>
    I blog IT Engineer LIFE at iCalvyn.com

    DreamNetwork If you don't mind Pirated

  4. #4
    Join Date
    Jan 2007
    Location
    -
    Posts
    365
    Rep Power
    157
    Quote Originally Posted by calvynlee View Post

    When I receive the email, the information display are missing,

    the problem probably come from

    mail("host@privatehoster.com", $subject, $message, $from);

    but i have no idea how to modify it...

    can some one give me some guide?
    From the code you have provided, it should work properly.

    When you receive the mail, is it only certain info such as IP address, browser type etc empty in the message body?

    Or are all form fields empty in the mail? If so, is your form script saved with the .php file extension? If saved with .htm, it may not be parsing the php code and passing the POST data.

    Hopefully iamfreelancer will have more helpful points.

  5. #5
    Join Date
    Mar 2008
    Location
    pd
    Posts
    497
    Rep Power
    144
    By the power of copy-and-paste:

    Code:
    Wednesday, June 4, 2008, 7:47 am [EST]
    
    Attention: Private 5
    
    Subject : Private 5 
    
    Message: what about this time
    
    From: (sean@spammersdelight.com)
    
    Additional Info : IP = 192.168.1.5
    
    Browser Info: Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9b5) 
    Gecko/2008050509 Firefox/3.0b5
    
    Referral :
    What were you expecting?

  6. #6
    Join Date
    Jul 2006
    Location
    LittlePenang.com
    Posts
    1,778
    Rep Power
    191
    Quote Originally Posted by Seanie View Post

    What were you expecting?
    while i receive the email

    it only show
    Monday, June 2, 2008, 1:43 pm [EST]

    Attention: Private 1

    Subject : Private 1

    Message: Testing 2

    From: (someone@someemail.com)



    Additional Info : IP = <?php echo $ip ?>

    Browser Info: <?php echo $httpagent ?>

    Referral : <?php echo $httpref ?>
    I blog IT Engineer LIFE at iCalvyn.com

    DreamNetwork If you don't mind Pirated

  7. #7
    Join Date
    Mar 2008
    Location
    pd
    Posts
    497
    Rep Power
    144
    See mylinear's post:

    If so, is your form script saved with the .php file extension? If saved with .htm, it may not be parsing the php code and passing the POST data.
    The first time I copied and pasted your code, I put the third fragment you posted in something.html - and got the same results as you. I changed the filename to something.php, and it works the way you want it to.

  8. #8
    Join Date
    Sep 2005
    Location
    in my body lar...
    Posts
    1,325
    Rep Power
    0
    Quote Originally Posted by calvynlee View Post
    while i receive the email

    it only show
    i haven't test out your code yet... but from the look of the result file that you posted... it think it is exactly what Seanie said... save your html form page into a .php file....

    if problem still exist... please let us know again.

  9. #9
    Join Date
    Jul 2006
    Location
    LittlePenang.com
    Posts
    1,778
    Rep Power
    191
    I have solve my problem,

    just to add in those additional infor at

    PHP Code:
    $message $todayis [EST] \n
    Attention: 
    $attn \n
    Subject : 
    $subject \n
    Message: 
    $clientcomment \n 
    From: 
    $Client ($clientmail)\n 
    ....
    ... 
    I do face another problem here,

    I have a webmail at mydomain.com/webmail, but I have set my MX record in to mail.live.com

    every time people send me email, i will receive at mail.live.com, but I wonder why all this infor submit will not arrive my mail.live.com, instead drop into my server webmail.
    I blog IT Engineer LIFE at iCalvyn.com

    DreamNetwork If you don't mind Pirated

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Code or mail function problem?
    By calvynlee in forum Website Programming
    Replies: 6
    Last Post: 11-05-2008, 11:39 AM
  2. Pls debug my CSS
    By unclejim in forum Website Design
    Replies: 0
    Last Post: 28-08-2006, 05:48 PM
  3. Replies: 0
    Last Post: 16-01-2006, 12:03 PM
  4. asp : tolong debug sat...
    By ijoke in forum Website Programming
    Replies: 1
    Last Post: 13-04-2005, 10:28 AM
  5. asp : tolong debug sat...
    By ijoke in forum Website Design
    Replies: 1
    Last Post: 24-03-2005, 02:03 PM

Posting Permissions

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

Search Engine Optimization by vBSEO 3.5.0 RC1 PL1

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112