Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Need urgent help. Can't figure out what is wrong.
Old 12-07-2010, 10:58 AM Need urgent help. Can't figure out what is wrong.
Fenwolf's Avatar
Skilled Talker

Posts: 54
Name: James
Trades: 0
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>
Fenwolf is offline
Reply With Quote
View Public Profile Visit Fenwolf's homepage!
 
 
Register now for full access!
Old 12-07-2010, 11:00 AM Re: Need urgent help. Can't figure out what is wrong.
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
You can't start a session once output has been sent to the user agent.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-07-2010, 11:03 AM Re: Need urgent help. Can't figure out what is wrong.
Fenwolf's Avatar
Skilled Talker

Posts: 54
Name: James
Trades: 0
so how do i fix this so it work the way i want it to. thanks for the help.
Fenwolf is offline
Reply With Quote
View Public Profile Visit Fenwolf's homepage!
 
Old 12-07-2010, 11:41 AM Re: Need urgent help. Can't figure out what is wrong.
Fenwolf's Avatar
Skilled Talker

Posts: 54
Name: James
Trades: 0
figured it out. thanks for the help.
Fenwolf is offline
Reply With Quote
View Public Profile Visit Fenwolf's homepage!
 
Reply     « Reply to Need urgent help. Can't figure out what is wrong.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.66233 seconds with 12 queries