|
-
Jul 24th, 2007, 06:30 PM
#1
Thread Starter
New Member
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
Last edited by rscape; Jul 24th, 2007 at 06:33 PM.
-
Jul 25th, 2007, 01:12 AM
#2
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
Last edited by dclamp; Jul 25th, 2007 at 01:21 AM.
My usual boring signature: Something
-
Jul 25th, 2007, 01:48 AM
#3
Thread Starter
New Member
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.
-
Jul 25th, 2007, 07:28 AM
#4
Hyperactive Member
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...
-
Jul 25th, 2007, 02:07 PM
#5
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.
My usual boring signature: Something
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|