-
Text doesn't echo..
PHP Code:
<?
if($word_ok!==false)
{
if($word_ok=="yes")
{
$to=$_POST['to'];
$subject=$_POST['subject'];
$body=$_POST['body'];
$from=$_POST['from'];
$headers = "From: $from" . "\r\n" .
'MIME-Version: 1.0' . "\r\n" .
'Content-type: text/html; charset=iso-8859-1' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
//mail($to,$subject,$body,$headers);
if (@mail ($to, $subject, $body, $headers)) {
echo "Email successfully sent to $to.";
echo "<Br>Click <a href='mail.php'>here</a> to send another.<br />";
} else {
echo "Error sending email!";
}
} else {
echo "The word you entered for the image verification did not match what was displayed.<br />";
}
}
?>
Thats part of my email script, when I click the submit button none of that echos on the page, is there anything wrong with this script?
If you want rest of the script then I'm using freeCap PHP CAPTCHA Version 1.4.1
-
Re: Text doesn't echo..
add this to the end:
PHP Code:
else
{
echo "word_ok is equal to true";
}
because $word_ok might be equal to true ;)
-
Re: Text doesn't echo..
I've put that part in outside of the ifs and it shows, heres the new code:
PHP Code:
<?
$to=$_POST['to'];
$subject=$_POST['subject'];
$body=$_POST['body'];
$from=$_POST['from'];
$headers = "From: $from" . "\r\n" .
'MIME-Version: 1.0' . "\r\n" .
'Content-type: text/html; charset=iso-8859-1' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
if($word_ok!==false)
{
if($word_ok=="yes")
{
//mail($to,$subject,$body,$headers);
if (@mail ($to, $subject, $body, $headers)) {
echo "Email successfully sent to $to.";
} else {
echo "Error sending email!";
}
} else {
echo "The word you entered for the image verification did not match what was displayed.<br />";
}
}
echo "word_ok is equal to $word_ok";
?>
It echos out "word_ok is equal to" so it equals nothing.
-
Re: Text doesn't echo..
I am stating the obivious here, but since $word_ok evaluates to nothing, set the variable to the proper value...
-
Re: Text doesn't echo..
yes as sb said, it is set to the wrong value, and it is not going sending the email. put this right before your code:
PHP Code:
$word_ok = "no";
that should make it work.