Results 1 to 4 of 4

Thread: html + php :my email is empty

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2005
    Posts
    42

    html + php :my email is empty

    if I use this script the email I recieve is empty
    What's wrong whit it?

    PHP Code:
    <form name="form" method="post" action="/test/contactscript.php">
    <
    table width="400" border="0" cellspacing="2" cellpadding="2">
    <
    tr> <td width="200" valign="top" align="right">Your Name: </td>
    <
    td width="200" valign="top" align="left">
    <
    input type="text" name="name" size="25" maxlength="200" />
    </
    td></tr><tr><td width="200" valign="top" align="right">Your Email:</td>
    <
    td width="200" valign="top" align="left">
      <
    input type="text" name="email" size="25" maxlength="100" /></td></tr><tr>
      <
    td width="200" valign="top" align="right">Your Comments: </td><td width="200" valign="top" align="left">
       <
    textarea name="msg" cols="25" rows="4"></textarea></td></tr><tr>
       <
    td width="200" valign="top"> </td><td width="200" valign="top" align="left">
       <
    input type="reset" name="Reset" value="Reset" /><input type="submit" name="Submit" value="Submit" />
       </
    td></tr></table></form
    contachtscript.php
    PHP Code:
    // headers for the email listed below

    $headers .= "From: $name <$email>\n"// your email client will show the person's email address like normal
    $headers .= "Content-Type: text/plain; charset=iso-8859-1\n"// sets the mime type
    $recipient "[email protected]"// enter YOUR email address here
    $subject "len"// this is the subject of the email

    $msg wordwrap$msg1024 );

    mail($recipient$subjectstripslashes($msg), $headers); // the mail() function sends the message to you

    //Once the data is entered, redirect the user to give them visual confirmation
    header("location: http://www.casemoddertje.be/test/form.htm");
    ?> 
    Last edited by casemoddertje; Jun 11th, 2005 at 01:45 PM.

  2. #2
    Fanatic Member ALL's Avatar
    Join Date
    Jul 2004
    Location
    192.168.1.1
    Posts
    711

    Re: html + php :my email is empty

    try having it echo all the variables, and tell us the outcome...

    ps: this should be in the php section, not the web section
    Please support one of my projects?
    TKForums.com

    Web Forum
    JavaScript Wiki
    ________________________
    If somone helps you, please rate their post, by clicking the to rate their post

  3. #3

    Thread Starter
    Member
    Join Date
    Apr 2005
    Posts
    42

    Re: html + php :my email is empty

    what do you mean?

  4. #4
    Fanatic Member ALL's Avatar
    Join Date
    Jul 2004
    Location
    192.168.1.1
    Posts
    711

    Re: html + php :my email is empty

    duh... i think it is because you are not setting $msg... try this:
    PHP Code:
    // headers for the email listed below 
    $msg $_POST['msg'];
    $headers .= "From: $name <$email>\n"// your email client will show the person's email address like normal 
    $headers .= "Content-Type: text/plain; charset=iso-8859-1\n"// sets the mime type 
    $recipient "[email protected]"// enter YOUR email address here 
    $subject "len"// this is the subject of the email 

    $msg wordwrap$msg1024 ); 

    mail($recipient$subjectstripslashes($msg), $headers); // the mail() function sends the message to you 

    //Once the data is entered, redirect the user to give them visual confirmation 
    header("location: http://www.casemoddertje.be/test/form.htm"); 
    ?> 
    Please support one of my projects?
    TKForums.com

    Web Forum
    JavaScript Wiki
    ________________________
    If somone helps you, please rate their post, by clicking the to rate their post

Posting Permissions

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



Click Here to Expand Forum to Full Width