contact form problem

eCommerce WordPress theme to create online shop with WooCommerce support
GK User
Thu Oct 13, 2016 10:59 am
contact form does not work after you click send to return a blank page
http://mtd-przyczepy.pl/kontakt/
User avatar
Senior Boarder

GK User
Thu Oct 13, 2016 1:05 pm
I noticed that the problem lies in php 7, I would still use PHP 7
User avatar
Senior Boarder

Joshua M
Thu Oct 13, 2016 8:06 pm
Hello,

Did you notice any error/warning message?
User avatar
Moderator

GK User
Fri Oct 14, 2016 3:26 pm
Please check the link, there is no error, a blank page. After the change of php 7.0 to 5.6 everything works ok. But this is not a solution because I would like to stay on php 7.0
User avatar
Senior Boarder

GK User
Sun Oct 16, 2016 10:34 pm
I have the same problem. Quark template and php 7.0. Do you have any solution for this?
User avatar
Junior Boarder

Joshua M
Mon Oct 17, 2016 9:27 am
Hi,

Try to edit template.contact.php file and change the following fragment:
Code: Select all
   // check the e-mail
   if($params_email) {
      if(trim($_POST['email']) === '' || !eregi("^[A-Z0-9._%-][email protected][A-Z0-9._%-]+\.[A-Z]{2,4}$", trim($_POST['email']))) {
         $validated = false;
         $errors['email'] = __('please enter correct email address.', GKTPLNAME);
      } else {
         $output['email'] = trim($_POST['email']);
      }
   }

into:
Code: Select all
   // check the e-mail
   if($params_email) {
      $regex = '/([a-z0-9_]+|[a-z0-9_]+\.[a-z0-9_]+)@(([a-z0-9]|[a-z0-9]+\.[a-z0-9]+)+\.([a-z]{2,4}))/i';
      if(trim($_POST['email']) === '' || !preg_match($regex, trim($_POST['email']))) {
         $validated = false;
         $errors['email'] = __('please enter correct email address.', GKTPLNAME);
      } else {
         $output['email'] = trim($_POST['email']);
      }
   }
User avatar
Moderator

GK User
Mon Oct 17, 2016 12:01 pm
ok everything works ok, thank you. I would like to ask where where edit the template email sent from a form, and how to add more recipients Message
User avatar
Senior Boarder

Joshua M
Tue Oct 18, 2016 8:37 am
Hello, I don't understand - the mail is sent from mail (name) typed in the contact form. (destination mail address may be changed from Template options -> Pages tab -> "Contact e-mail" option.
User avatar
Moderator

GK User
Tue Oct 18, 2016 8:54 am
yes I know, but as more addresses, [email protected], [email protected]
User avatar
Senior Boarder

Joshua M
Wed Oct 19, 2016 8:37 am
The following fragment is responsible for email address:
Code: Select all
$email = get_option($gk_tpl->name . '_contact_template_email', '');
      // if the user specified blank e-mail or not specified it
      if(trim($email) == '') {
         $email = get_option('admin_email');
      }


Try to add this code underneath:
Code: Select all
$email = '[email protected], [email protected]';
User avatar
Moderator


cron
Remember me
Register New Account
If you are old Gavick user, click HERE for steps to retrieve your account.