I am trying to get my php function in to my html page and I am having an issue. Can someone look at the code and help me figure out what I am doing wrong. This is the first time I have tried this. It dose work but I get this showing on the page:
Warning: session_start() [
function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home1/medieva3/public_html/captcha.php:8) in
/home1/medieva3/public_html/captcha.php on line
40
Here is the code for the page and thanks for the help:
<!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" lang="en" xml:lang="en">
<head>
<title>Force of Nature - Home</title>
<link rel="shortcut icon" href="" />
<meta name="keywords" content="" />
<meta name="description" content="Force of Nature - Home" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="Author" content="FON" />
<meta name="Copyright" content="© Copyright 2008 Force of Nature" />
<meta name="Owner" content="Force of Nature" />
<meta name="robots" content="index, follow" />
<meta name="revisit-after" content="1 days" />
<meta name="distribution" content="global" />
<meta name="rating" content="general" />
<meta name="Content-Language" content="english" />
<meta name="verify-v1" content="mh3MtF3WPBMHxTRUtwCSrUowPEfGt9HeCu8xEb94B 0A=" />
<link rel="stylesheet" type="text/css" href="styles.css"/>
</head>
<body>
<div><img src="images/Header.png" alt="Force of Nature Multimedia" width="900" height="156" /></div>
<br /><br />
<table align="center" id="nav">
<tr>
<td><a href="index.html">Home</a></td>
<td><a href="samples.html">Samples</a></td>
<td><a href="about.html">Bio</a></td>
<td><a href="contact.html">Contact</a></td>
</tr>
</table>
<div align="center"><br />
<br />
<table id="cont" width="689">
<tr>
<td height="92">
<?
session_start();
// *** We need to make sure theyre coming from a posted form -
// If not, quit now ***
if ($_SERVER["REQUEST_METHOD"] <> "POST")
die("You can only reach this page by posting from the html form");
// *** The text input will come in through the variable $_POST["captcha_input"],
// while the correct answer is stored in the cookie $_COOKIE["pass"] ***
if ($_POST["captcha_input"] == $_SESSION["pass"])
{
// *** They passed the test! ***
// *** This is where you would post a comment to your database, etc ***
echo "Correct! You have passed the captcha test. <br><br>";
echo "You information input has been sent <br><br>";
echo "This is what you sent <br><br>";
echo "Your Name: \"" . $_POST["name"] . "\" <br>";
echo "Your email: \"" . $_POST["email"] . "\" <br>";
echo "Your Comments: \"" . $_POST["comments"] . "\" <br>";
//sends email via php to the following address
$your_email = "
information@fonmultimedia.ca";
//echo 'default chosen address: '.$mailuser;
$header = "Return-Path: ".$your_email."\r\n";
$header .= "From: Contact Us <".$your_email.">\r\n";
$header .= "Content-Type: text/html;";
$mail_body = '
Your Name: '. $_POST[name] . '<br>
Your email: '. $_POST[email] . '<br>
Your Comments: '. $_POST[comments] . '<br>'
;
mail ($your_email, 'Form sent', $mail_body, $header);
echo 'THANKS ';
} else {
// *** The input text did not match the stored text, so they failed ***
// *** You would probably not want to include the correct answer, but
// unless someone is trying on purpose to circumvent you specifically,
// its not a big deal. If someone is trying to circumvent you, then
// you should probably use a more secure way besides storing the
// info in a cookie that always has the same name!

***
echo "Sorry, you did not pass the CAPTCHA test.<br><br>";
echo "You said " . $_POST["captcha_input"];
echo " while the correct answer was " . $_SESSION["pass"];
echo " - Please click back in your browser and try again <br><br>";
}
?>
<br /><br />
Click <a href="index.html" >Here</a> to return to main page.
</td>
</tr>
</table>
<br /><br />
</div>
<table align="center" border="0">
<tr>
<td height="26"><a href="index.html">Home</a></td>
<td><a href="samples.html">Samples</a></td>
<td><a href="about.html">Bio</a></td>
<td><a href="contact.html">Contact</a></td>
<td><a href="site-map.html">Site Map</a></td>
</tr>
</table>
<div align="left" ><a href="
http://www.linkreferral.com/adwel.pl...d=216680"><img src="
http://www.linkreferral.com/images/l...linkbutton.gif" border="0" alt="Creative and Out-of-the-Ordanary Website and Graphic design" width="130" height="32" /></a>
</div>
</body>
</html>