Need help with PHP Contact Form - newbie

Hi All,

I am trying to incorporate a php contact form into my web page. I am new to PHP so easily confused :confused:.

I downloaded the Contact Form - Style II code from this site:

http://www.kontaktformular.com/en/download-script-php-contact-form.html.

I renamed the “contact.php” file “contact_form.php” because the document that the form is inserted in is called “contact.php”. I inserted the file “contact_form.php” in the page as an “include”.

I also renamed the “CAPTCHA” file to “captcha_form” because I currently have a folder called “CAPTCHA” on my root directory for another form, and it wanted to copy over these files. I didn’t think I wanted it to do that so I gave the file folder a new name. This may be tripping me up. I went through and tried to change the file name in the code.

When I go to view my page now, all my includes disappear and I get an error message in the middle of the page where the contact form is to go.

Can view at: http://www.sitesbysarh.com/contact.php

I hope I haven’t totally lost you. Any ideas why my contact form won’t appear?

Here is the code from my “contact_form.php page”



<?php
session_start();

#########################################################################
#	Kontaktformular.com         					                                #
#	http://www.kontaktformular.com        						                    #
#	All rights by Michael Knothe                                    			#
#-----------------------------------------------------------------------#
#	Info: Michael.Knothe@gmx.de		            		                        #
#	I-Net: http://www.kontaktformular.com                        					#
#########################################################################
// It´s not allowed to remove the copyright notice!


  $script_root = substr(__FILE__, 0,
                        strrpos(__FILE__,
                                DIRECTORY_SEPARATOR)
                       ).DIRECTORY_SEPARATOR;

  require_once $script_root.'upload.php';

$remote = getenv("REMOTE_ADDR");

function encrypt($string, $key) {
$result = '';
for($i=0; $i<strlen($string); $i++) {
   $char = substr($string, $i, 1);
   $keychar = substr($key, ($i % strlen($key))-1, 1);
   $char = chr(ord($char)+ord($keychar));
   $result.=$char;
}
return base64_encode($result);
}
$sicherheits_eingabe = encrypt($_POST["securitycode"], "8h384ls94");
$sicherheits_eingabe = str_replace("=", "", $sicherheits_eingabe);

@require('config.php');

if ($_POST['delete'])
{
unset($_POST);
}


if ($_POST["mt-mk"]) {


   $name      = $_POST["name"];
   $email      = $_POST["email"];
   $street = $_POST["street"];
   $city = $_POST["city"];
   $info = $_POST["info"];
   $subject   = $_POST["subject"];
   $message   = $_POST["message"];
   $securitycode   = $_POST["securitycode"];
   $date = date("d.m.Y | H:i");
   $ip = $_SERVER['REMOTE_ADDR']; 
   $UserAgent = $_SERVER["HTTP_USER_AGENT"];
   $host = getHostByAddr($remote);



$name = stripslashes($name);
$email = stripslashes($email);
$subject = stripslashes($subject);
$message = stripslashes($message);
 

if(!$name) {
 
 $fehler['name'] = "<font color=#cc3333>Please enter your <strong>name</strong>.<br /></font>";
 
}


if (!preg_match("/^[0-9a-zA-ZÄÜÖ_.-]+@[0-9a-z.-]+\\.[a-z]{2,6}$/", $email)) {
   $fehler['email'] = "<font color=#cc3333>Please enter a <strong>e-mail-address</strong>.\
<br /></font>";
}


if(!$street) {
 
 $fehler['street'] = '<font color=#cc3333>Please enter a <strong>street</strong>.<br /></font>';
 

if(!$city) {
 
 $fehler['city'] = '<font color=#cc3333>Please enter your <strong>city and zipcode</strong>.<br /></font>';
 

if(!$info) {
 
 $fehler['info'] = '<font color=#cc3333>Please enter who info is for <strong>(self, mother, father, etc.)</strong>.<br /></font>';
 
 
if(!$subject) {
 
 $fehler['subject'] = '<font color=#cc3333>Please enter a <strong>subject</strong>.<br /></font>';
 
 
}
 
if(!$message) {
 
 $fehler['message'] = '<font color=#cc3333>Please enter a <strong>message</strong>.<br /></font>';
 
 
}

if($sicherheits_eingabe != $_SESSION['captcha_spam']){
unset($_SESSION['captcha_spam']);
   $fehler['captcha'] = "<font color=#cc3333>You entered a wrong <strong>code</strong>.<br /></font>";
   }

    if (!isset($fehler) || count($fehler) == 0) {
      $error             = false;
      $errorMessage      = '';
      $uploadErrors      = array();
      $uploadedFiles     = array();
      $totalUploadSize   = 0;

      if ($cfg['UPLOAD_ACTIVE'] && in_array($_SERVER['REMOTE_ADDR'], $cfg['BLACKLIST_IP']) === true) {
          $error = true;
          $fehler['upload'] = '<font color=#990000>You have no authorization to upload files.<br /></font>';
      }

      if (!$error) {
          for ($i=0; $i < $cfg['NUM_ATTACHMENT_FIELDS']; $i++) {
              if ($_FILES['f']['error'][$i] == UPLOAD_ERR_NO_FILE) {
                  continue;
              }

              $extension = explode('.', $_FILES['f']['name'][$i]);
              $extension = strtolower($extension[count($extension)-1]);
              $totalUploadSize += $_FILES['f']['size'][$i];

              if ($_FILES['f']['error'][$i] != UPLOAD_ERR_OK) {
                  $uploadErrors[$j]['name'] = $_FILES['f']['name'][$i];
                  switch ($_FILES['f']['error'][$i]) {
                      case UPLOAD_ERR_INI_SIZE :
                          $uploadErrors[$j]['error'] = 'the file is too big (PHP-Ini directive).';
                      break;
                      case UPLOAD_ERR_FORM_SIZE :
                          $uploadErrors[$j]['error'] = 'the file is too big (MAX_FILE_SIZE in HTML-Formular).';
                      break;
                      case UPLOAD_ERR_PARTIAL :
						  if ($cfg['UPLOAD_ACTIVE']) {
                          	  $uploadErrors[$j]['error'] = 'the file has been uploaded partially.';
						  } else {
							  $uploadErrors[$j]['error'] = 'the file has been sent partially.';
					  	  }
                      break;
                      case UPLOAD_ERR_NO_TMP_DIR :
                          $uploadErrors[$j]['error'] = 'No temporarily folder has been found.';
                      break;
                      case UPLOAD_ERR_CANT_WRITE :
                          $uploadErrors[$j]['error'] = 'error during saving the file.';
                      break;
                      case UPLOAD_ERR_EXTENSION  :
                          $uploadErrors[$j]['error'] = 'unknown error due to an extension.';
                      break;
                      default :
						  if ($cfg['UPLOAD_ACTIVE']) {
                          	  $uploadErrors[$j]['error'] = 'unknown error on uploading.';
						  } else {
							  $uploadErrors[$j]['error'] = 'unknown error on sending the email attachments.';
						  }
                  }

                  $j++;
                  $error = true;
              }
              else if ($totalUploadSize > $cfg['MAX_ATTACHMENT_SIZE']*1024) {
                  $uploadErrors[$j]['name'] = $_FILES['f']['name'][$i];
                  $uploadErrors[$j]['error'] = 'maximum upload reached ('.$cfg['MAX_ATTACHMENT_SIZE'].' KB).';
                  $j++;
                  $error = true;
              }
              else if ($_FILES['f']['size'][$i] > $cfg['MAX_FILE_SIZE']*1024) {
                  $uploadErrors[$j]['name'] = $_FILES['f']['name'][$i];
                  $uploadErrors[$j]['error'] = 'The file is too big (max. '.$cfg['MAX_FILE_SIZE'].' KB).';
                  $j++;
                  $error = true;
              }
              else if (!empty($cfg['BLACKLIST_EXT']) && strpos($cfg['BLACKLIST_EXT'], $extension) !== false) {
                  $uploadErrors[$j]['name'] = $_FILES['f']['name'][$i];
                  $uploadErrors[$j]['error'] = 'the file extension is not permitted.';
                  $j++;
                  $error = true;
              }
              else if (preg_match("=^[\\\\:*?<>|/]+$=", $_FILES['f']['name'][$i])) {
                  $uploadErrors[$j]['name'] = $_FILES['f']['name'][$i];
                  $uploadErrors[$j]['error'] = 'invalid symbols in the file name (\\/:*?<>|).';
                  $j++;
                  $error = true;
              }
              else if ($cfg['UPLOAD_ACTIVE'] && file_exists($cfg['UPLOAD_FOLDER'].'/'.$_FILES['f']['name'][$i])) {
                  $uploadErrors[$j]['name'] = $_FILES['f']['name'][$i];
                  $uploadErrors[$j]['error'] = 'the file already exist.';
                  $j++;
                  $error = true;
              }
              else {
				  if ($cfg['UPLOAD_ACTIVE']) {
                     move_uploaded_file($_FILES['f']['tmp_name'][$i], $cfg['UPLOAD_FOLDER'].'/'.$_FILES['f']['name'][$i]);	
				  }
                  $uploadedFiles[] = $_FILES['f']['name'][$i];
              }
          }
      }

      if ($error) {
          $errorMessage = 'following errors occured when sending the contact formular:'."\
";
          if (count($uploadErrors) > 0) {
              foreach ($uploadErrors as $err) {
                  $tmp .= '<strong>'.$err['name']."</strong><br/>\
- ".$err['error']."<br/><br/>\
";
              }
              $tmp = "<br/><br/>\
".$tmp;
          }
          $errorMessage .= $tmp.'';
          $fehler['upload'] = $errorMessage;
      }
  }


// if no error, an email will be sent
   if (!isset($fehler))
   {

// header of the email
   $recipient = "".$empfaenger.""; 
   $betreff = "".$_POST["subject"]."";
   $mailheaders = "From: \\"".stripslashes($_POST["name"])."\\" <".$_POST["email"].">\
";
   $mailheaders .= "Reply-To: <".$_POST["email"].">\
";
   $mailheaders .= "X-Mailer: PHP/" . phpversion() . "\
";


   $msg  = "The following has been sent by the contact form:\
" . "-------------------------------------------------------------------------\
\
";
   $msg .= "Name: " . $name . "\
";
   $msg .= "E-Mail: " . $email . "\
\
";
   $msg .= "street: " . $street . "\
";
   $msg .= "city: " . $city . "\
";
   $msg .= "info: " . $info . "\
";
   $msg .= "\
Subject: " . $subject . "\
";
   $msg .= "Message:\
" . $_POST['message'] = preg_replace("/\\r\\r|\\r\
|\
\\r|\
\
/","\
",$_POST['message']) . "\
\
";
   "-------------------------------------------------------------------------\
\
";
 if (count($uploadedFiles) > 0) {
	   if ($cfg['UPLOAD_ACTIVE']) {
       	   $msg .= 'The following files have been uploaded:'."\
";
	       foreach ($uploadedFiles as $file) {
	           $msg .= ' - '.$cfg['DOWNLOAD_URL'].'/'.$cfg['UPLOAD_FOLDER'].'/'.$file."\
";
	       }
	   } else {
		   $msg .= 'The following files have been attached:'."\
";
		   foreach ($uploadedFiles as $file) {
	           $msg .= ' - '.$file."\
";
	       }
	   }
   }
   $msg .= "\
\
IP address: " . $ip . "\
";
  
   


	if (!$cfg['UPLOAD_ACTIVE'] && count($uploadedFiles) > 0) {
		$attachments = array();
		for ($i = 0; $i < $cfg['NUM_ATTACHMENT_FIELDS']; $i++) {
		   	if ($_FILES['f']['name'][$i] == UPLOAD_ERR_NO_FILE) {
				continue;
			}
			$attachments[] = $_FILES['f']['tmp_name'][$i];
		}
		$boundary = md5(uniqid(rand(), true));
		$mailheaders .= "MIME-Version: 1.0\
";
		$mailheaders .= "Content-Transfer-Encoding: 8bit\
";
		$mailheaders .= "Content-Type: multipart/mixed;\
\	boundary=\\"".$boundary."\\"\
";
		$mailheaders .= "\
--".$boundary."\
";
		$mailheaders .= "Content-Type: text/plain;\
\	charset=\\"iso-8859-1\\"\
";
		$mailheaders .= "Content-Transfer-Encoding: 8bit\
";
		for ($i = 0; $i < count($uploadedFiles); $i++) {
			$file = fopen($attachments[$i],"r");
			$content = fread($file,filesize($attachments[$i]));
			fclose($file);
			$encodedfile = chunk_split(base64_encode($content));
			$msg .= "\
\
--".$boundary."\
";
			$msg .= "Content-Type: application/octet-stream;\
\	name=\\"".$uploadedFiles[$i]."\\"\
";
			$msg .= "Content-Transfer-Encoding: base64\
";
			$msg .= "Content-Disposition: attachment;\
\	filename=\\"".$uploadedFiles[$i]."\\"\
\
";
			$msg .= $encodedfile."\
\
";
		}
		$msg .= "\
\
--".$boundary."--";
	}


   $msg = strip_tags ($msg);

   
   $dsubject = "Your request"; // Subject of the message
   $dmailheaders = "From: ".$ihrname." <".$recipient.">\
";
   $dmailheaders .= "Reply-To: <".$recipient.">\
";
   $dmsg  = "Thank you very much for your e-mail. We will reply as fast as we can.\
\
";
   $dmsg .= "Summary: \
" .
  "-------------------------------------------------------------------------\
\
";
   $dmsg .= "Name: " . $name . "\
";
   $dmsg .= "E-Mail: " . $email . "\
\
";
   $dmsg .= "street: " . $street . "\
";
   $dmsg .= "city: " . $city . "\
";
   $dmsg .= "info: " . $info . "\
";
   $dmsg .= "\
Subject: " . $subject . "\
";
   $dmsg .= "Message:\
" . str_replace("\\r", "", $message) . "\
\
";
   
   if (count($uploadedFiles) > 0) {
       $dmsg .= 'You have assigned the following files:'."\
";
       foreach ($uploadedFiles as $file) {
           $dmsg .= ' - '.$file."\
";
       }
   }
   
   $dmsg = strip_tags ($dmsg);


if (mail($recipient,$subject,$msg,$mailheaders)) {
mail($email, $dsubject, $dmsg, $dmailheaders);


echo "<META HTTP-EQUIV=\\"refresh\\" content=\\"0;URL=thankyou.php\\">";
exit;
 
}
}
}

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de-DE" lang="de-DE">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<meta name="language" 			content="de"/>
<meta name="description"      content="kontaktformular.com"/>
<meta name="revisit"          content="After 7 days"/>
<meta name="robots"           content="INDEX,FOLLOW"/>
<meta http-equiv="Content-Style-Type" content="text/css" />   
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<title>Oaknoll Contact Form</title>

<style type="text/css">
body,td,th{font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;color:#000000;}
body{background-color: #FFFFFF;}

a:link, a:visited, a:active{color:#000000;text-decoration:none;}

a:hover{text-decoration: underline;}
.pflichtfeld {
	 color: #ff0000;}
	 .neuercode {
	 color: #0066FF;}
	 	 .copyright {
	 color: #000000;}
</style>
</head>

<body id="Kontaktformularseite">

<div class="kontaktformular">
<form action="<?php $_SERVER['PHP_SELF'];?>" method="post" enctype="multipart/form-data">

<p><input style="width:0px; height:0px; visibility:hidden;" type="hidden" name="action" value="smail" /></p>
<p><input style="width:0px; height:0px; visibility:hidden;" type="hidden" name="content" value="formular"/></p>

<table style="width:500px">
<tr><td colspan="2"></td></tr>
<tr>
	<td style="width:150px"><strong>Your Name: <span class="pflichtfeld">*</span></strong></td>
	<td><?php if ($fehler["name"] != "") { echo $fehler["name"]; } ?><input name="name" type="text" value="<?php echo $_POST[name]; ?>" style="width:260px" maxlength="100" /></td>
</tr>

<tr>
	<td style="width:150px"><strong>E-Mail: <span class="pflichtfeld">*</span></strong><br /></td>
	<td><?php if ($fehler["email"] != "") { echo $fehler["email"]; } ?><input name="email" type="text" id="email" value="<?php echo $_POST[email]; ?>" style="width:260px" maxlength="100" /></td>
</tr>

<tr>
	<td style="width:150px"><strong>Street:</strong></td>

	<td><input name="street" type="text" value="<?php echo $_POST[street]; ?>" style="width:260px" maxlength="50" /></td>
</tr>

<tr>
	<td style="width:150px"><strong>City and Zip:</strong></td>

	<td><input name="city" type="text" value="<?php echo $_POST[city]; ?>" style="width:260px" maxlength="50" /></td>
</tr>


<tr>
	<td style="width:150px"><strong>Information is for:<br />
	  (self, father, mother)
	</strong></td>

	<td><input name="info" type="text" value="<?php echo $_POST[info]; ?>" style="width:260px" maxlength="50" /></td>
</tr>



<tr>
	<td style="width:150px"><strong>Subject: <span class="pflichtfeld">*</span></strong></td>
	<td><?php if ($fehler["subject"] != "") { echo $fehler["subject"]; } ?><input name="subject" type="text" value="<?php echo $_POST[subject]; ?>" style="width:260px" maxlength="50" /></td>
</tr>

<tr>
	<td style="width:150px"><strong>Message: <span class="pflichtfeld">*</span></strong></td>
	<td><?php if ($fehler["message"] != "") { echo $fehler["message"]; } ?><textarea style="width:260px" name="message" cols="35" rows="10"><?php echo $_POST[message]; ?></textarea></td>
</tr>


<?php
      for ($i=0; $i < $cfg['NUM_ATTACHMENT_FIELDS']; $i++) {
          echo '<tr>';
		  echo '<td style="width:150px"><strong>Attachment:</strong></td>';
		  echo '<td><input type="file" style="width:268px" name="f[]" /></td>';
		  echo '</tr>';
      }
?>


<tr>
<td style="width:150px">&nbsp;</td>
	<td>&nbsp;</td>
</tr>
<tr>
<td style="width:150px"><strong>Security Code:</strong></td>
	<td><img src="captcha_form/captcha.php" alt="Security-Code" title="michatronic-sicherheitscode" id="captcha" /><br />
	<a href="javascript:void(0);" onclick="javascript:document.getElementById('captcha').src='captcha_form/captcha.php?'+Math.random();"><span class="neuercode">New Code?</span></a></td>
</tr>
<tr>
	<td style="width:150px"><strong>Please enter: <span class="pflichtfeld">*</span></strong></td>
	<td><?php if ($fehler["captcha"] != "") { echo $fehler["captcha"]; } ?><input type="text" name="securitycode" maxlength="150" style="width:260px" value="" size="20" /></td>

</tr>

<tr>
	<td style="width:150px">&nbsp;</td>
	<td>&nbsp;</td>
</tr>
<tr>
	<td style="width:150px">&nbsp;</td>
	<td style="font-size:11px">Advice: Fields with <span class="pflichtfeld">*</span> have to be filled.</td>
</tr>
<tr>
	<td style="width:150px"></td>
	<td>   <input type="submit" name="mt-mk" value="Send" onclick="tescht();"/>
   <input type="submit" name="delete" value="Delete" />
	</td>
</tr>
</table>


</form> 
 </div>

</body>
</html>


Thanks,
sarb

Ooops,

Sorry, the page with the error can be viewed at this link:

http://www.sitesbysarah.com/contact.php

Without seeing the source for contact.php it will be difficult to troubleshoot all of the problems, but at least one problem is obvious.

In file contact.php you are declaring a DOCTYPE, you have tags for <head>, <body> and etc. In file contact_form.php you are also declaring a DOCTYPE, have tags for <head>, <body> and etc. These should not be included twice on the same page. The instructions on the www.kontaktformular.com page were not very helpful or complete so I can see why you are confused if you are not familiar with PHP.

If you “View Page Source” when your browser displays the error, you can see the duplicate tags.

here is my contact.php code:



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
   <html xmlns="http://www.w3.org/1999/xhtml">

<head>
<title>Oaknoll - An Adult Retirement Community</title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Keywords"
 content="oaknoll, iowa city, retirement, elderly, iowa, LifeCare, retirement community, nursing home, apartment, independent living, resident, geriatric, aging, community, retire, retired, elder,  health care, assisted living, nursing care">
<meta name="Description"
 content="Oaknoll is an adult retirement community in Iowa City, Iowa.">
<meta name="robots" content="index,follow">

<!-- include Cycle plugin -->

<!-- include jQuery library -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<!-- include Cycle plugin -->
<script type="text/javascript" src="http://cloud.github.com/downloads/malsup/cycle/jquery.cycle.all.latest.js"></script>
<script type="text/javascript">
$(document).ready(function() {
    $('.slideshow').cycle({
		fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	    	
			});


$('#s3').cycle({ 
    fx:    'fade', 
    speed:  5500,
	cleartype: 1,
cleartypeNoBg: false,
height: 'auto',
containerResize: 0,

timeout: 8000,

sync: 0,

fadeOut:'slow', 



nowrap: 0,
randomizeEffects: 0,
pause: 0,
	
	
 });

});
</script>

		
  <!--Vertical Slider Navigation javascript-->    
    




  <script type="text/javascript">
/* ================================================================ 
This copyright notice must be untouched at all times.
Copyright (c) 2008 Stu Nicholls - stunicholls.com - all rights reserved.
=================================================================== */

$(document).ready(function(){
	if($("#nav")) {
		$("#nav dd").hide();
		$("#nav dt b").click(function() {
			if(this.className.indexOf("clicked") != -1) {
				$(this).parent().next().slideUp(200);
				$(this).removeClass("clicked");
			}
			else {
				$("#nav dt b").removeClass();
				$(this).addClass("clicked");
				$("#nav dd:visible").slideUp(200);
				$(this).parent().next().slideDown(500);
			}
			return false;
		});
	}
});
</script>





<!--endofVerticalSliderNavigationjavascript-->    
  
<!--tocorrecttheunsightlyFlashofUnstyledContenthttp://www.bluerobot.com/web/css/fouc.asp-->
	<script type="text/javascript"> </script>
	

	

<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="ie6.css" />
<![endif]-->


<link rel="stylesheet" href="floating_index.css" type="text/css" />
<link rel="stylesheet" href="nav_css.css" type="text/css" />
<link rel="stylesheet" href="contact_form.css" type="text/css" />/head>

<body>

<div id="container">

 <?php include $_SERVER["DOCUMENT_ROOT"] . "/includes/header_php.php"; ?>
		
      
       
        
  <div id="main">
         
         
        <div id="box1">
       <div class="slideshow">
		<img src="images/building.jpg" width="400" height="300" alt="Oaknoll Entrance" class="first" />
		<img src="images/weightroom.jpg" width="400" height="300"  alt="Weight Room"/>
		<img src="images/taichi.jpg" width="400" height="300" alt="tai chi class"/>
        <img src="images/movie_theater.jpg" width="400" height="267" alt="movie theater"/>
        <img src="images/swimming_pool.jpg" width="400" height="267" alt="swimming pool"/>
        <img src="images/vans.jpg" width="400" height="300" alt="Oaknoll vans" />
	   </div> <!--end-of-slideshow-->
        </div><!--end-box-1-->
        
        <div id="box2">                
   	  <div class="buttonbox"><img src="images/4_special_buttons.jpg" alt="internet buttons" width="181" height="300" border="0" usemap="#Map" />
        <map name="Map" id="Map">
          <area shape="rect" coords="14,8,178,70" href="http://www.touchtown.tv/tv/tv/webshow/tv1.jsp?tag=OAKNOLL_WEB" target="_blank" alt="Link to Oaknoll Announcements" border="none" />
          <area shape="rect" coords="14,86,177,145" href="http://www.facebook.com/Oaknoll?ref=sgm" target="_blank" alt="Link to Oaknoll's Facebook Page" border="none"/>
          <area shape="rect" coords="15,161,171,213" href="http://oaknoll.blogspot.com/" target="_blank" alt="Link to the Oaknoll Blog" />
          <area shape="rect" coords="17,232,174,296" href="hawkey.php" alt="Link to Golden Hawkeye Birthday Club" />
        </map>
   	  </div><!--BUTTONBOX--> 
        </div><!--end-box-2-->
        
  
   
   <h1 style="clear:left;">Contact Us...</h1>
   
   
  <?php include $_SERVER["DOCUMENT_ROOT"] . "/includes/contact_form.php"; ?>
   
   
   
   <div id="contact_box">
   <div id="contact_box1">  <p>1 Oaknoll Court<br />
     Iowa City, Iowa 52246<br />
     <strong>(319) 351-1720</strong><br />
FAX: (319) 351-6772</p>
   <p><a href="mailto:oaknoll@oaknoll.com">oaknoll@oaknoll.com</a></p>
   
   <p>&nbsp;</p>
   
   
  
  
   
  
   
   </div><!--endcontact_box1-->
   <div id="contact_box2">
   
    <p>Here is box 2</p> 
   
 <iframe width="250" height="200" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=1+Oaknoll+Court,+Iowa+City,+IA&amp;aq=0&amp;sll=37.0625,-95.677068&amp;sspn=35.273162,56.513672&amp;vpsrc=6&amp;ie=UTF8&amp;hq=&amp;hnear=1+Oaknoll+Ct,+Iowa+City,+Iowa+52246&amp;t=m&amp;ll=41.651238,-91.555424&amp;spn=0.012827,0.021458&amp;z=14&amp;iwloc=A&amp;output=embed"></iframe><br /><small><a href="http://maps.google.com/maps?f=q&amp;source=embed&amp;hl=en&amp;geocode=&amp;q=1+Oaknoll+Court,+Iowa+City,+IA&amp;aq=0&amp;sll=37.0625,-95.677068&amp;sspn=35.273162,56.513672&amp;vpsrc=6&amp;ie=UTF8&amp;hq=&amp;hnear=1+Oaknoll+Ct,+Iowa+City,+Iowa+52246&amp;t=m&amp;ll=41.651238,-91.555424&amp;spn=0.012827,0.021458&amp;z=14&amp;iwloc=A" style="color:#0000FF;text-align:left">View Larger Map</a></small>
   
   </div>
   </div>
   
   
   				
	
   
   
   
   <p>&nbsp;</p>
<p align="center">&nbsp;</p>
</div>
        
        
     
      

   <?php include $_SERVER["DOCUMENT_ROOT"] . "/includes/menu_php.php"; ?>

 
        
	
  
 <?php include $_SERVER["DOCUMENT_ROOT"] . "/includes/footer_php.php"; ?>
  </div><!--end-of-main-->
</div><!--end-of-container-->
</body>
</html>



I can’t go into detail now but for starters you should properly close your <head> tag. You are using “/head>” and you should be using “</head>”.

In the file you downloaded from the kontaktformular.com site (what you have renamed to contact_form.php) you should delete lines 440 and 441 (the last 2 lines) and delete lines 317 thru 345.

In your conatact.php file you may need to include as the first line (above the DOCTYPE declaration) code

<?php session_start(); ?>

and you may need to remove

<?php session_start(); ?>

from contact_form.php. You may need to change your body tag to <body id=“Kontaktformularseite”>

This is just a quick look. I haven’t tested anything.

When I looked at my contact_form.php code, I am not seeing anything on lines 440 and 441. Just a table tag <tr>. I don’t think my lines are the same as what you are seeing.

“In the file you downloaded from the kontaktformular.com site (what you have renamed to contact_form.php) you should delete lines 440 and 441 (the last 2 lines) and delete lines 317 thru 345.”

The last two lines contain the following:

</body>
</html>

Lines 317 thru 345 contain

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de-DE" lang="de-DE">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<meta name="language"             content="de"/>
<meta name="description"      content="kontaktformular.com"/>
<meta name="revisit"          content="After 7 days"/>
<meta name="robots"           content="INDEX,FOLLOW"/>
<meta http-equiv="Content-Style-Type" content="text/css" />   
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<title>kontaktformular.com</title>

<style type="text/css">
body,td,th{font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;color:#000000;}
body{background-color: #FFFFFF;}

a:link, a:visited, a:active{color:#000000;text-decoration:none;}

a:hover{text-decoration: underline;}
.pflichtfeld {
     color: #ff0000;}
     .neuercode {
     color: #0066FF;}
          .copyright {
     color: #000000;}
</style>
</head>

<body id="Kontaktformularseite">

My line counter includes blank lines.

Hi,

I’ve removed the html code as you suggested. I loaded the page up to the server and get the following message:

"Parse error: syntax error, unexpected ‘;’ in /home/sitesb2/public_html/contact2.php on line 158"

Here is a link to the webpage: [B]http://www.sitesbysarah.com/contact2.php[/B]

The contact_form.php code now looks like this without the doc type and the /body and /html removed…


<?php
session_start();

#########################################################################
#	Kontaktformular.com         					                                #
#	http://www.kontaktformular.com        						                    #
#	All rights by Michael Knothe                                    			#
#-----------------------------------------------------------------------#
#	Info: Michael.Knothe@gmx.de		            		                        #
#	I-Net: http://www.kontaktformular.com                        					#
#########################################################################
// It´s not allowed to remove the copyright notice!


  $script_root = substr(__FILE__, 0,
                        strrpos(__FILE__,
                                DIRECTORY_SEPARATOR)
                       ).DIRECTORY_SEPARATOR;

  require_once $script_root.'upload.php';

$remote = getenv("REMOTE_ADDR");

function encrypt($string, $key) {
$result = '';
for($i=0; $i<strlen($string); $i++) {
   $char = substr($string, $i, 1);
   $keychar = substr($key, ($i % strlen($key))-1, 1);
   $char = chr(ord($char)+ord($keychar));
   $result.=$char;
}
return base64_encode($result);
}
$sicherheits_eingabe = encrypt($_POST["securitycode"], "8h384ls94");
$sicherheits_eingabe = str_replace("=", "", $sicherheits_eingabe);

@require('config.php');

if ($_POST['delete'])
{
unset($_POST);
}


if ($_POST["mt-mk"]) {


   $name      = $_POST["name"];
   $email      = $_POST["email"];
   $street = $_POST["street"];
   $city = $_POST["city"];
   $for = $_POST["for"];
   $subject   = $_POST["subject"];
   $message   = $_POST["message"];
   $securitycode   = $_POST["securitycode"];
   $date = date("d.m.Y | H:i");
   $ip = $_SERVER['REMOTE_ADDR']; 
   $UserAgent = $_SERVER["HTTP_USER_AGENT"];
   $host = getHostByAddr($remote);



$name = stripslashes($name);
$email = stripslashes($email);
$subject = stripslashes($subject);
$message = stripslashes($message);
 

if(!$name) {
 
 $fehler['name'] = "<font color=#cc3333>Please enter your <strong>name</strong>.<br /></font>";
 
}


if (!preg_match("/^[0-9a-zA-ZÄÜÖ_.-]+@[0-9a-z.-]+\\.[a-z]{2,6}$/", $email)) {
   $fehler['email'] = "<font color=#cc3333>Please enter a <strong>e-mail-address</strong>.\
<br /></font>";
}


if(!$street) {
 
 $fehler['street'] = '<font color=#cc3333>Please enter a <strong>street</strong>.<br /></font>';
 

if(!$city) {
 
 $fehler['city'] = '<font color=#cc3333>Please enter your <strong>city and zipcode</strong>.<br /></font>';
 

if(!$for) {
 
 $fehler['for'] = '<font color=#cc3333>Please enter who info is for <strong>(self, mother, father, etc.)</strong>.<br /></font>';
 
 
if(!$subject) {
 
 $fehler['subject'] = '<font color=#cc3333>Please enter a <strong>subject</strong>.<br /></font>';
 
 
}
 
if(!$message) {
 
 $fehler['message'] = '<font color=#cc3333>Please enter a <strong>message</strong>.<br /></font>';
 
 
}

if($sicherheits_eingabe != $_SESSION['captcha_spam']){
unset($_SESSION['captcha_spam']);
   $fehler['captcha'] = "<font color=#cc3333>You entered a wrong <strong>code</strong>.<br /></font>";
   }

    if (!isset($fehler) || count($fehler) == 0) {
      $error             = false;
      $errorMessage      = '';
      $uploadErrors      = array();
      $uploadedFiles     = array();
      $totalUploadSize   = 0;

      if ($cfg['UPLOAD_ACTIVE'] && in_array($_SERVER['REMOTE_ADDR'], $cfg['BLACKLIST_IP']) === true) {
          $error = true;
          $fehler['upload'] = '<font color=#990000>You have no authorization to upload files.<br /></font>';
      }

      if (!$error) {
          for ($i=0; $i < $cfg['NUM_ATTACHMENT_FIELDS']; $i++) {
              if ($_FILES['f']['error'][$i] == UPLOAD_ERR_NO_FILE) {
                  continue;
              }

              $extension = explode('.', $_FILES['f']['name'][$i]);
              $extension = strtolower($extension[count($extension)-1]);
              $totalUploadSize += $_FILES['f']['size'][$i];

              if ($_FILES['f']['error'][$i] != UPLOAD_ERR_OK) {
                  $uploadErrors[$j]['name'] = $_FILES['f']['name'][$i];
                  switch ($_FILES['f']['error'][$i]) {
                      case UPLOAD_ERR_INI_SIZE :
                          $uploadErrors[$j]['error'] = 'the file is too big (PHP-Ini directive).';
                      break;
                      case UPLOAD_ERR_FORM_SIZE :
                          $uploadErrors[$j]['error'] = 'the file is too big (MAX_FILE_SIZE in HTML-Formular).';
                      break;
                      case UPLOAD_ERR_PARTIAL :
						  if ($cfg['UPLOAD_ACTIVE']) {
                          	  $uploadErrors[$j]['error'] = 'the file has been uploaded partially.';
						  } else {
							  $uploadErrors[$j]['error'] = 'the file has been sent partially.';
					  	  }
                      break;
                      case UPLOAD_ERR_NO_TMP_DIR :
                          $uploadErrors[$j]['error'] = 'No temporarily folder has been found.';
                      break;
                      case UPLOAD_ERR_CANT_WRITE :
                          $uploadErrors[$j]['error'] = 'error during saving the file.';
                      break;
                      case UPLOAD_ERR_EXTENSION  :
                          $uploadErrors[$j]['error'] = 'unknown error due to an extension.';
                      break;
                      default :
						  if ($cfg['UPLOAD_ACTIVE']) {
                          	  $uploadErrors[$j]['error'] = 'unknown error on uploading.';
						  } else {
							  $uploadErrors[$j]['error'] = 'unknown error on sending the email attachments.';
						  }
                  }

                  $j++;
                  $error = true;
              }
              else if ($totalUploadSize > $cfg['MAX_ATTACHMENT_SIZE']*1024) {
                  $uploadErrors[$j]['name'] = $_FILES['f']['name'][$i];
                  $uploadErrors[$j]['error'] = 'maximum upload reached ('.$cfg['MAX_ATTACHMENT_SIZE'].' KB).';
                  $j++;
                  $error = true;
              }
              else if ($_FILES['f']['size'][$i] > $cfg['MAX_FILE_SIZE']*1024) {
                  $uploadErrors[$j]['name'] = $_FILES['f']['name'][$i];
                  $uploadErrors[$j]['error'] = 'The file is too big (max. '.$cfg['MAX_FILE_SIZE'].' KB).';
                  $j++;
                  $error = true;
              }
              else if (!empty($cfg['BLACKLIST_EXT']) && strpos($cfg['BLACKLIST_EXT'], $extension) !== false) {
                  $uploadErrors[$j]['name'] = $_FILES['f']['name'][$i];
                  $uploadErrors[$j]['error'] = 'the file extension is not permitted.';
                  $j++;
                  $error = true;
              }
              else if (preg_match("=^[\\\\:*?<>|/]+$=", $_FILES['f']['name'][$i])) {
                  $uploadErrors[$j]['name'] = $_FILES['f']['name'][$i];
                  $uploadErrors[$j]['error'] = 'invalid symbols in the file name (\\/:*?<>|).';
                  $j++;
                  $error = true;
              }
              else if ($cfg['UPLOAD_ACTIVE'] && file_exists($cfg['UPLOAD_FOLDER'].'/'.$_FILES['f']['name'][$i])) {
                  $uploadErrors[$j]['name'] = $_FILES['f']['name'][$i];
                  $uploadErrors[$j]['error'] = 'the file already exist.';
                  $j++;
                  $error = true;
              }
              else {
				  if ($cfg['UPLOAD_ACTIVE']) {
                     move_uploaded_file($_FILES['f']['tmp_name'][$i], $cfg['UPLOAD_FOLDER'].'/'.$_FILES['f']['name'][$i]);	
				  }
                  $uploadedFiles[] = $_FILES['f']['name'][$i];
              }
          }
      }

      if ($error) {
          $errorMessage = 'following errors occured when sending the contact formular:'."\
";
          if (count($uploadErrors) > 0) {
              foreach ($uploadErrors as $err) {
                  $tmp .= '<strong>'.$err['name']."</strong><br/>\
- ".$err['error']."<br/><br/>\
";
              }
              $tmp = "<br/><br/>\
".$tmp;
          }
          $errorMessage .= $tmp.'';
          $fehler['upload'] = $errorMessage;
      }
  }


// if no error, an email will be sent
   if (!isset($fehler))
   {

// header of the email
   $recipient = "".$empfaenger.""; 
   $betreff = "".$_POST["subject"]."";
   $mailheaders = "From: \\"".stripslashes($_POST["name"])."\\" <".$_POST["email"].">\
";
   $mailheaders .= "Reply-To: <".$_POST["email"].">\
";
   $mailheaders .= "X-Mailer: PHP/" . phpversion() . "\
";


   $msg  = "The following has been sent by the contact form:\
" . "-------------------------------------------------------------------------\
\
";
   $msg .= "Name: " . $name . "\
";
   $msg .= "E-Mail: " . $email . "\
\
";
   $msg .= "street: " . $street . "\
";
   $msg .= "city: " . $city . "\
";
   $msg .= "for: " . $for . "\
";
   $msg .= "\
Subject: " . $subject . "\
";
   $msg .= "Message:\
" . $_POST['message'] = preg_replace("/\\r\\r|\\r\
|\
\\r|\
\
/","\
",$_POST['message']) . "\
\
";
   "-------------------------------------------------------------------------\
\
";
 if (count($uploadedFiles) > 0) {
	   if ($cfg['UPLOAD_ACTIVE']) {
       	   $msg .= 'The following files have been uploaded:'."\
";
	       foreach ($uploadedFiles as $file) {
	           $msg .= ' - '.$cfg['DOWNLOAD_URL'].'/'.$cfg['UPLOAD_FOLDER'].'/'.$file."\
";
	       }
	   } else {
		   $msg .= 'The following files have been attached:'."\
";
		   foreach ($uploadedFiles as $file) {
	           $msg .= ' - '.$file."\
";
	       }
	   }
   }
   $msg .= "\
\
IP address: " . $ip . "\
";
  
   


	if (!$cfg['UPLOAD_ACTIVE'] && count($uploadedFiles) > 0) {
		$attachments = array();
		for ($i = 0; $i < $cfg['NUM_ATTACHMENT_FIELDS']; $i++) {
		   	if ($_FILES['f']['name'][$i] == UPLOAD_ERR_NO_FILE) {
				continue;
			}
			$attachments[] = $_FILES['f']['tmp_name'][$i];
		}
		$boundary = md5(uniqid(rand(), true));
		$mailheaders .= "MIME-Version: 1.0\
";
		$mailheaders .= "Content-Transfer-Encoding: 8bit\
";
		$mailheaders .= "Content-Type: multipart/mixed;\
\	boundary=\\"".$boundary."\\"\
";
		$mailheaders .= "\
--".$boundary."\
";
		$mailheaders .= "Content-Type: text/plain;\
\	charset=\\"iso-8859-1\\"\
";
		$mailheaders .= "Content-Transfer-Encoding: 8bit\
";
		for ($i = 0; $i < count($uploadedFiles); $i++) {
			$file = fopen($attachments[$i],"r");
			$content = fread($file,filesize($attachments[$i]));
			fclose($file);
			$encodedfile = chunk_split(base64_encode($content));
			$msg .= "\
\
--".$boundary."\
";
			$msg .= "Content-Type: application/octet-stream;\
\	name=\\"".$uploadedFiles[$i]."\\"\
";
			$msg .= "Content-Transfer-Encoding: base64\
";
			$msg .= "Content-Disposition: attachment;\
\	filename=\\"".$uploadedFiles[$i]."\\"\
\
";
			$msg .= $encodedfile."\
\
";
		}
		$msg .= "\
\
--".$boundary."--";
	}


   $msg = strip_tags ($msg);

   
   $dsubject = "Your request"; // Subject of the message
   $dmailheaders = "From: ".$ihrname." <".$recipient.">\
";
   $dmailheaders .= "Reply-To: <".$recipient.">\
";
   $dmsg  = "Thank you very much for your e-mail. We will contact you soon.\
\
";
   $dmsg .= "Summary: \
" .
  "-------------------------------------------------------------------------\
\
";
   $dmsg .= "Name: " . $name . "\
";
   $dmsg .= "E-Mail: " . $email . "\
\
";
   $dmsg .= "street: " . $street . "\
";
   $dmsg .= "city: " . $city . "\
";
   $dmsg .= "for: " . $for . "\
";
   $dmsg .= "\
Subject: " . $subject . "\
";
   $dmsg .= "Message:\
" . str_replace("\\r", "", $message) . "\
\
";
   
   if (count($uploadedFiles) > 0) {
       $dmsg .= 'You have assigned the following files:'."\
";
       foreach ($uploadedFiles as $file) {
           $dmsg .= ' - '.$file."\
";
       }
   }
   
   $dmsg = strip_tags ($dmsg);


if (mail($recipient,$subject,$msg,$mailheaders)) {
mail($email, $dsubject, $dmsg, $dmailheaders);


echo "<META HTTP-EQUIV=\\"refresh\\" content=\\"0;URL=thankyou.php\\">";
exit;
 
}
}
}

?>


<div class="kontaktformular">
<form action="<?php $_SERVER['PHP_SELF'];?>" method="post" enctype="multipart/form-data">

<p><input style="width:0px; height:0px; visibility:hidden;" type="hidden" name="action" value="smail" /></p>
<p><input style="width:0px; height:0px; visibility:hidden;" type="hidden" name="content" value="formular"/></p>

<table style="width:500px">
<tr><td colspan="2"></td></tr>
<tr>
	<td style="width:150px"><strong>Your Name: <span class="pflichtfeld">*</span></strong></td>
	<td><?php if ($fehler["name"] != "") { echo $fehler["name"]; } ?><input name="name" type="text" value="<?php echo $_POST[name]; ?>" style="width:260px" maxlength="100" /></td>
</tr>

<tr>
	<td style="width:150px"><strong>E-Mail: <span class="pflichtfeld">*</span></strong><br /></td>
	<td><?php if ($fehler["email"] != "") { echo $fehler["email"]; } ?><input name="email" type="text" id="email" value="<?php echo $_POST[email]; ?>" style="width:260px" maxlength="100" /></td>
</tr>

<tr>
	<td style="width:150px"><strong>Street:</strong></td>

	<td><input name="street" type="text" value="<?php echo $_POST[street]; ?>" style="width:260px" maxlength="50" /></td>
</tr>

<tr>
	<td style="width:150px"><strong>City, State, Zip:</strong></td>

	<td><input name="city" type="text" value="<?php echo $_POST[city]; ?>" style="width:260px" maxlength="50" /></td>
</tr>


<tr>
	<td style="width:150px"><strong>Information is for:<br />
	  (self, father, mother)
	</strong></td>

	<td><input name="for" type="text" value="<?php echo $_POST[for]; ?>" style="width:260px" maxlength="50" /></td>
</tr>



<tr>
	<td style="width:150px"><strong>Subject: <span class="pflichtfeld">*</span></strong></td>
	<td>
	
	<?php if ($fehler["subject"] != "") { echo $fehler["subject"]; } ?><input name="subject" type="text" value="
	<?php echo $_POST[subject]; ?>" style="width:260px" maxlength="50" /></td>
</tr>

<tr>
	<td style="width:150px"><strong>Message: <span class="pflichtfeld">*</span></strong></td>
	<td>
	
	<?php if ($fehler["message"] != "") { echo $fehler["message"]; } ?><textarea style="width:260px" name="message" cols="35" rows="10"><?php echo $_POST[message]; ?></textarea></td>
</tr>


<?php
      for ($i=0; $i < $cfg['NUM_ATTACHMENT_FIELDS']; $i++) {
          echo '<tr>';
		  echo '<td style="width:150px"><strong>Attachment:</strong></td>';
		  echo '<td><input type="file" style="width:268px" name="f[]" /></td>';
		  echo '</tr>';
      }
?>


<tr>
<td style="width:150px">&nbsp;</td>
	<td>&nbsp;</td>
</tr>
<tr>
<td style="width:150px"><strong>Security Code:</strong></td>
	<td><img src="contactform/captcha/captcha.php" alt="Security-Code" title="michatronic-sicherheitscode" id="captcha" /><br />
	<a href="javascript:void(0);" onclick="javascript:document.getElementById('captcha').src='contactform/captcha/captcha.php?'+Math.random();"><span class="neuercode">New Code?</span></a></td>
</tr>
<tr>
	<td style="width:150px"><strong>Please enter: <span class="pflichtfeld">*</span></strong></td>
	<td>
	
	<?php if ($fehler["captcha"] != "") { echo $fehler["captcha"]; } ?><input type="text" name="securitycode" maxlength="150" style="width:260px" value="" size="20" /></td>

</tr>

<tr>
	<td style="width:150px">&nbsp;</td>
	<td>&nbsp;</td>
</tr>
<tr>
	<td style="width:150px">&nbsp;</td>
	<td style="font-size:11px">Advice: Fields with <span class="pflichtfeld">*</span> have to be filled.</td>
</tr>
<tr>
	<td style="width:150px"></td>
	<td>   <input type="submit" name="mt-mk" value="Send" onclick="tescht();"/>
   <input type="submit" name="delete" value="Delete" />
	</td>
</tr>
</table><p style="font-size:11px"><!-- It´s not allowed to remove the copyright notice! -->
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>


</form> 

</div>


Thanks,
Sarb

If this helps, here is the code to the contact2.php page that the php include is inserted in:


<?php session_start(); ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
   <html xmlns="http://www.w3.org/1999/xhtml">

<head>
<title>Oaknoll - An Adult Retirement Community</title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Keywords"
 content="oaknoll, iowa city, retirement, elderly, iowa, LifeCare, retirement community, nursing home, apartment, independent living, resident, geriatric, aging, community, retire, retired, elder,  health care, assisted living, nursing care">
<meta name="Description"
 content="Oaknoll is an adult retirement community in Iowa City, Iowa.">
<meta name="robots" content="index,follow">

<!-- include Cycle plugin -->

<!-- include jQuery library -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<!-- include Cycle plugin -->
<script type="text/javascript" src="http://cloud.github.com/downloads/malsup/cycle/jquery.cycle.all.latest.js"></script>
<script type="text/javascript">
$(document).ready(function() {
    $('.slideshow').cycle({
		fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	    	
			});


$('#s3').cycle({ 
    fx:    'fade', 
    speed:  5500,
	cleartype: 1,
cleartypeNoBg: false,
height: 'auto',
containerResize: 0,

timeout: 8000,

sync: 0,

fadeOut:'slow', 



nowrap: 0,
randomizeEffects: 0,
pause: 0,
	
	
 });

});
</script>

		
  <!--Vertical Slider Navigation javascript-->    
    




  <script type="text/javascript">
/* ================================================================ 
This copyright notice must be untouched at all times.
Copyright (c) 2008 Stu Nicholls - stunicholls.com - all rights reserved.
=================================================================== */

$(document).ready(function(){
	if($("#nav")) {
		$("#nav dd").hide();
		$("#nav dt b").click(function() {
			if(this.className.indexOf("clicked") != -1) {
				$(this).parent().next().slideUp(200);
				$(this).removeClass("clicked");
			}
			else {
				$("#nav dt b").removeClass();
				$(this).addClass("clicked");
				$("#nav dd:visible").slideUp(200);
				$(this).parent().next().slideDown(500);
			}
			return false;
		});
	}
});
</script>





<!--endofVerticalSliderNavigationjavascript-->    
  
<!--tocorrecttheunsightlyFlashofUnstyledContenthttp://www.bluerobot.com/web/css/fouc.asp-->
	<script type="text/javascript"> </script>
	

	

<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="ie6.css" />
<![endif]-->


<link rel="stylesheet" href="css/floating_index.css" type="text/css" />
<link rel="stylesheet" href="css/nav_css.css" type="text/css" />
<link rel="stylesheet" href="css/contact_form.css" type="text/css" />
</head>

<body>

<div id="container">

 <?php include $_SERVER["DOCUMENT_ROOT"] . "/includes/header_php.php"; ?>
		
      
       
        
  <div id="main">
         
         
        <div id="box1">
       <div class="slideshow">
		<img src="images/building.jpg" width="400" height="300" alt="Oaknoll Entrance" class="first" />
		<img src="images/weightroom.jpg" width="400" height="300"  alt="Weight Room"/>
		<img src="images/taichi.jpg" width="400" height="300" alt="tai chi class"/>
        <img src="images/movie_theater.jpg" width="400" height="267" alt="movie theater"/>
        <img src="images/swimming_pool.jpg" width="400" height="267" alt="swimming pool"/>
        <img src="images/vans.jpg" width="400" height="300" alt="Oaknoll vans" />
	   </div> <!--end-of-slideshow-->
        </div><!--end-box-1-->
        
        <div id="box2">                
   	  <div class="buttonbox"><img src="images/4_special_buttons.jpg" alt="internet buttons" width="181" height="300" border="0" usemap="#Map" />
        <map name="Map" id="Map">
          <area shape="rect" coords="14,8,178,70" href="http://www.touchtown.tv/tv/tv/webshow/tv1.jsp?tag=OAKNOLL_WEB" target="_blank" alt="Link to Oaknoll Announcements" border="none" />
          <area shape="rect" coords="14,86,177,145" href="http://www.facebook.com/Oaknoll?ref=sgm" target="_blank" alt="Link to Oaknoll's Facebook Page" border="none"/>
          <area shape="rect" coords="15,161,171,213" href="http://oaknoll.blogspot.com/" target="_blank" alt="Link to the Oaknoll Blog" />
          <area shape="rect" coords="17,232,174,296" href="hawkey.php" alt="Link to Golden Hawkeye Birthday Club" />
        </map>
   	  </div><!--BUTTONBOX--> 
        </div><!--end-box-2-->
        
  
   
   <h1 style="clear:left;">Contact Us...</h1>
   
   
 
   
   
   
   <div id="contact_box">
   <div id="contact_box1"> 
   
    
  [B]  <?php include("contactform/contact_form.php"; ?>
   [/B]
   
   
  
  
   
  
   
   </div><!--endcontact_box1-->
   <div id="contact_box2">
   
    <p>1 Oaknoll Court<br />
Iowa City, Iowa 52246<br />
<strong>(319) 351-1720</strong><br />
FAX: (319) 351-6772 <br />
    <a href="mailto:oaknoll@oaknoll.com">oaknoll@oaknoll.com</a></p>
    <p>&nbsp;</p>
    <iframe width="250" height="200" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=1+Oaknoll+Court,+Iowa+City,+IA&amp;aq=0&amp;sll=37.0625,-95.677068&amp;sspn=35.273162,56.513672&amp;vpsrc=6&amp;ie=UTF8&amp;hq=&amp;hnear=1+Oaknoll+Ct,+Iowa+City,+Iowa+52246&amp;t=m&amp;ll=41.651238,-91.555424&amp;spn=0.012827,0.021458&amp;z=14&amp;iwloc=A&amp;output=embed"></iframe><br /><small><a href="http://maps.google.com/maps?f=q&amp;source=embed&amp;hl=en&amp;geocode=&amp;q=1+Oaknoll+Court,+Iowa+City,+IA&amp;aq=0&amp;sll=37.0625,-95.677068&amp;sspn=35.273162,56.513672&amp;vpsrc=6&amp;ie=UTF8&amp;hq=&amp;hnear=1+Oaknoll+Ct,+Iowa+City,+Iowa+52246&amp;t=m&amp;ll=41.651238,-91.555424&amp;spn=0.012827,0.021458&amp;z=14&amp;iwloc=A" style="color:#0000FF;text-align:left" target="blank">View Larger Map</a></small>
   
   </div>
   </div>
   
   
   				
	
   
   
   
   <p>&nbsp;</p>
<p align="center">&nbsp;</p>
</div>
        
        
     
      

   <?php include $_SERVER["DOCUMENT_ROOT"] . "/includes/menu_php.php"; ?>

 
        
	
  
 <?php include $_SERVER["DOCUMENT_ROOT"] . "/includes/footer_php.php"; ?>
  </div><!--end-of-main-->
</div><!--end-of-container-->
</body>
</html>



News update. I was actually able to fix the problem with the error message:
“Parse error: syntax error, unexpected ‘;’ in /home/sitesb2/public_html/contact2.php on line 158”.

Now I’m getting the following message:

“Parse error: syntax error, unexpected T_FOR, expecting ‘]’ in /home/sitesb2/public_html/contactform/contact_form.php on line 372”

Can anyone tell me what I’ve done wrong?


<?php
session_start();

#########################################################################
#	Kontaktformular.com         					                                #
#	http://www.kontaktformular.com        						                    #
#	All rights by Michael Knothe                                    			#
#-----------------------------------------------------------------------#
#	Info: Michael.Knothe@gmx.de		            		                        #
#	I-Net: http://www.kontaktformular.com                        					#
#########################################################################
// It´s not allowed to remove the copyright notice!


  $script_root = substr(__FILE__, 0,
                        strrpos(__FILE__,
                                DIRECTORY_SEPARATOR)
                       ).DIRECTORY_SEPARATOR;

  require_once $script_root.'upload.php';

$remote = getenv("REMOTE_ADDR");

function encrypt($string, $key) {
$result = '';
for($i=0; $i<strlen($string); $i++) {
   $char = substr($string, $i, 1);
   $keychar = substr($key, ($i % strlen($key))-1, 1);
   $char = chr(ord($char)+ord($keychar));
   $result.=$char;
}
return base64_encode($result);
}
$sicherheits_eingabe = encrypt($_POST["securitycode"], "8h384ls94");
$sicherheits_eingabe = str_replace("=", "", $sicherheits_eingabe);

@require('config.php');

if ($_POST['delete'])
{
unset($_POST);
}


if ($_POST["mt-mk"]) {


   $name      = $_POST["name"];
   $email      = $_POST["email"];
   $street = $_POST["street"];
   $city = $_POST["city"];
   $for = $_POST["for"];
   $subject   = $_POST["subject"];
   $message   = $_POST["message"];
   $securitycode   = $_POST["securitycode"];
   $date = date("d.m.Y | H:i");
   $ip = $_SERVER['REMOTE_ADDR']; 
   $UserAgent = $_SERVER["HTTP_USER_AGENT"];
   $host = getHostByAddr($remote);



$name = stripslashes($name);
$email = stripslashes($email);
$subject = stripslashes($subject);
$message = stripslashes($message);
 

if(!$name) {
 
 $fehler['name'] = "<font color=#cc3333>Please enter your <strong>name</strong>.<br /></font>";
 
}


if (!preg_match("/^[0-9a-zA-ZÄÜÖ_.-]+@[0-9a-z.-]+\\.[a-z]{2,6}$/", $email)) {
   $fehler['email'] = "<font color=#cc3333>Please enter a <strong>e-mail-address</strong>.\
<br /></font>";
}


if(!$street) {
 
 $fehler['street'] = '<font color=#cc3333>Please enter a <strong>street</strong>.<br /></font>';
 

if(!$city) {
 
 $fehler['city'] = '<font color=#cc3333>Please enter your <strong>city and zipcode</strong>.<br /></font>';
 

if(!$for) {
 
 $fehler['for'] = '<font color=#cc3333>Please enter who info is for <strong>(self, mother, father, etc.)</strong>.<br /></font>';
 
 
if(!$subject) {
 
 $fehler['subject'] = '<font color=#cc3333>Please enter a <strong>subject</strong>.<br /></font>';
 
 
}
 
if(!$message) {
 
 $fehler['message'] = '<font color=#cc3333>Please enter a <strong>message</strong>.<br /></font>';
 
 
}

if($sicherheits_eingabe != $_SESSION['captcha_spam']){
unset($_SESSION['captcha_spam']);
   $fehler['captcha'] = "<font color=#cc3333>You entered a wrong <strong>code</strong>.<br /></font>";
   }

    if (!isset($fehler) || count($fehler) == 0) {
      $error             = false;
      $errorMessage      = '';
      $uploadErrors      = array();
      $uploadedFiles     = array();
      $totalUploadSize   = 0;

      if ($cfg['UPLOAD_ACTIVE'] && in_array($_SERVER['REMOTE_ADDR'], $cfg['BLACKLIST_IP']) === true) {
          $error = true;
          $fehler['upload'] = '<font color=#990000>You have no authorization to upload files.<br /></font>';
      }

      if (!$error) {
          for ($i=0; $i < $cfg['NUM_ATTACHMENT_FIELDS']; $i++) {
              if ($_FILES['f']['error'][$i] == UPLOAD_ERR_NO_FILE) {
                  continue;
              }

              $extension = explode('.', $_FILES['f']['name'][$i]);
              $extension = strtolower($extension[count($extension)-1]);
              $totalUploadSize += $_FILES['f']['size'][$i];

              if ($_FILES['f']['error'][$i] != UPLOAD_ERR_OK) {
                  $uploadErrors[$j]['name'] = $_FILES['f']['name'][$i];
                  switch ($_FILES['f']['error'][$i]) {
                      case UPLOAD_ERR_INI_SIZE :
                          $uploadErrors[$j]['error'] = 'the file is too big (PHP-Ini directive).';
                      break;
                      case UPLOAD_ERR_FORM_SIZE :
                          $uploadErrors[$j]['error'] = 'the file is too big (MAX_FILE_SIZE in HTML-Formular).';
                      break;
                      case UPLOAD_ERR_PARTIAL :
						  if ($cfg['UPLOAD_ACTIVE']) {
                          	  $uploadErrors[$j]['error'] = 'the file has been uploaded partially.';
						  } else {
							  $uploadErrors[$j]['error'] = 'the file has been sent partially.';
					  	  }
                      break;
                      case UPLOAD_ERR_NO_TMP_DIR :
                          $uploadErrors[$j]['error'] = 'No temporarily folder has been found.';
                      break;
                      case UPLOAD_ERR_CANT_WRITE :
                          $uploadErrors[$j]['error'] = 'error during saving the file.';
                      break;
                      case UPLOAD_ERR_EXTENSION  :
                          $uploadErrors[$j]['error'] = 'unknown error due to an extension.';
                      break;
                      default :
						  if ($cfg['UPLOAD_ACTIVE']) {
                          	  $uploadErrors[$j]['error'] = 'unknown error on uploading.';
						  } else {
							  $uploadErrors[$j]['error'] = 'unknown error on sending the email attachments.';
						  }
                  }

                  $j++;
                  $error = true;
              }
              else if ($totalUploadSize > $cfg['MAX_ATTACHMENT_SIZE']*1024) {
                  $uploadErrors[$j]['name'] = $_FILES['f']['name'][$i];
                  $uploadErrors[$j]['error'] = 'maximum upload reached ('.$cfg['MAX_ATTACHMENT_SIZE'].' KB).';
                  $j++;
                  $error = true;
              }
              else if ($_FILES['f']['size'][$i] > $cfg['MAX_FILE_SIZE']*1024) {
                  $uploadErrors[$j]['name'] = $_FILES['f']['name'][$i];
                  $uploadErrors[$j]['error'] = 'The file is too big (max. '.$cfg['MAX_FILE_SIZE'].' KB).';
                  $j++;
                  $error = true;
              }
              else if (!empty($cfg['BLACKLIST_EXT']) && strpos($cfg['BLACKLIST_EXT'], $extension) !== false) {
                  $uploadErrors[$j]['name'] = $_FILES['f']['name'][$i];
                  $uploadErrors[$j]['error'] = 'the file extension is not permitted.';
                  $j++;
                  $error = true;
              }
              else if (preg_match("=^[\\\\:*?<>|/]+$=", $_FILES['f']['name'][$i])) {
                  $uploadErrors[$j]['name'] = $_FILES['f']['name'][$i];
                  $uploadErrors[$j]['error'] = 'invalid symbols in the file name (\\/:*?<>|).';
                  $j++;
                  $error = true;
              }
              else if ($cfg['UPLOAD_ACTIVE'] && file_exists($cfg['UPLOAD_FOLDER'].'/'.$_FILES['f']['name'][$i])) {
                  $uploadErrors[$j]['name'] = $_FILES['f']['name'][$i];
                  $uploadErrors[$j]['error'] = 'the file already exist.';
                  $j++;
                  $error = true;
              }
              else {
				  if ($cfg['UPLOAD_ACTIVE']) {
                     move_uploaded_file($_FILES['f']['tmp_name'][$i], $cfg['UPLOAD_FOLDER'].'/'.$_FILES['f']['name'][$i]);	
				  }
                  $uploadedFiles[] = $_FILES['f']['name'][$i];
              }
          }
      }

      if ($error) {
          $errorMessage = 'following errors occured when sending the contact formular:'."\
";
          if (count($uploadErrors) > 0) {
              foreach ($uploadErrors as $err) {
                  $tmp .= '<strong>'.$err['name']."</strong><br/>\
- ".$err['error']."<br/><br/>\
";
              }
              $tmp = "<br/><br/>\
".$tmp;
          }
          $errorMessage .= $tmp.'';
          $fehler['upload'] = $errorMessage;
      }
  }


// if no error, an email will be sent
   if (!isset($fehler))
   {

// header of the email
   $recipient = "".$empfaenger.""; 
   $betreff = "".$_POST["subject"]."";
   $mailheaders = "From: \\"".stripslashes($_POST["name"])."\\" <".$_POST["email"].">\
";
   $mailheaders .= "Reply-To: <".$_POST["email"].">\
";
   $mailheaders .= "X-Mailer: PHP/" . phpversion() . "\
";


   $msg  = "The following has been sent by the contact form:\
" . "-------------------------------------------------------------------------\
\
";
   $msg .= "Name: " . $name . "\
";
   $msg .= "E-Mail: " . $email . "\
\
";
   $msg .= "street: " . $street . "\
";
   $msg .= "city: " . $city . "\
";
   $msg .= "for: " . $for . "\
";
   $msg .= "\
Subject: " . $subject . "\
";
   $msg .= "Message:\
" . $_POST['message'] = preg_replace("/\\r\\r|\\r\
|\
\\r|\
\
/","\
",$_POST['message']) . "\
\
";
   "-------------------------------------------------------------------------\
\
";
 if (count($uploadedFiles) > 0) {
	   if ($cfg['UPLOAD_ACTIVE']) {
       	   $msg .= 'The following files have been uploaded:'."\
";
	       foreach ($uploadedFiles as $file) {
	           $msg .= ' - '.$cfg['DOWNLOAD_URL'].'/'.$cfg['UPLOAD_FOLDER'].'/'.$file."\
";
	       }
	   } else {
		   $msg .= 'The following files have been attached:'."\
";
		   foreach ($uploadedFiles as $file) {
	           $msg .= ' - '.$file."\
";
	       }
	   }
   }
   $msg .= "\
\
IP address: " . $ip . "\
";
  
   


	if (!$cfg['UPLOAD_ACTIVE'] && count($uploadedFiles) > 0) {
		$attachments = array();
		for ($i = 0; $i < $cfg['NUM_ATTACHMENT_FIELDS']; $i++) {
		   	if ($_FILES['f']['name'][$i] == UPLOAD_ERR_NO_FILE) {
				continue;
			}
			$attachments[] = $_FILES['f']['tmp_name'][$i];
		}
		$boundary = md5(uniqid(rand(), true));
		$mailheaders .= "MIME-Version: 1.0\
";
		$mailheaders .= "Content-Transfer-Encoding: 8bit\
";
		$mailheaders .= "Content-Type: multipart/mixed;\
\	boundary=\\"".$boundary."\\"\
";
		$mailheaders .= "\
--".$boundary."\
";
		$mailheaders .= "Content-Type: text/plain;\
\	charset=\\"iso-8859-1\\"\
";
		$mailheaders .= "Content-Transfer-Encoding: 8bit\
";
		for ($i = 0; $i < count($uploadedFiles); $i++) {
			$file = fopen($attachments[$i],"r");
			$content = fread($file,filesize($attachments[$i]));
			fclose($file);
			$encodedfile = chunk_split(base64_encode($content));
			$msg .= "\
\
--".$boundary."\
";
			$msg .= "Content-Type: application/octet-stream;\
\	name=\\"".$uploadedFiles[$i]."\\"\
";
			$msg .= "Content-Transfer-Encoding: base64\
";
			$msg .= "Content-Disposition: attachment;\
\	filename=\\"".$uploadedFiles[$i]."\\"\
\
";
			$msg .= $encodedfile."\
\
";
		}
		$msg .= "\
\
--".$boundary."--";
	}


   $msg = strip_tags ($msg);

   
   $dsubject = "Your request"; // Subject of the message
   $dmailheaders = "From: ".$ihrname." <".$recipient.">\
";
   $dmailheaders .= "Reply-To: <".$recipient.">\
";
   $dmsg  = "Thank you very much for your e-mail. We will contact you soon.\
\
";
   $dmsg .= "Summary: \
" .
  "-------------------------------------------------------------------------\
\
";
   $dmsg .= "Name: " . $name . "\
";
   $dmsg .= "E-Mail: " . $email . "\
\
";
   $dmsg .= "street: " . $street . "\
";
   $dmsg .= "city: " . $city . "\
";
   $dmsg .= "for: " . $for . "\
";
   $dmsg .= "\
Subject: " . $subject . "\
";
   $dmsg .= "Message:\
" . str_replace("\\r", "", $message) . "\
\
";
   
   if (count($uploadedFiles) > 0) {
       $dmsg .= 'You have assigned the following files:'."\
";
       foreach ($uploadedFiles as $file) {
           $dmsg .= ' - '.$file."\
";
       }
   }
   
   $dmsg = strip_tags ($dmsg);


if (mail($recipient,$subject,$msg,$mailheaders)) {
mail($email, $dsubject, $dmsg, $dmailheaders);


echo "<META HTTP-EQUIV=\\"refresh\\" content=\\"0;URL=thankyou.php\\">";
exit;
 
}
}
}

?>


<div class="kontaktformular">
<form action="<?php $_SERVER['PHP_SELF'];?>" method="post" enctype="multipart/form-data">

<p><input style="width:0px; height:0px; visibility:hidden;" type="hidden" name="action" value="smail" /></p>
<p><input style="width:0px; height:0px; visibility:hidden;" type="hidden" name="content" value="formular"/></p>

<table style="width:500px">
<tr><td colspan="2"></td></tr>
<tr>
	<td style="width:150px"><strong>Your Name: <span class="pflichtfeld">*</span></strong></td>
	<td><?php if ($fehler["name"] != "") { echo $fehler["name"]; } ?><input name="name" type="text" value="<?php echo $_POST[name]; ?>" style="width:260px" maxlength="100" /></td>
</tr>

<tr>
	<td style="width:150px"><strong>E-Mail: <span class="pflichtfeld">*</span></strong><br /></td>
	<td><?php if ($fehler["email"] != "") { echo $fehler["email"]; } ?><input name="email" type="text" id="email" value="<?php echo $_POST[email]; ?>" style="width:260px" maxlength="100" /></td>
</tr>

<tr>
	<td style="width:150px"><strong>Street:</strong></td>

	<td><input name="street" type="text" value="<?php echo $_POST[street]; ?>" style="width:260px" maxlength="50" /></td>
</tr>

<tr>
	<td style="width:150px"><strong>City, State, Zip:</strong></td>

	<td><input name="city" type="text" value="<?php echo $_POST[city]; ?>" style="width:260px" maxlength="50" /></td>
</tr>


[B][COLOR="#FF0000"]<tr>
	<td style="width:150px"><strong>Information is for:<br />
	  (self, father, mother)	</strong></td>

	<td><input name="for" type="text" value="<?php echo $_POST[for]; ?>" style="width:260px" maxlength="50" /></td>
</tr>

[/COLOR][/B]

<tr>
	<td style="width:150px"><strong>Subject: <span class="pflichtfeld">*</span></strong></td>
	<td>
	
	<?php if ($fehler["subject"] != "") { echo $fehler["subject"]; } ?><input name="subject" type="text" value="
	<?php echo $_POST[subject]; ?>" style="width:260px" maxlength="50" /></td>
</tr>

<tr>
	<td style="width:150px"><strong>Message: <span class="pflichtfeld">*</span></strong></td>
	<td>
	
	<?php if ($fehler["message"] != "") { echo $fehler["message"]; } ?><textarea style="width:260px" name="message" cols="35" rows="10"><?php echo $_POST[message]; ?></textarea></td>
</tr>


<?php
      for ($i=0; $i < $cfg['NUM_ATTACHMENT_FIELDS']; $i++) {
          echo '<tr>';
		  echo '<td style="width:150px"><strong>Attachment:</strong></td>';
		  echo '<td><input type="file" style="width:268px" name="f[]" /></td>';
		  echo '</tr>';
      }
?>


<tr>
<td style="width:150px">&nbsp;</td>
	<td>&nbsp;</td>
</tr>
<tr>
<td style="width:150px"><strong>Security Code:</strong></td>
	<td><img src="contactform/captcha/captcha.php" alt="Security-Code" title="michatronic-sicherheitscode" id="captcha" /><br />
	<a href="javascript:void(0);" onclick="javascript:document.getElementById('captcha').src='contactform/captcha/captcha.php?'+Math.random();"><span class="neuercode">New Code?</span></a></td>
</tr>
<tr>
	<td style="width:150px"><strong>Please enter: <span class="pflichtfeld">*</span></strong></td>
	<td>
	
	<?php if ($fehler["captcha"] != "") { echo $fehler["captcha"]; } ?><input type="text" name="securitycode" maxlength="150" style="width:260px" value="" size="20" /></td>

</tr>

<tr>
	<td style="width:150px">&nbsp;</td>
	<td>&nbsp;</td>
</tr>
<tr>
	<td style="width:150px">&nbsp;</td>
	<td style="font-size:11px">Advice: Fields with <span class="pflichtfeld">*</span> have to be filled.</td>
</tr>
<tr>
	<td style="width:150px"></td>
	<td>   <input type="submit" name="mt-mk" value="Send" onclick="tescht();"/>
   <input type="submit" name="delete" value="Delete" />
	</td>
</tr>
</table><p style="font-size:11px"><!-- It´s not allowed to remove the copyright notice! -->
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>








</form> 

</div>




I see a few problems. You have modified the file contact_form.php (originally downloaded as contact.php).

In file contact_form.php

You have three unterminated IF statements as shown below:

if(!$street) {
 
 $fehler['street'] = '<font color=#cc3333>Please enter a <strong>street</strong>.<br /></font>';
 

if(!$city) {
 
 $fehler['city'] = '<font color=#cc3333>Please enter your <strong>city and zipcode</strong>.<br /></font>';
 

if(!$for) {
 
 $fehler['for'] = '<font color=#cc3333>Please enter who info is for <strong>(self, mother, father, etc.)</strong>.<br /></font>';
 

The most serious problem is you are using “for” as a variable and it is a reserved word. Change all instances of “$for” to something else.

Change all instances of “$_POST[“for”]” to something else. You also obviously need to change “for” in your form.

Thank you for that help. I went through and changed the word “for” to “info”. I uploaded the page and now the following error appears…

Parse error: syntax error, unexpected $end in /home/sitesb2/public_html/contactform/contact_form.php on line 446

webpage is at: http://www.sitesbysarah.com/contact2.php

It sounds as if you didn’t take care of the unterminated IF statements.

What does that mean??? Sorry, not a programmer.

“unterminated IF statements”

Thanks,
Sarahb

Here is what you have:

if(!$street) {
 
 $fehler['street'] = '<font color=#cc3333>Please enter a <strong>street</strong>.<br /></font>';
 

if(!$city) {
 
 $fehler['city'] = '<font color=#cc3333>Please enter your <strong>city and zipcode</strong>.<br /></font>';
 

if(!$for) {
 
 $fehler['info'] = '<font color=#cc3333>Please enter who info is for <strong>(self, mother, father, etc.)</strong>.<br /></font>';  

Here is how it should be:

if(!$street) {
 
 $fehler['street'] = '<font color=#cc3333>Please enter a <strong>street</strong>.<br /></font>';
} 

if(!$city) {
 
 $fehler['city'] = '<font color=#cc3333>Please enter your <strong>city and zipcode</strong>.<br /></font>';
} 

if(!$forxxx) {
 
 $fehler['info'] = '<font color=#cc3333>Please enter who info is for <strong>(self, mother, father, etc.)</strong>.<br /></font>';
} 

Notice the closing curly brace “}” at the end of each IF statement.

YOU ARE NOW MY MOST FAVORITE PERSON IN THE WORLD!!!

I put the little squiggle bars in and viola, my form actually appeared and I can view the page with no more error codes!! I could just sing.

Now though my “menu” include is displaying out of place. You wouldn’t have any idea why that is happening would you :-).

http://www.sitesbysarah.com/contact2.php

Sarahb

I’m glad to hear you are making progress. Since the remaining problems are most likely not PHP related but HTML and CSS related, I’ll let you work on that. My last comment on your page is:

You really need to look at the HTML on your page. You have four each of the following tags - <html>, </html>, <body>, </body> plus a few more. As you are hopefully aware, you are permitted one each only of these tags per page.

Yes, and you have no idea how long I’ve been toiling over this form. Will have to sleep on a board tonight to get the kinks out. Just seeing it appear on the page makes me giddy. I haven’t even checked if it works yet :-). One step at a time…

Initially the contract_form.php had extra body tags and html tags, but I removed those. You might have been looking at an old file. I just went back to double check. I looked through the contract_form.php and the contact2.php form and only found the single tags as should be.

I hope I didn’t miss anything…

Thanks again for your patience…

Sarahb

You shouldn’t look at just the individual files. You should look at the HTML output to your browser. Use the following steps:

  • Navigate to the contact2.php page.
  • View Page Source.
  • You will notice the extra tags spread throughout the page.

This is because most of your include files (/includes/menu_php.php as an example) have <body> tags in each file.