Page 1 of 2

Contact us file error

Posted: Mon May 03, 2021 7:26 pm
by shopify
Hi,

I am getting the following error from my contact_us.php file:

[03-May-2021 08:31:39 Europe/London] PHP Fatal error: Uncaught Error: Call to undefined function tep_validate_email() in /home/catalog/templates/default/includes/pages/contact_us.php:20

<?php
/*
$Id$

CE Phoenix, E-Commerce made Easy
https://phoenixcart.org

Copyright (c) 2021 Phoenix Cart

Released under the GNU General Public License
*/

if (tep_validate_form_action_is('send')) {
$error = false;

$name = tep_db_prepare_input($_POST['name']);
$email_address = tep_db_prepare_input($_POST['email']);
$enquiry = tep_db_prepare_input($_POST['enquiry']);

if (!tep_validate_email($email_address)) {

What is the cause of this and how do I fix it?

Thanks

Re: Contact us file error

Posted: Tue May 04, 2021 1:26 am
by ecartz
shopify wrote: Mon May 03, 2021 7:26 pm [03-May-2021 08:31:39 Europe/London] PHP Fatal error: Uncaught Error: Call to undefined function tep_validate_email() in /home/catalog/templates/default/includes/pages/contact_us.php:20
Lines 20-26 of that file:

Code: Select all

<?php
  if ($messageStack->size('contact') > 0) {
    echo $messageStack->output('contact');
  }


  if (isset($_GET['action']) && ($_GET['action'] == 'success')) {
?>
No reference to tep_validate_email. And I checked. That file never did have a reference to tep_validate_email in core. So the easiest fix would be to use the core versions of that file and contact_us.php -- presumably versions from after this change: https://github.com/CE-PhoenixCart/Phoen ... 6ff329436b

Re: Contact us file error

Posted: Wed May 05, 2021 8:08 pm
by shopify
ecartz wrote: Tue May 04, 2021 1:26 am
shopify wrote: Mon May 03, 2021 7:26 pm [03-May-2021 08:31:39 Europe/London] PHP Fatal error: Uncaught Error: Call to undefined function tep_validate_email() in /home/catalog/templates/default/includes/pages/contact_us.php:20
Lines 20-26 of that file:

Code: Select all

<?php
  if ($messageStack->size('contact') > 0) {
    echo $messageStack->output('contact');
  }


  if (isset($_GET['action']) && ($_GET['action'] == 'success')) {
?>
No reference to tep_validate_email. And I checked. That file never did have a reference to tep_validate_email in core. So the easiest fix would be to use the core versions of that file and contact_us.php -- presumably versions from after this change: https://github.com/CE-PhoenixCart/Phoen ... 6ff329436b
Thanks for your reply. You are correct, like you I checked this file against core files downloaded when error occurred. I believe this changed file was introduced by one of many addons. I don't know which and reverting to the core file downloaded may break shop. I'll try that and see how it impacts shop.

Re: Contact us file error

Posted: Thu May 06, 2021 5:43 pm
by shopify
ecartz wrote: Tue May 04, 2021 1:26 am
shopify wrote: Mon May 03, 2021 7:26 pm [03-May-2021 08:31:39 Europe/London] PHP Fatal error: Uncaught Error: Call to undefined function tep_validate_email() in /home/catalog/templates/default/includes/pages/contact_us.php:20
Lines 20-26 of that file:

Code: Select all

<?php
  if ($messageStack->size('contact') > 0) {
    echo $messageStack->output('contact');
  }


  if (isset($_GET['action']) && ($_GET['action'] == 'success')) {
?>
No reference to tep_validate_email. And I checked. That file never did have a reference to tep_validate_email in core. So the easiest fix would be to use the core versions of that file and contact_us.php -- presumably versions from after this change: https://github.com/CE-PhoenixCart/Phoen ... 6ff329436b
I found out the culprit file contact_us.php was introduced by an addon called honeypot I added to my install. The contact_us.php included in the changed phoenix files introduced this. I wonder if author of addon can sort out this bug. Similar error in logs all over the place.

Re: Contact us file error

Posted: Fri May 07, 2021 1:17 am
by Dan Cole
"I wonder if author of addon can sort out this bug. Similar error in logs all over the place."
You'll probably need to contact Jack on the oscommerce forum. I don't think he participates here.

Dan

Re: Contact us file error

Posted: Sun May 09, 2021 6:39 am
by shopify
Dan Cole wrote: Fri May 07, 2021 1:17 am
"I wonder if author of addon can sort out this bug. Similar error in logs all over the place."
You'll probably need to contact Jack on the oscommerce forum. I don't think he participates here.

Dan
Thanks but unfortunately, no joy with contacting addon author as getting registered on that forum seems to be harder than breaking into fortknox. Phew! This is one why I'm very wary of addons for this software.

Re: Contact us file error

Posted: Sun May 09, 2021 8:22 am
by heatherbell
shopify wrote: Sun May 09, 2021 6:39 amThis is one why I'm very wary of addons for this software.
Yes, you should be wary of third party addons which is why we only use Pro Supporters addons or addons by Certified Developers

Re: Contact us file error

Posted: Fri May 21, 2021 3:33 pm
by raiwa
You should consider this instead:
app.php/addons/free_addon/maths_captcha

Very easy to install, very efficient against bots,

Re: Contact us file error

Posted: Sun May 23, 2021 5:44 am
by shopify
raiwa wrote: Fri May 21, 2021 3:33 pm You should consider this instead:
app.php/addons/free_addon/maths_captcha

Very easy to install, very efficient against bots,
Thanks very much. I've installed it with ease and very impressed with it so far.

I have to do a back track of my shop install to rip out all the changes honeypot made to core files and files added. This has been a nightmare of an addon. Is this maths_captcha addon just for bots or for fake accounts as well?

Re: Contact us file error

Posted: Sun May 23, 2021 5:47 am
by raiwa
Just bots.