Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Fatal error: Call to undefined function


wcrystal

Recommended Posts

Posted

I am having a Maillist contrib problem.

 

I am using the maillist Email Capture Add-On by Jerry on oscommerce version $Id: default.php,v 1.75 2002/06/17 12:48:31

 

 

Install of maillist contrib went well. In testing it I entered first name, last name, and email address. When I click on the "submit" button the next page comes up with the following error:

 

Fatal error: Call to undefined function: tep_db_perform() in

 

/home/wcrystal/public_html/shop/newsletter.php on line 98

 

Line 98 looks like this:

 

tep_db_perform(TABLE_NEWSLETTER, $sql_data_array, $q_type , "customers_email_address = '" .

 

tep_db_input($list_email_add) . "'");

 

 

I have been through the code a million times and am unable to see any errors. Has anyone else had this problem?

Wes Crystal

 

AKA

Intrinsically Dazed And Confused!

Posted

Make sure that database.php is being called...thru:

 

  require('includes/application_top.php');

Posted

Thanks Matti but the code: require('includes/application_top.php');

is there and and it appears to be properly formatted.

 

I am not sure if this is going to help but below is the whole code as it stands under /shop/newsletter.php

 

<?php

/*

$Id: newsletter.php,v 1

Jerry Carter

 

The Exchange Project - Community Made Shopping!

http://www.theexchangeproject.org

 

Copyright © 2000,2001 The Exchange Project

 

Released under the GNU General Public License

*/

 

require('includes/application_top.php');

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_NEWSLETTER);

$location = ' ? <a href="' . tep_href_link(FILENAME_LINKS, '', 'NONSSL') . '" class="headerNavigation">' . NAVBAR_TITLE . '</a>';

?>

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

<html <?php echo HTML_PARAMS; ?>>

<head>

<meta name="keywords" content="<? echo KEYWORDS; ?>">

<meta name="description" content="<? echo DESCRIPTION; ?>">

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">

<title><?php echo TITLE; ?></title>

<base href="<?php echo (getenv('HTTPS') == 'on' ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">

<link rel="stylesheet" type="text/css" href="stylesheet.css">

</head>

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">

<!-- header //-->

<?php require(DIR_WS_INCLUDES . 'header.php'); ?>

<!-- header_eof //-->

 

<!-- body //-->

<table border="0" width="100%" cellspacing="3" cellpadding="3">

<tr>

<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">

<!-- left_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

<!-- left_navigation_eof //-->

</table></td>

<!-- body_text //-->

<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

<td align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_specials.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

</tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td>

<br><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr><td>

<?php

$PARAMS = ( isset( $HTTP_POST_VARS ) )

? $HTTP_POST_VARS : $HTTP_GET_VARS;

$list_firstname = $HTTP_GET_VARS

  • ;

$list_lastname = $HTTP_GET_VARS

  • ;

$list_email_add = $HTTP_GET_VARS

  • ;

$list_on_off = $HTTP_GET_VARS

  • ;

$check = $HTTP_GET_VARS[check];

$list_firstname_error = "";

$list_lastname_error = "";

$list_email_add_error = "";

function input_table( $list_firstname, $list_lastname, $list_email_add, $list_on_off, $list_firstname_error, $list_lastname_error, $list_email_add_error)

{

print $PHP_SELF;

print "<form name="maillist" method="get" action="newsletter.php">

<br><b>Please complete all fields</b><br>

<br>First Name:<br><input type="text" name="list_firstname" value="$list_firstname" size="20" maxlength="20" > $list_firstname_error

<br>Last Name:<br><input type="text" name="list_lastname" value="$list_lastname" $size="20" maxlength="20"> $list_lastname_error

<br>email Address:<br><input type="text" name="list_email_add" value="$list_email_add" size="20" maxlength="40"> $list_email_add_error

<br><table width="20%" border="0">

<tr><td><div align="center"><font size="-2">Subscribe</font></div></td><td><div align="center"><font size="-2">Unsubscribe</font></div></td></tr>

<tr><td><div align="center"><input type="radio" name="list_on_off" value=1 checked></div></td><td><div align="center"><input type="radio" name="list_on_off" value="0"></div></td></tr>

</table>

<input type="hidden" name="check" value="20">

<br><input type="submit" name="Submit" value="Submit">

</form>";

}

function store_data( $list_firstname, $list_lastname, $list_email_add, $list_on_off, $q_type )

{

$sql_data_array = array('customers_firstname' => $list_firstname,

'customers_lastname' => $list_lastname,

'customers_email_address' => $list_email_add,

'customers_newsletter' => $list_on_off);

tep_db_perform(TABLE_NEWSLETTER, $sql_data_array, $q_type, "customers_email_address = '" . tep_db_input($list_email_add) . "'");

}

if ( $check == 20 )

{

if ( empty( $list_firstname ) )

{

$list_firstname_error = "<font color=red size=-2>Please insert a first name</font>";

}

if ( empty( $list_lastname ) )

{

$list_lastname_error = "<font color=red size=-2>Please insert a last name</font>";

}

if ( empty( $list_email_add ) )

{

$list_email_add_error = "<font color=red size=-2>Please insert a valid email address</font>";

input_table( $list_firstname, $list_lastname, $list_email_add, $list_on_off, $list_firstname_error, $list_lastname_error, $list_email_add_error);

}

else

{

if (!tep_validate_email($list_email_add)) {

$list_email_add_error = "<font color=red size=-2>Please insert a valid email address</font>";

input_table( $list_firstname, $list_lastname, $list_email_add, $list_on_off, $list_firstname_error, $list_lastname_error, $list_email_add_error);

} else {

if ( $list_on_off != 1 ) {

$q_type = "update";

store_data( $list_firstname, $list_lastname, $list_email_add, $list_on_off, $q_type );

print "Your email address has been removed from our newsletter list";

} else {

$q_type = "insert";

store_data( $list_firstname, $list_lastname, $list_email_add, $list_on_off, $q_type );

print "Thank You! Your email address has been added to our newsletter list";

}

}

}

}

else

{

input_table( $list_firstname, $list_lastname, $list_email_add, $list_on_off, $list_firstname_error, $list_lastname_error, $list_email_add_error);

}

?>

<td class="main"><?php echo TEXT_INFORMATION; ?></td>

</tr>

</table></td>

</tr>

<tr>

<td align="right" class="main"><br><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT, '', 'NONSSL') . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>

</tr>

</table></td>

<!-- body_text_eof //-->

<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">

<!-- right_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>

<!-- right_navigation_eof //-->

</table></td>

</tr>

</table>

<!-- body_eof //-->

 

<!-- footer //-->

<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>

<!-- footer_eof //-->

<br>

</body>

</html>

<?php require(DIR_WS_INCLUDES . 'application_bottom.php');

?>

 

 

I can't seem to figure out what I am missing. Does anyone have this contrib running?

 

Thanks All

Wes Crystal

 

AKA

Intrinsically Dazed And Confused!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...