Contact us file error

Ask the community for help and support.
shopify
Posts: 54
Joined: Tue Mar 30, 2021 3:36 pm
Has thanked: 23 times
Been thanked: 3 times

Contact us file error

Post 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
ecartz
Lead Developer
Lead Developer
Posts: 2637
Joined: Tue Nov 05, 2019 6:02 pm
Has thanked: 4 times
Been thanked: 181 times

Re: Contact us file error

Post 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
shopify
Posts: 54
Joined: Tue Mar 30, 2021 3:36 pm
Has thanked: 23 times
Been thanked: 3 times

Re: Contact us file error

Post 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.
shopify
Posts: 54
Joined: Tue Mar 30, 2021 3:36 pm
Has thanked: 23 times
Been thanked: 3 times

Re: Contact us file error

Post 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.
Dan Cole
VIP Member
VIP Member
Posts: 223
Joined: Fri Oct 25, 2019 2:14 pm
Has thanked: 24 times
Been thanked: 14 times

Re: Contact us file error

Post 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
shopify
Posts: 54
Joined: Tue Mar 30, 2021 3:36 pm
Has thanked: 23 times
Been thanked: 3 times

Re: Contact us file error

Post 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.
heatherbell
VIP Member
VIP Member
Posts: 1996
Joined: Mon Oct 07, 2019 4:39 am
Has thanked: 26 times
Been thanked: 175 times

Re: Contact us file error

Post 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
raiwa
PhoenixCart Developer
PhoenixCart Developer
Posts: 1184
Joined: Sat Dec 21, 2019 8:08 am
Has thanked: 38 times
Been thanked: 102 times

Re: Contact us file error

Post by raiwa »

You should consider this instead:
app.php/addons/free_addon/maths_captcha

Very easy to install, very efficient against bots,
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing

Need Help?viewtopic.php?f=10&t=27
shopify
Posts: 54
Joined: Tue Mar 30, 2021 3:36 pm
Has thanked: 23 times
Been thanked: 3 times

Re: Contact us file error

Post 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?
raiwa
PhoenixCart Developer
PhoenixCart Developer
Posts: 1184
Joined: Sat Dec 21, 2019 8:08 am
Has thanked: 38 times
Been thanked: 102 times

Re: Contact us file error

Post by raiwa »

Just bots.
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing

Need Help?viewtopic.php?f=10&t=27
Post Reply