PDA

View Full Version : PHP captcha FireFox GREAT! IE nothing...


kona72
05-31-2007, 02:53 PM
Hey All,

I am soooo frustrated with IE.
I have a captcha form I have started to use and i am have some serious issues with it. In FireFox it works just fine... BUT when used with IE it just sit's there.... NOTHING!!!!

I could really use a hand with this one...

Here is source code....


<!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">
<head>
<title>Carly Henry==-----</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="css/carly.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="outer">
<?php include("header.php"); ?>
<div id = "navigation"><?php include("nav.php"); ?></div>
<div id="right"><?php include("upcoming.php"); ?></div>
<div id ="main">
<p>&nbsp;</p>
<p><img src="images/inquiries.jpg" alt="Inquiries" /></p>
<p><form action="inquiries.php" method="post" name="inquiries" id="inquiries">
<?php


$to = "curtis@trafick.net,$email";
$email = $_POST['email'];

if (!isset($_POST['submit'])) {

showForm();

} else { //form submitted

$error = 0;


if(empty($_POST['name'])) {
$error = 1;
$errstr[] = "Please enter your name";
}

if(empty($_POST['phone'])) {
$error = 1;
$errstr[] = "Please enter your phone number";
}

if(empty($_POST['message'])) {
$error = 1;
$errstr[] = "Please enter a message";
}

if(!preg_match("/^(?:[\w\d]+\.?)+@(?:(?:[\w\d]\-?)+\.)+\w{2,4}$/", $_POST['email'])) {
$error = 1;
$errstr[] = "Please enter a valid email address";
}

if(empty($_POST['imagetext'])) {
$error = 1;
$errstr[] = "Please validate the image code";
} else {
include "securimage.php";
$img = new securimage();
$valid = $img->check($_POST['imagetext']);

if(!$valid) {
$error = 1;
$errstr[] = "The code you entered was incorrect";
}
}

if ($error == 1) {
echo "<center>\n<font style=\"color: #CC3300\">\n";
foreach($errstr as $err) {
echo "<li> " . $err . "</li>\n";
}
echo "</font>\n</center>\n<br />\n\n";

showForm();

} else {
@mail("$to,$email", "CarlyHenry.com Email Message: " . $_POST['name'],
"Email received from " . $_POST['name'] . " \n
Email Address : ". $_POST['email'] . "
Phone Number : ". $_POST['phone'] . "
Message : " . $_POST[message]
, "From: " . $_POST['email']);

echo "<p><left>\n<h3>Email Sent</h3>
Thank you for the Email.<br /><br />
You will receive a copy of this email<br />
at the email address you specified.<br><br />
If your email requires a response, <br />
we will get back to you as soon as we can.</p>";
}

} //else submitted



function showForm()
{
$_POST['message'] = @htmlspecialchars(@$_POST['message']);

echo <<<EOD
<form method="POST">

<p><input name="name" type="text" id="name" value="{$_POST['name']}" />*Name</p>

<p><input type="text" name="email" value="{$_POST['email']}" />*Email Address</p>

<p><input name="phone" type="text" id="location" value="{$_POST['phone']}" />*Phone Number</p>

<p>*Message<br/><textarea name="message" cols="40" rows="4">{$_POST['message']}</textarea></p>
<p><img src="securimage_show.php"></p>
<p><input type="text" name="imagetext" /></p>

<p>For security reasons, please enter the text above<br>All fields are required</p>

<p> <input type="submit" name="Submit" value="Submit" /></p>

</form>
EOD;
}

?>
</form></p>
</div>

<div id="clearfooter"></div>
<div id="footer"><img src="images/carly_11.jpg" alt="Carly Henry" width="765" height="71" border="0" /></div>
</div>
</body>
</html>



Here is the live page... you can try it is you like... it comes to my email address right now so no worries...

http://www.carlyhenry.com/inquiries.php

Thanks SO much in advance

domedia
05-31-2007, 03:33 PM
Couldn't get a success message in FF either..

kona72
05-31-2007, 03:51 PM
Hi Dom,

Thanks for the quick reply... I was doing some other testing....

I have it fixed now...

added a flag


<input name="flag" type="hidden" value="1" />


and checked against it...


if (!isset($_POST['flag']))