Dear friends,
Kindly look into this code below for me. I intend to use it to send my form data(not validated) to an email address. After I filled the form and running the code, it is the else echo statement ("Form not properly completed") that i keep recieving. However, I could not locate the problem. Please treat as urgent for me.
See code below:

<html>
<body><?php
if (isset($_POST['submit']))
  {
  $to = "quizentry@lagosschoolsonline.net";
  $from = "quizentry@lagosschoolsonline.net";
  $SchoolName = $_POST['SchoolName'] ; 
  $SchoolAddress = $_POST['SchoolAddress'] ;
  $Locality = $_POST['Locality'] ;
  $MobileNumber = $_POST['MobileNumber'] ;
  $Landphone = $_POST['Landphone'] ;
  $email = $_POST['email'] ;
  $website = $_POST['website'] ;
  $ContactPerson = $_POST['ContactPerson'] ;
  $MarketerInCharge = $_POST['MarketerInCharge'] ;
  $Username = $_POST['Username'] ;
  $Password = $_POST['Password'] ;
  // SECTION B//
  $malecandidate = $_POST['malecandidate'] ;
  $ddm = $_POST['ddm'] ;
  $mmm = $_POST['mmm'] ;
  $yym = $_POST['yym'] ;
  $Refnumberm = $_POST['Refnumberm'] ;
  //FEMALE//
  $femalecandidate = $_POST['femalecandidate'] ;
  $ddf = $_POST['ddf'] ;
  $mmf = $_POST['mmf'] ;
  $yyf = $_POST['yyf'] ;
  $Refnumberf = $_POST['Refnumberf'] ;
  //email address used//
  if (mail($to,$SchoolName,$SchoolAddress,$Locality,$MobileNumber,$Landphone,$email,$website,$ContactPerson,$MarketerInCharge,$Username,$Password,$malecandidate,$ddm,$mmm,$yym,$Refnumberm,$femalecandidate,$ddf,$mmf,$yyf,$Refnumberf));
  echo "Your entries have been submitted. Thank you." ;
  }
else
  echo "Form not properly completed"?>
</body>
</html>

Thank you.

It might not be the error that's causing your problem but remove the semicolon after the second if statement

I have removed the semi-colon but the result is still the same. Any other suggestion please?

i thought mail only has 4 basic attributes. you have a lot more than that. you need to put all the variables that need to be included in the email into one variable and pass that to the function.

look here for examples: http://us3.php.net/manual/en/function.mail.php

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.