Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Getting an error on admin orders.php


Guest

Recommended Posts

hi all,

Im getting an error on admin orders.php when you try to update the comment

if i leave notify customer checked:

 

Fatal error: Cannot redeclare tep_db_connect() (previously declared in d:\home\phpserv\simglobal.co.uk\htdocs\admin\includes\functions\database.php:13) in d:\home\phpserv\simglobal.co.uk\htdocs\admin\includes\functions\database.php on line 13

 

if you uncheck it it goes through fine...

any ideas

i thin i get a similar error when i try to mail from admin too.

 

Rgds

Craig

Link to comment
Share on other sites

hi all,

Im getting an error on admin orders.php when you try to update the comment

if i leave notify customer checked:

 

Fatal error: Cannot redeclare tep_db_connect() (previously declared in d:\home\phpserv\simglobal.co.uk\htdocs\admin\includes\functions\database.php:13) in d:\home\phpserv\simglobal.co.uk\htdocs\admin\includes\functions\database.php on line 13

 

if you uncheck it it goes through fine...

any ideas

i thin i get a similar error when i try to mail from admin too.

 

Rgds

Craig

Sound like its tring to redeclare Twise ? dont ask me where though? >_<

May be some thing you added and havent fully changes end edited text from contributions ??

( WARNING )

I think I know what Im talking about.

BACK UP BACK UP BACK UP BACK UP

Link to comment
Share on other sites

OK, i tried overwriting the order.php but no joy, thanks for your help though.

 

Any other suggestions would be greatly appriciated, i cant go live till i have sorted this error.

 

Craig

Link to comment
Share on other sites

Ok, ive cured that problem with orders, but the email function in admin is throwing the same error,

im using the contribution in classes/email.php:

 

if (EMAIL_TRANSPORT == 'smtp') {

     include_once("Mail.php");
	 
     $headers["From"]    = $from;
     $headers["To"]      = $to_addr;
     $headers["Subject"] = $subject;
     //$headers["Bcc"] = "[email protected]";
     $params["host"] = "myhost";
     $params["port"] = "25";
     $params["auth"] = false;
     $params["username"] = "";
     $params["password"] = "";
	 
     // Create the mail object using the Mail::factory method
     $mail_object =& Mail::factory("smtp", $params);
     return $mail_object->send("$to_addr", $headers, $this->output);

    }

 

In admin/mail.php the page that send the emails from admin

this is the mail function:

 

<?php
/*
 $Id: mail.php,v 1.31 2003/06/20 00:37:51 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

 $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');

 if ( ($action == 'send_email_to_user') && isset($HTTP_POST_VARS['customers_email_address']) && !isset($HTTP_POST_VARS['back_x']) ) {
   switch ($HTTP_POST_VARS['customers_email_address']) {
     case '***':
       $mail_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS);
       $mail_sent_to = TEXT_ALL_CUSTOMERS;
       break;
     case '**D':
       $mail_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_newsletter = '1'");
       $mail_sent_to = TEXT_NEWSLETTER_CUSTOMERS;
       break;
     default:
       $customers_email_address = tep_db_prepare_input($HTTP_POST_VARS['customers_email_address']);

       $mail_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($customers_email_address) . "'");
       $mail_sent_to = $HTTP_POST_VARS['customers_email_address'];
       break;
   }

   $from = tep_db_prepare_input($HTTP_POST_VARS['from']);
   $subject = tep_db_prepare_input($HTTP_POST_VARS['subject']);
   $message = tep_db_prepare_input($HTTP_POST_VARS['message']);

   //Let's build a message object using the email class
   $mimemessage = new email(array('X-Mailer: osCommerce'));
   // add the message to the object
   $mimemessage->add_text($message);
   $mimemessage->build_message();
   while ($mail = tep_db_fetch_array($mail_query)) {
     $mimemessage->send($mail['customers_firstname'] . ' ' . $mail['customers_lastname'], $mail['customers_email_address'], '', $from, $subject);
   }

   tep_redirect(tep_href_link(FILENAME_MAIL, 'mail_sent_to=' . urlencode($mail_sent_to)));
 }

 if ( ($action == 'preview') && !isset($HTTP_POST_VARS['customers_email_address']) ) {
   $messageStack->add(ERROR_NO_CUSTOMER_SELECTED, 'error');
 }

 if (isset($HTTP_GET_VARS['mail_sent_to'])) {
   $messageStack->add(sprintf(NOTICE_EMAIL_SENT_TO, $HTTP_GET_VARS['mail_sent_to']), 'success');
 }
?>

 

Any help would be great.

 

Craig

:thumbsup:

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...