Hello everybody!
I'm new with php and heavily rely on my books.
I usually manage to see my errors but i'm stuck at this one,
I get this error:
Parse error: parse error, unexpected $ in /usr/local/.../customer_service.php3 on line 47
but line 47 is </html> !? and where is unexpected $
thank you for your help.
<html>
<head>
<title>Customer Service Form</title>
</head>
<body>
<img src="logo.jpg" border="0">
<body bgcolor="#FFFFFF">
<?php
if(isset($submit)):
if($type=="comment"):
$file="comments.html";
elseif($type=="suggestion"):
$file="suggestions.html";
else:
$file="complaints.html";
endif;
if(!$open_file=fopen($file,"a")):
print("Error! File can't be opened!");
else:
$date=date("m d, Y");
$comments="Feedback from $name, $email on $date\n\nThe feedback is:\n$feedback\n";
fwrite($open_file,"<pre>$comments</pre><hr>");
fclose($open_file);
$company_to="me@domain.com";
$subject1="Feedback from the website!";
$subject2="Thanks for your feedback!";
$body="thanks for your recent feedback\nOur customer service department is looking over your matter and should get back to you shortly.\n";
$body.="\n\nCustomer Service Department";
mail($company_to,$subject1,$comments);
mail($email,$subject,$body);
?>
<h2>Contact Us!</h2>
<form action="customer_service.php3" method="POST">
<input type="radio" name="type" value="comment"> Comment on our site and services.
<br><input type="radio" name="type" value="suggestion"> Suggest Improvements.
<br><input type="radio" name="type" value="complaints"> File a complaint with Customer Service.
<br><p>Please Enter Your Feedback:
<br><textarea name="feedback" cols="40" rows="10"></textarea>
<p>Name: <input type="text" name="name">
<br>E-Mail: <input type="text" name="email">
<p><input typw="submit" name"submit" value="submit"><input type="reset">
</form>
<?
endif;
?>
</body>
</html>