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 2 of 2
  1. #1
    Junior Member
    Join Date
    Nov 2012
    Posts
    1
    Member #
    33873
    I apologize. I'm not an expert web designer, but my job has thrown me into coding. I have a solid website but the contact forms are giving me trouble. I am basically using contact forms that were on the old website but the php won't work on the new website. When I hit submit the button just takes me to my php code. Is there anything I'm overlooking other then maybe the PHP just isn't working.

    Here is the code.

    Code:
    <?php
    
    $message = "";
    
    //foreach ($_POST as $n => $value){
    //    $message .= $n . ": " . $value . "\r";
    //}
    
    $message .= "The first name is : " . $_POST['firstname'] . "\r";
    $message .= "The last name is : " . $_POST['lastname'] . "\r";
    $message .= "The Position Appling For is : " . $_POST['position'] . "\r";
    $message .= "The city is : " . $_POST['city'] . "\r";
    $message .= "The state is : " . $_POST['state'] . "\r";
    $message .= "The zipcode is : " . $_POST['zipcode'] . "\r";
    $message .= "The phone number is : " . $_POST['phone'] . "\r";
    $message .= "The email is : " . $_POST['email'] . "\r";
    $message .= "The location applying for is : " . $_POST['location'] . "\r";
    $message .= "Contact Via : " . $_POST['contactvia'] . "\r";
    
    if($_POST['comments']){
    $message .= "Comments : " . $_POST['comments'] . "\r";
    }
    
    $email = mail('info@transwood.com','Employment Application Form Submitted on TransWood.com',$message,"from: {$_POST['email']}");
    
    echo "<script>alert(\"Your Employment Application e-mail has been sent to TransWood Carriers, Inc.\");window.location='employmentform-admin.html';</script>";
    
    ?>
    
    <?php
    if(!isset($_SERVER["DOCUMENT_ROOT"]))
    {$_SERVER["DOCUMENT_ROOT"]=substr($_SERVER['SCRIPT_FILENAME'] , 0 , -strlen($_SERVER['PHP_SELF'])+1 );
    }
    ?>

  2.  

  3. #2
    Junior Member Eddy's Avatar
    Join Date
    Nov 2012
    Posts
    6
    Member #
    33883
    Liked
    1 times
    Hi,
    here is the working contact form script that I developed, with this form the emails will not go to junk box, they always will go to proper Inbox folder enjoy

    $message = "";

    $header = 'MIME-Version: 1.0' . "\r\n";
    $header .= "From: <$email>\r\n";

    $header .= "X-Priority: 3\r\n";
    $header .= "X-Mailer: PHP". phpversion() ."\r\n" ;
    $header .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

    mail("youremail@yourdomainname.com", "enquiry", "$message", $header);

    Regards
    Eddy


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 02:32 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com