Batyr

Members
  • Content count

    6
  • Joined

  • Last visited

Community Reputation

1 Neutral

About Batyr

  • Rank
    Newbie
  1. Yeah I put the tick and went through all of its procedures one by one. Still no luck. I have tried it almost 100 times, still nothing. Here is my _contact-controller.php code //here we check whether the 'name' field exists inside post variables (which means the form is posted) if ($input->post->name) { //if fields validation passes if ($v->validate()) { $reCaptcha = new \ReCaptcha\ReCaptcha($googleSecretKey); $resp = $reCaptcha->verify($input->post->{'g-recaptcha-response'}, $_SERVER["REMOTE_ADDR"]); //if google-recaptcha validation passes if ($resp->isSuccess()) { //This is the HTML message $message = ' <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Contact Form | ' . $input->post->name . '</title> </head> <body> <p>' . $input->post->message . '</p> </body> </html>'; //here we send the form to $contactFormRecipient wireMail($contactFormRecipient, $input->post->email, "Contact Form | " . $input->post->name, $message); //here we set a flash-message to notify the user that the form was successfully sent $session->flashMessage = 'Thank you for your message! We will get in touch with you shortly.'; //save in session that the form is sent $session->sent = true; //finally redirect user to contact-page $session->redirect($pages->get($contactPageID)->url); } else { //self explain $session->flashMessage = 'Error while validating you are not a robot!'; } } } ?>
  2. Thank you @SamC for the great help. Now it seems that when I enter all the information I get an error from Google ReCaptcha. Whenever I enter all the right credentials it throws me "Error while validating you are not a robot!" I tried to re-entering the information so many times but no luck.
  3. Hi @SamC Thank you for your help, I put namespace Processwire on both, contact.php and _contact-controller.php it all worked. I just had some design problems thus my page won't load properly. I guess I have to take more attention to frontend as well Thank you again!
  4. Hi @SamC thank you for your reply. I just have it on my header.php file. Here is the 49th line <div class="form-group <?php echo $v->errors('name') ? 'has-error' : '';?>">
  5. I always get call to a member function errors(), on a non-object. Cannot solve it. Any help appreciated
  6. Hi @giannisok Thank you for the tutorial, I have one problem which I got stuck for couple of days and cannot solve: When I run my contact page, I get this I can't seem to get it work, I used many tactics and followed your code line by line, but couldn't find any solution. I would be glad if you give me a hand on this. Below is my code of contact.php file: