Page 1 of 1

where is this error coming from?

Posted: Mon Sep 19, 2005 8:07 pm
by bruceg
I started getting an error on my form. It must be a missing ; or quote somewhere, but I can't find it. Help please.

Code: Select all

<!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="en-US" lang="en-US" dir="ltr">
<head>
<meta http-equiv="Content-type" content="text/html; charset=ISO-8859-1" />
<title>Inspired Evolution :: Contact</title>
<meta http-equiv="pragma" content="no-cache" />
<meta name="revisit-after" content="7" />
<meta name="keywords" content="web design, communications, graphic design, North Carolina, Morrisville, Cary, Raleigh, Durham, creative, freelance, business, small business, creative services, web development, XHTML. CSS, accessibility, web standards, SEO, search engine optimization" />
<meta name="description" content="freelance web site design and development company specializing in creating unique, interesting, cross-browser friendly websites that conform to web standards, usability and accessibility and are SEO (search engine optimization) ready." />
<meta name="author" content="Bruce Gilbert" />
<meta name="robots" content="ALL" />
<meta name="classification" content="web site development" />
<meta name="copyright" content="2005 - Inspired-Evolution " />
<link rel="stylesheet" href="Gilbert.css" type="text/css" media="screen, handheld" />
</head>
<body>
<!-- begin outer wrapper div -->
<div id="wrapper_outer"> <a class="skiplink" href="#startcontent">Skip over navigation</a> 
  <!-- begin header div -->

<div id="header"><?php require ('rotate.php'); ?><?php showImage () ;?></div> 
  <!-- top nav list -->
  <div id="navcontainer"> 
    <ul id="navlist">
      <li ><a href="About_Me.php" title="you know you want to learn more about me">About 
        Me</a></li>
      <li><a href="Skillset.php" title="I've got skillz">Skill set</a></li>
      <li><a href="Hireme.php" title="I can do wonders for your web presence">Hire 
        Me</a></li>
      <li><a href="Portfolio.php" title="web sites, graphics, newsletters">Portfolio</a></li>
      <li id="active"><a href="Contact.php" id="current" title="how to get in touch with me">Contact</a></li>
      <li><a href="Resume.php"  title="my beautiful resume">R&eacute;sum&eacute;</a></li>
<li><a href="/bruce_blog/index.php"  title="daily musings on everyday life" >Blog</a></li>
      <li><a href="RSS.php"  title="Syndication that is really simple" >RSS</a></li>
    </ul>
  </div>
  <!-- inner content wrapper div -->
  <div id="wrapper_inner"> 
    <!-- breadcrumbs div -->
    <div id="breadcrumbs"><a href="index.php" title="home link" accesskey="1">Home</a> > > <a href="Contact.php" title="link back to Contact page">Contact</a> 
      > > Contact Form</div>
    <!-- text div -->
    <div id="main_content"> <a name="startcontent" id="startcontent"></a> 
      <h1 title="Contact Form">Contact Form</h1>
      <div id="form_holder">
      <?php
$form_block=<<<END_FORM
<form method="post" action="{$_SERVER['PHP_SELF']}" class="info_request">
<fieldset class="left">
<legend title="About You">About You</legend>

<p><label for="firstname"><span class="red">*</span> First Name: </label><br />

<input id="firstname" name="firstname" type="text" value="{$_POST['firstname']}" /></p>

<p><label for="lastname"><span class="red">*</span> Last Name:</label><br />

<input id="lastname" name="lastname" type="text" value="{$_POST['lastname']}" /></p>

<p><label for="company"><span class="red">*</span> Company: </label><br />

<input id="company" name="company" type="text" value="{$_POST['company']}" /></p>

<p><label for="phone"><span class="red">*</span> Phone: </label><br />

<input id="phone" name="phone" type="text" value="{$_POST['phone']}" /></p>

<p><label for="email"><span class="red">*</span> e-mail: </label><br />

<input id="email" name="email" type="text" value="{$_POST['email']}" /></p>

<p><label for="email2"><span class="red">*</span> re-enter e-mail: </label><br />

<input id="email2" name="email2" type="text" value="{$_POST['email2']}" /></p>
</fieldset>
<fieldset>
<legend title="More Info.">More Info.</legend>
<p><label for="URL"><span class="red">*</span>  URL:</label><br />

<input id="URL" type="text" name="URL" value="{$_POST['URL']}"/> </p>

<p><label for="Contact_Preference"><span class="red">*</span>  Best way to reach:</label><br />

<select name="Contact_Preference" id="Contact_Preference">
<option value="email">email</option>
<option value="phone">phone</option>
<option value="snail_mail">snail mail</option>

</select>
</p>

<p><label for="Contact_Time"><span class="red">*</span>  Best time to contact:</label><br />

<select name="Contact_Time" id="Contact_Time">

<option value="morning">morning</option>
<option value="evening">evening</option>
<option value="anytime">anytime</option>

</select></p>

<input type="hidden" name="op" value="ds" />

<textarea name="message" id="message" rows="" cols="" >Send us a detailed message specifying what you wish to accomplish with your web site. </textarea>
<input class="submit" src="/images/submit.gif" alt="Submit" type="image" name="submit"  /> 

</fieldset>
</form>
</div>
<p><span class="red">*</span> indicates a required field (all fields are required).</p>
END_FORM;
if ($_POST['op']!='ds') { 
    echo "$form_block";
    } else if ($_POST["op"]  == "ds")  {

//Function saves time and space by eliminating unneccesary code
    $first_name_err = '<span class="red">Please enter your first name!</span><br />'; 
} 
 
    $last_name_err = '<span class="red">Please enter your last name!</span><br />'; 
} 
function check($fieldname)
	{
	global $err_msg;
	if($_POST[$fieldname] == "")

		if ( !isset($err_msg)) { $err_msg = "<span class='red'>You haven't entered your ".$fieldname."!</span><br />"; }
		elseif ( isset($err_msg)) { $err_msg .="\n<span class='red'>You haven't entered your ".$fieldname."!</span><br />"; }
		}
	return $err_msg;
	}

//////////////////////////
///Function execution/////
//////////////////////////

check('firstname');
check('lastname');
check('company');
check('phone');
check('email');
check('email2');
check('URL');
check('Contact_Preference');
check('Contact_Time');
check('message');  

//Validating Email Address
if ($_POST['email'] != $_POST['email2']) { $email_err = "\n<span class='red'>e-mail address fields do not match!</span>"; }

if (isset($err_msg) || isset($email_err)) { echo $err_msg.$email_err."\n\n".$form_block; }
else {
  //it's ok to send, so build the mail
        $msg = "E-mail sent from http://www.inspired-evolution.com\n";
        $msg .="Sender's first name:        {$_POST['firstname']}\n";
        $msg .="Sender's last name:        {$_POST['lastname']}\n";
        $msg .="Company name:        {$_POST['company']}\n";
        $msg .="Senders Phone number:        {$_POST['phone']}\n";
        $msg .="Senders email address:        {$_POST['email']}\n";
        $msg .="Senders email address (re-typed):        {$_POST['email2']}\n";
        $msg .="The website is :        {$_POST['URL']}\n";
        $msg .="I prefer to be contacted via: {$_POST['Contact_Preference']}\n";
        $msg .="The Best time to contact is: {$_POST['Contact_Time']}\n";
        $msg .="Message:        {$_POST['message']}\n\n";
        $to ="webguync@gmail.com";
        $subject ="There has been a disturbance in the force";
        $mailheaders ="From: Inspired-Evolution.com
        <http://www.inspired-evolution.com>\n";
        $mailheaders .="Reply-To: {$_POST['email']}\n";
        //send the mail
        mail ($to, $subject, $msg, $mailheaders);
        //display information to user
  echo "<p>Hola, <strong>$firstname</strong>!.<br /><br />
We have received your request for a web site review , and will respond shortly.<br />
Thanks for visiting inspired-evolution.com and have a wonderful day!<br /><br />
Regards,<br /><br />
<strong>Inspired Evolution</strong></p>";
}

}
?>
      
      <p></p>
      <p></p>
      <?php require('includes/bottom_links.inc'); ?>
    </div>
    <!-- begin footer -->
    <div id="footer"> 
      <p class="footertag">Inspired-Evolution - Web Site: Design, Development, 
        Marketing for Raleigh/Durham, Chapel Hill, Cary North Carolina.</p>
      <?php require('includes/footer.inc'); ?>
      <span class="date">
      <?
$last_modified = filemtime("index.php");
print("Last Modified ");
print(date("m/j/y h:i", $last_modified));
?>

      </span> </div>
  </div>
</div>
</body>
</html>
error is:

'
Parse error: parse error, unexpected T_VARIABLE in /hsphere/local/home/bruceg/inspired-evolution.com/Contact_Form.php on line 117'

thanks,

Posted: Mon Sep 19, 2005 8:15 pm
by sheila
I'm gonna take a wild guess and say that this is line #117

Code: Select all

END_FORM;if ($_POST['op']!='ds') {
try it this way

Code: Select all

END_FORM;
if ($_POST['op']!='ds') {
END_FORM; needs to be on the line by itself.

Posted: Mon Sep 19, 2005 8:25 pm
by feyd
may want to fix your From header in the mail stuff too.. shouldn't have a carriage return in the middle of the string (i.e. ignore the \n at the end, it's the one before the <> junk..)