Location: PHPKode > scripts > feedback.class.php > feedback-class-php/feedback.class.php
<?
class feedback{

	function displayquestions(){
		echo '<center>
		<TABLE border=0>
		<form action="feed.php" METHOD="post">
			<TR>
		<TD>
		<font face=arial size=3 color=green><b>
		Answer 4 easy questions that will help us<BR> improve our products/services:</b><BR></font>
		<BR>
		
		<TABLE border=0>
		<TR><TD><font face=arial size=2 color=red><b><font size=3 color=black>1.</font> What do you like most about our products/services?</b></font></TD></TR>
		
		<TR><TD><input type="text" size="40" name="like"></TD></TR>
		<TR><TD><font face=arial size=2 color=red><b><font size=3 color=black>2.</font> What do you dislike about our products/services?</b></font></TD></TR>
		<TR><TD><input type="text" size="40" name="dislike"></TD></TR>
		<TR><TD><font face=arial size=2 color=red><b><font size=3 color=black>3.</font> What feature would you like to see?</b></font></TD></TR>
		<TR><TD><input type="text" size="40" name="newfeature"></TD></TR>
		<TR><TD><font face=arial size=2 color=red><b><font size=3 color=black>4.</font> What feature can we improve?</b></font></TD></TR>
		<TR><TD><input type="text" size="40" name="improve"></TD></TR>
		<input type="hidden"  name="send" value="send">
		<TR><TD><center><font size=3 color=black>
		<input type="submit" value=" submit feedback "></TD></TR>
		</TABLE>
		
		</TD>
		</TR>
		</form>
		</TABLE>
		</center>';
	}
	
	function sendanswers($like, $dislike, $newfeature, $improve){
		echo'<font face=arial size=4 color=green><b>
		Your feedback has been sent.<BR>
		Thank you!<BR>';
	
	
		$this->sendmail("hide@address.com","hide@address.com","feedback","\n
		LIKE: $like \n
		DISLIKE: $dislike \n
		NEW FEATURE: $newfeature \n
		IMPROVE FEATURE: $improve \n","TEXT");

	}

	function sendmail($from,$to,$sub,$mes,$type) {
		switch ($type) {
		case 'html':$h='text/html';break;
		case "text":$h="text/plain";break;
		default:$h="text/plain";break;}
		$head="MIME-Version: 1.0\r\nContent-Type: ".$h."; charset=".C_CHARSET."\r\nFrom: ".$from."\r\nReply-To: ".$from."\r\nX-Mailer: ".C_SNAME;
		mail($to,$sub,$mes,$head);
		echo "<!-- mail sent -->";
	}

}
?>
Return current item: feedback.class.php