captcha problem
HejsaJeg håber der er nogle af jer der er mere vågen end jeg er, jeg sidder i Arusha, Tanzania og kan ikke få følgende script til at virke, har i en ide til hvad der er galt.
Vær opmærksom på at selve formen virker, men jeg kan ikke få Capthca til at virke.
FORM:
<?php
session_start();
if (!empty($_POST)) {
extract($_POST);
} else if (!empty($HTTP_POST_VARS)) {
extract($HTTP_POST_VARS);
}
if (!empty($_GET)) {
extract($_GET);
} else if (!empty($HTTP_GET_VARS)) {
extract($HTTP_GET_VARS);
}
include_once ("Adminbht/dcon.php");
$resultPageText = mysql_query("SELECT * from TextAdmin WHERE id = '19'");
$rowPageText = mysql_fetch_array($resultPageText);
include_once ("head.php");
echo "<h1>".$rowPageText['TextPage']."</h1>";
echo $rowPageText['TextContent'];
?>
<div align="left">
<FORM action="submit.php" method=post>
<H4>Your Details</H4>
<TABLE width="100%" cellpadding="0" cellspacing="0">
<TR>
<Th>Title</Th>
<TD colSpan=2>
<INPUT type="radio" value="Mr" name="title"> Mr <INPUT type="radio" value="Mrs" name="title"> Mrs <INPUT type="radio" value="Miss" name="title"> Miss <INPUT type="radio" value="Other" name="title"> Other. If other: <INPUT size="8" name="if_other">
</TD>
</TR>
<TR>
<Th>Your name</Th>
<TD colSpan=2>First Name: <INPUT name="first_name"> Last Name: <INPUT name="last_name"></TD>
</TR>
<TR>
<TD></TD><TD>Email Address: </TD><TD><INPUT name="email"></TD>
</TR>
</TABLE>
<H4>Your Holiday</H4>
<TABLE width="100%" cellpadding="4" cellspacing="0" border="0">
<TR>
<th>Where did you hear about us?</th>
<TD colSpan="2">
<INPUT type="radio" value="yahoo" name="referrer"> Yahoo Search<br />
<INPUT type="radio" value="google" name="referrer"> Google Search<br />
<INPUT type="radio" value="nationals" name="referrer"> National Newspapers<br />
<INPUT type="radio" value="websites" name="referrer"> Travel Websites<br />
<INPUT type="radio" value="magazines" name="referrer"> Magazines<br />
<INPUT type="radio" value="other-referrer" name="referrer"> Other<br />
<INPUT type="radio" value="dontknow" name="referrer"> Don't Know</TD>
</TR>
<TR>
<th>Would you like to receive details of special offers?</th>
<TD colSpan="2"><INPUT type="radio" value="Yes" name="offers"> Yes <INPUT type="radio" value="No" name="offers"> No </TD>
</TR>
<TR>
<TD></TD>
<TD colSpan="2">
<img src="captcha_img.php?<?=session_name()?>=<?=session_id()?>" border="0"><br />
<input type="text" name="capt" style="width: 80px">
</TD>
</TR>
<TR>
<TD></TD><TD colSpan="2"><INPUT type="submit" value="Submit"></TD>
</TR>
</TABLE>
</FORM>
</div>
<?php include_once("footer.php"); ?>
-----------------------------------------------------------------
SUBMIT.PHP
<?php
session_start();
if (!empty($_POST)) {
extract($_POST);
} else if (!empty($HTTP_POST_VARS)) {
extract($HTTP_POST_VARS);
}
if (!empty($_GET)) {
extract($_GET);
} else if (!empty($HTTP_GET_VARS)) {
extract($HTTP_GET_VARS);
}
include_once ("Adminbht/dcon.php");
include_once ("head.php");
if($capt->check_result())
{
echo "<h5>You have sent the enquiry form to us, and we will come back to you as soon as possible.</h5>";
/* recipients */
$to = $_REQUEST['email'];
/* subject */
$subject = "enquiry form";
/* message */
$message = '
<html>
<head>
<title>Enquiry form</title>
</head>
<body>
<p>Thank you for your enquiry.!</p>
<table width=\"100%\">
<tr>
<td valign=\"top\">Title & Name:</td>
<td>'.$_REQUEST['title'].'. '.$_REQUEST['first_name'].' '.$_REQUEST['last_name'].'</td>
<tr>
<td valign=\"top\">Mobile & email:</td>
<td>Mobile: '.$_REQUEST['mobile'].', Mail: '.$_REQUEST['email'].'</td>
<tr>
</table>
';
/* To send HTML mail, you can set the Content-type header. */
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: enquiry <enquiry@.com>\n";
/* and now mail it */
mail($to, $subject, $message, $headers);
mail('enquiry@.com', $subject, $message, $headers);
}
else
{
echo 'Please enter valid captcha code from the image.<br />Thank you!';
}
include_once("footer.php"); ?>