Jump to content

pixelchicken

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

pixelchicken's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi all, I have found a thread that relates to my query but I'm a novice so it doesn't make any sense.. Basically, I have just implemented captcha on my site (php code below) and it's all working yey! All I need to do, is to alert the user if they enter an incorrect code, and *stay on the same page*. I have the alert working fine in Javascript, but it then takes the user to a blank page. I want to alert them (*you've entered a wrong code*) and then stay on the same page. Simple enough right? Any ideas grately appriciated! Code: <?php require_once('captcha/recaptchalib.php'); $privatekey = "6Lcil78SAAAAALYbGUXf2ophiajdWJuPho7A63La"; $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); if (!$resp->is_valid) { // What happens when the CAPTCHA was entered incorrectly ?> <script language="javascript"> alert("Verification words do not match image. Please try again."); </script> <? // **** NEED CODE HERE TO STAY ON SAME PAGE **** header( "Location: contact.php" ); } else { // Code here to handle a successful verification $to = "me@me.com"; $subject = "Contact / Booking Form from the Trevalia Website"; $name = $_REQUEST['name']; $email_field = $_POST['email']; $phone = $_POST['phone']; $comments = $_POST['comments']; *******"; $body = "From: $name \n\n E-Mail: $email_field\n\n Phone Number: $phone\n\n Message:\n $comments"; header( "Location: thankyou_contact.html" ); mail($to, $subject, $body, $headers); } ?>
  2. I just took out the following code: $headers = "From: $name via booking website"; And it only bloody worked! I don't really understand why, but it's now coming through into my client's e-mail address. greatstar00, you truly are a great star. You've really saved me here, thanks mate
  3. Hi greatstar00, I think I know what you mean. Could you please give me an example of the code I should use for the header then? Or do I just not specify it? I am recieveing the emails in hotmail and my other webmail accoutn so I'm not sure if this is the problem?? Thanks...
  4. Thanks guys. Well, the code I am using is below. I don't understand though, as I am recieving the email in my hotmail account just fine. It just doens't seem to be getting through to my client's email. Any further advice very gratefully accepted - I'm a bit lost! Thanks guys.. <?php if(isset($_POST['submit'])) { $to = "CLIENT_EMAIL_HERE"; $subject = "Contact / Booking Form from booking Website"; $name = $_REQUEST['name']; $email_field = $_POST['email']; $phone = $_POST['phone']; $comments = $_POST['comments']; $headers = "From: $name via booking website"; $body = "From: $name \n\n E-Mail: $email_field\n\n Phone Number: $phone\n\n Message:\n $comments\n"; header( "Location: thankyou_contact.html" ); mail($to, $subject, $body, $headers); } else { echo "Unexpected error. Please contact your website host"; } ?>
  5. Hi guys, I've been struggling with this for a while and had no luck. I've created a very simple php form for my client and it's sending the results to a hotmail account no worries. My client's e-mail is with activ8 and they are not recieveing a single e-mail from the PHP form. I understand I can 'whitelist' an e-mail address in my client's e-mail account. My question is: a) if this is the solution, which address do I whitelist? As it's coming from a PHP form and not an e-mail address as such, I'm not sure how to tackle this. b) if this is not the solution, what else should I try? Thanks so much for your help guys, I really appriciate it PXLCKN
  6. Hi guys, I'm a real newbie to PHP and have managed to put together a simple mail form that sends me an email when someone fills it in on my site. The problem I am having, is that sometimes when I test it, it goes directly into my junk folder. Other times, into my inbox. Is there a way, in PHP, that I can guarantee that mail sent from that form with always, without fail, end up in my inbox? Nb I don't want to 'whitelist' the address sent from the form as I may be switching e-mail clients soon. Many thanks guys, this has got my stumped and I'd really appriciate your help!! Cheers Liz
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.