SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru
    Join Date
    Feb 2007
    Posts
    731
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Email But No Content

    Hi,

    I have the following code which sends an email to me however it does not send through the contect I am entering on the form. Can anyone advise why please?

    Code:
    $emailfrom = "****";
    $emailto = "****";
    $subject = "****";
    $name = Trim(stripslashes($_POST['name'])); 
    $email = Trim(stripslashes($_POST['email'])); 
    $message = Trim(stripslashes($_POST['message'])); 
    
    // validation
    $validationOK=true;
    if (!$validationOK) {
      print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
      exit;
    }
    
    // prepare email body text
    $body = "";
    $body .= "isbn: ";
    $body .= $isbn;
    $body .= "\n";
    $body .= "isbn1: ";
    $body .= $isbn1;
    $body .= "\n";
    $body .= "isbn2: ";
    $body .= $isbn2;
    $body .= "\n";
    
    
    // send email 
    $success = mail($emailto, $subject, $body, "From: <$emailfrom>");
    
    // redirect to success page 
    if ($success){
      print "<meta http-equiv=\"refresh\" content=\"0;URL=isbnsent.php\">";
    }
    else{
      print "<meta http-equiv=\"refresh\" content=\"0;URL=index.php\">";
    }
    ?>


    Code:
    	<form  name="loginForm"  method="post" action="/isbnengine.php">
    				<ul >
    <div class="homepagesubmitwrapper">
    <div id="contact-area">
    <div class="homepageisbnsubmitwrapper">
    <div class="homepageisbnwrapper">
    ISBN:
    </div>
    <div class="homepageisbninsertwrapper">
    <input type="text" name="isbn" id="isbn" /></text>
    </div>
    </div>
    <div class="homepageisbnsubmitwrapper">
    <div class="homepageisbnwrapper">
    ISBN:
    </div>
    <div class="homepageisbninsertwrapper">
    <input type="text" name="isbn1" id="isbn1" /></text>
    </div>
    </div>
    <div class="homepageisbnsubmitwrapper">
    <div class="homepageisbnwrapper">
    ISBN:
    </div>
    <div class="homepageisbninsertwrapper">
    <input type="text" name="isbn2" id="isbn3" /></text>
    </div>
    </div>
    <div class="homepageisbnsubmitwrapper">
    <div class="homepageisbnwrapper">
    ISBN:
    </div>
    <div class="homepageisbninsertwrapper">
    <input type="text" name="isbn4" id="isbn4" /></text>
    </div>
    </div>
    <div class="homepageisbnsubmitwrapper">
    <div class="homepageisbnwrapper">
    ISBN:
    </div>
    <div class="homepageisbninsertwrapper">
    <input type="text" name="isbn5" id="isbn5" /></text>
    </div>
    </div>
    <div class="homepageisbnsubmitwrapper">
    <div class="homepageisbnwrapper">
    ISBN:
    </div>
    <div class="homepageisbninsertwrapper">
    <input type="text" name="isbn6" id="isbn6" /></text>
    </div>
    </div>
    <div class="homepageisbnsubmitwrapper">
    <div class="homepageisbnwrapper">
    ISBN:
    </div>
    <div class="homepageisbninsertwrapper">
    <input type="text" name="isbn7" id="isbn7" /></text>
    </div>
    </div>
    </div>
    </div>
    							<div class="user-area">
     <input type="submit" value="Submit" class="submit-button" /> 
    		</div>	
     	</ul>
            </form>

  2. #2
    SitePoint Enthusiast
    Join Date
    Feb 2012
    Location
    United Kingdom
    Posts
    78
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Where's the HTTP POST data for 'name', 'email', and 'message' coming from? Also, I think you're assuming that register_globals is enabled because you have not assigned the HTTP POST data for the ISBN numbers to their respective variables in the $body variable assignment ($isbn, $isbn1, $isbn2). You may also want to look over your HTML code again; it seems a little malformed (random closing text tags).


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
  •