www.webdeveloper.com
Results 1 to 2 of 2

Thread: email form problem!

  1. #1
    Join Date
    Nov 2002
    Posts
    91

    email form problem!

    Can anyone please have a look and tell me why I'm always directed to the error page when this form is filled out.

    http://www.mc2.com.ky/beta/q&h/html/...briefings.html

    Here is the PHP code, the last nine inputs are check boxes. Could this be where I went wrong:

    <?

    $mailto = 'mc2@candw.ky' ;
    $subject = "Client Briefings" ;


    $formurl = "http://www.mc2.com.ky/beta/q&h/html/client_briefings.html" ;
    $errorurl = "http://www.mc2.com.ky/beta/q&h/html/error.html" ;
    $thankyouurl = "http://www.mc2.com.ky/beta/q&h/html/thankyou.html" ;

    //--------------------------------------------------------

    $title = $_POST['title'] ;
    $firstname = $_POST['first name'] ;
    $surname = $_POST['surname'] ;
    $jobtitle = $_POST['job title'] ;
    $company = $_POST['company'] ;
    $mailingaddress = $_POST['mailing address'] ;
    $email = $_POST['email'] ;
    $phone = $_POST['phone'] ;
    $companies = $_POST['companies law'] ;
    $DirectorsDuties = $_POST['Directors Duties'] ;
    $Investmentfunds = $_POST['Investment funds'] ;
    $stockexchange = $_POST['stock exchange'] ;
    $litigation = $_POST['litigation'] ;
    $moneylaundery = $_POST['money laundery'] ;
    $Securitisation = $_POST['Securitisation'] ;
    $Portfolio = $_POST['Portfolio'] ;
    $trusts = $_POST['trusts'] ;
    $http_referrer = getenv( "HTTP_REFERER" );

    if (!isset($_POST['email'])) {
    header( "Location: $formurl" );
    exit ;
    }
    if (empty($name) || empty($phone) || empty($email) || empty($comments)) {
    header( "Location: $errorurl" );
    exit ;
    }

    $messageproper =

    "This message was sent from:\n" .
    "$http_referrer\n" .
    "------------------------- COMMENTS -------------------------\n\n" .
    $comments .
    "\n\n------------------------------------------------------------\n" ;

    mail($mailto, $subject, $messageproper, "From: \"$name\" <$email>\nReply-To: \"$name\" <$email>\nX-Mailer: chfeedback.php 2.0" );
    header( "Location: $thankyouurl" );
    exit ;

    ?>
    Last edited by caynada; 07-08-2003 at 10:59 AM.

  2. #2
    Join Date
    Dec 2002
    Location
    High on life
    Posts
    10,104
    If I were you, I would use a loop, rather than manually going through each field. Take a look at http://forums.webdeveloper.com/showt...9543#post48748

    Personal website http://www.ryanbrill.com/
    Business website: http://www.infinitywebdesign.com/
    TypeSpace http://www.typespace.org/

    I reject your reality and substitute it with my own!

Thread Information

Users Browsing this Thread

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

Posting Permissions

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



Recent Articles