Zen Cart Logo
Forums / Installing on a Windows Server / Function ereg() is deprecated in - Assistance Required

Function ereg() is deprecated in - Assistance Required

Locked

Views: 3,273

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
18 Jan 2010, 8:14 PM
#1
zigiwiz avatar

zigiwiz

New Zenner

Join Date:
Jan 2010
Posts:
1
Plugin Contributions:
0

Function ereg() is deprecated in - Assistance Required

Hey everybody, i'v searched the forum and the FAQs and i havent found what im looking for.

Anyway i'v installed the Xampp version 1.7.3

  • Apache 2.2.14
  • MySQL 5.1.41 (Community Server) with PBXT engine 1.0.09-rc
  • PHP 5.3.1 (PEAR, Mail_Mime, MDB2, Zend)
  • Perl 5.10.1

Trying to run zencart on my localhost
I'v manage to install the zencart, i'v got to the point in which i finish the installation and i go to the store and i get a blank page., If i try to make it for the admin control panel i get these errors:

Deprecated: Function ereg() is deprecated in C:\xampp\htdocs\zencart\includes\classes\db\mysql\query_factory.php on line 412

Fatal error: Cannot redeclare date_diff() in C:\xampp\htdocs\zencart\admin\includes\functions\general.php on line 3001

What should i do?... :huh:

27 Mar 2010, 10:05 PM
#3
seancon1 avatar

seancon1

New Zenner

Join Date:
Sep 2007
Posts:
19
Plugin Contributions:
0

Re: Function ereg() is deprecated in - Assistance Required

i was having a problem with text fields validating (required) and thought the DEPRECATED ereg may be causing the problem which lead me to this post, i downloaded and installed the update but noticed the file that brought me to the search was not included, functions_lookups.php which contains 1 ereg and 1 ereg_replace

arround line 444 under // text required validation

    if (ereg('^txt_', $option)) {
      $check_attributes = $db->Execute("select attributes_display_only, attributes_required from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id='" . (int)$product_id . "' and options_id='" . (int)ereg_replace('txt_', '', $option) . "' and options_values_id='0'");

i changed this to

    if (preg_match('/^txt_/', $option)) {
      $check_attributes = $db->Execute("select attributes_display_only, attributes_required from " . "track_attributes" . " where products_id='" . (int)$product_id . "' and options_id='" . (int)preg_replace('/txt_/', '', $option) . "' and options_values_id='0'");

and solved my problem so i hope it helps some one else.

Sean

27 Mar 2010, 10:16 PM
#4
seancon1 avatar

seancon1

New Zenner

Join Date:
Sep 2007
Posts:
19
Plugin Contributions:
0

Re: Function ereg() is deprecated in - Assistance Required

MISTAKE ABOVE: i was testing some things and the changed code should be

  if (preg_match('/^txt_/', $option)) {
      $check_attributes = $db->Execute("select attributes_display_only, attributes_required from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id='" . (int)$product_id . "' and options_id='" . (int)preg_replace('/txt_/', '', $option) . "' and options_values_id='0'");