Jump to content

Added register_long_arrays = On on php5.ini and now online forms won't send email


ArtbyPatrick

Recommended Posts

I had a problem on a site where the products just weren't showing up by categories anymore. Afyer a lot of research, I was told to add register_long_arrays = On in php5.ini.

 

So I did, but unbeknownst to me, the online forms were suddenly not sending any emails to recipient email addresses already set up on the site. They were working fine before this change.

 

How can I solve this problem?

 

I am not very experienced with the php.ini stuff any help will be appreciated.

 

Thanks in advance

Link to comment
Share on other sites

ok here is the sendmail.php code

 

<?php
//
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright © 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Author: Chuck Hagenbuch <chuck@horde.org> |
// +----------------------------------------------------------------------+
/**
* Sendmail implementation of the PEAR Mail:: interface.
* @access public
* @package Mail
* @version $Revision: 294744 $
*/
class Mail_sendmail extends Mail {
/**
* The location of the sendmail or sendmail wrapper binary on the
* filesystem.
* @var string
*/
var $sendmail_path = '/usr/sbin/sendmail';
/**
* Any extra command-line parameters to pass to the sendmail or
* sendmail wrapper binary.
* @var string
*/
var $sendmail_args = '-i';
/**
* Constructor.
*
* Instantiates a new Mail_sendmail:: object based on the parameters
* passed in. It looks for the following parameters:
* sendmail_path The location of the sendmail binary on the
* filesystem. Defaults to '/usr/sbin/sendmail'.
*
* sendmail_args Any extra parameters to pass to the sendmail
* or sendmail wrapper binary.
*
* If a parameter is present in the $params array, it replaces the
* default.
*
* @param array $params Hash containing any parameters different from the
* defaults.
* @access public
*/
function Mail_sendmail($params)
{
if (isset($params['sendmail_path'])) {
$this->sendmail_path = $params['sendmail_path'];
}
if (isset($params['sendmail_args'])) {
$this->sendmail_args = $params['sendmail_args'];
}
/*
* Because we need to pass message headers to the sendmail program on
* the commandline, we can't guarantee the use of the standard "rn"
* separator. Instead, we use the system's native line separator.
*/
if (defined('PHP_EOL')) {
$this->sep = PHP_EOL;
} else {
$this->sep = (strpos(PHP_OS, 'WIN') === false) ? "n" : "rn";
}
}
/**
* Implements Mail::send() function using the sendmail
* command-line binary.
*
* @param mixed $recipients Either a comma-seperated list of recipients
* (RFC822 compliant), or an array of recipients,
* each RFC822 valid. This may contain recipients not
* specified in the headers, for Bcc:, resending
* messages, etc.
*
* @param array $headers The array of headers to send with the mail, in an
* associative array, where the array key is the
* header name (ie, 'Subject'), and the array value
* is the header value (ie, 'test'). The header
* produced from those values would be 'Subject:
* test'.
*
* @param string $body The full text of the message body, including any
* Mime parts, etc.
*
* @return mixed Returns true on success, or a PEAR_Error
* containing a descriptive error message on
* failure.
* @access public
*/
function send($recipients, $headers, $body)
{
if (!is_array($headers)) {
return PEAR::raiseError('$headers must be an array');
}
$result = $this->_sanitizeHeaders($headers);
if (is_a($result, 'PEAR_Error')) {
return $result;
}
$recipients = $this->parseRecipients($recipients);
if (is_a($recipients, 'PEAR_Error')) {
return $recipients;
}
$recipients = implode(' ', array_map('escapeshellarg', $recipients));
$headerElements = $this->prepareHeaders($headers);
if (is_a($headerElements, 'PEAR_Error')) {
return $headerElements;
}
list($from, $text_headers) = $headerElements;
/* Since few MTAs are going to allow this header to be forged
* unless it's in the MAIL FROM: exchange, we'll use
* Return-Path instead of From: if it's set. */
if (!empty($headers['Return-Path'])) {
$from = $headers['Return-Path'];
}
if (!isset($from)) {
return PEAR::raiseError('No from address given.');
} elseif (strpos($from, ' ') !== false ||
strpos($from, ';') !== false ||
strpos($from, '&') !== false ||
strpos($from, '`') !== false) {
return PEAR::raiseError('From address specified with dangerous characters.');
}
$from = escapeshellarg($from); // Security bug #16200
$mail = @popen($this->sendmail_path . (!empty($this->sendmail_args) ? ' ' . $this->sendmail_args : '') . " -f$from -- $recipients", 'w');
if (!$mail) {
return PEAR::raiseError('Failed to open sendmail [' . $this->sendmail_path . '] for execution.');
}
// Write the headers following by two newlines: one to end the headers
// section and a second to separate the headers block from the body.
fputs($mail, $text_headers . $this->sep . $this->sep);
fputs($mail, $body);
$result = pclose($mail);
if (version_compare(phpversion(), '4.2.3') == -1) {
// With older php versions, we need to shift the pclose
// result to get the exit code.
$result = $result >> 8 & 0xFF;
}
if ($result != 0) {
return PEAR::raiseError('sendmail returned error code ' . $result,
$result);
}
return true;
}
}
?>
Link to comment
Share on other sites

ok here is the code:

 

<?php
/*
$Id: enter_contest.php,v 1.0 2003/07/15 Exp $
Contest for osC(2.2MS2) v1.0
osCommerce, Open Source E-Commerce Solutions
Copyright © 2003 osCommerce
Released under the GNU General Public License
*/
require('includes/application_top.php');
if (CONTEST_SHOW == 'false') {
$navigation->set_snapshot();
tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'SSL'));
}
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ENTER_CONTEST);
if (isset($_GET['action']) && ($_GET['action'] == 'process')) {
$contestant_name = tep_db_prepare_input($_POST['contestant_name']);
$contestant_lastname = tep_db_prepare_input($_POST['contestant_lastname']);
$contestant_email = tep_db_prepare_input($_POST['contestant_email']);
$contestant_location = tep_db_prepare_input($_POST['contestant_location']);
// $gb_text = tep_db_prepare_input($_POST['gb_text']); // not being used. no reason why need customer to enter comments
$error = false;
if (strlen($contestant_name) < 2) {
$error = true;
$messageStack->add('contest', JS_CONTESTANTS_NAME);
}
if (strlen($contestant_lastname) < 3) {
$error = true;
$messageStack->add('contest', JS_CONTESTANTS_LNAME);
}
if (strlen($contestant_location) <= 6) {
$error = true;
$messageStack->add('contest', JS_CONTESTANTS_LOCATION);
}
if (tep_validate_email($contestant_email)) {
$mail_query = tep_db_query("select contestants_email, contestants_name, contestants_lastname from " . TABLE_CONTEST . " where contestants_email = '". $contestant_email ."'");
$customers_values = tep_db_fetch_array($mail_query);
if($customers_values == 0)
{
// mail to store owner
$texte = $contestant_name . ' ' . $contestant_lastname . ' ' . $contestant_location;
tep_mail("contest@unisondigital.com", "contest@unisondigital.com", EMAIL_CONTESTANT_SUBJECT, $texte, $contestant_location, $contestant_email);
// mail to contestant
$email_text = sprintf(EMAIL_CONTESTANT_GREET, $contestant_name);
$email_text .= EMAIL_CONTESTANT_MESSAGE;
tep_mail($contestant_name, $contestant_email, EMAIL_CONTESTANT_SUBJECT, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
}
else {
$error = true;
$messageStack->add('contest', ENTRY_EMAIL_DUPLICATE_CHECK_ERROR);
}
} else {
$error = true;
$messageStack->add('contest', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
}
if ($error == false) {
tep_db_query("insert into " . TABLE_CONTEST . " (contestants_name, contestants_lastname, contestants_email, contestants_location, date_added) values ('" . tep_db_input($contestant_name) . "', '" . tep_db_input($contestant_lastname) . "', '" . tep_db_input($contestant_email) . "', '" . tep_db_input($contestant_location) . "', now())");
$insert_id = tep_db_insert_id();
tep_db_query("insert into " . TABLE_ENTER_CONTEST_DESCRIPTION . " (entry_id, languages_id, entry_text) values ('" . (int)$insert_id . "', '" . (int)$languages_id . "', '" . tep_db_input($gb_text) . "')");
//tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT, tep_get_all_get_params(array('action'))));
tep_redirect(tep_href_link(FILENAME_ENTER_CONTEST, 'action=success'));
}
} elseif (tep_session_is_registered('customer_id')) {
$account_query_one = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
$account_one = tep_db_fetch_array($account_query_one);
$account_query_two = tep_db_query("select a.entry_country_id, b.countries_id, b.countries_name from " . TABLE_ADDRESS_BOOK . " a, " . TABLE_COUNTRIES ." b where a.customers_id = '" . (int)$customer_id . "' and a.entry_country_id = b.countries_id");
$account_two = tep_db_fetch_array($account_query_two);
$contestant_name = $account_one['customers_firstname'];
$contestant_lastname = $account_one['customers_lastname'];
$contestant_email = $account_one['customers_email_address'];
$contestant_location = $account_two['countries_name'];
}
$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CONTEST, tep_get_all_get_params()));
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<script language="javascript"><!--
function checkForm() {
var error = 0;
var error_message = "<?php echo JS_ERROR; ?>";
var contestant_name = document.enter_contest.contestant_name.value;
var contestant_lastname = document.enter_contest.contestant_lastname.value;
if (contestant_name.length < 2) {
error_message = error_message + "<?php echo JS_CONTESTANTS_NAME; ?>";
error = 1;
}
if (contestant_lastname.length < 3) {
error_message = error_message + "<?php echo JS_CONTESTANT_LNAME; ?>";
error = 1;
}
if (error == 1) {
alert(error_message);
return false;
} else {
return true;
}
}
function popupWindow(url) {
window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=700,height=480,screenX=150,screenY=150,top=150,left=150')
}
//--></script>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/home2.8.js"></script>
<link rel="STYLESHEET" type="text/css" href="slides.css">
<script language="javaScript">
<!-- Begin
function movepic(img_name,img_src) {
document[img_name].src=img_src;
}
// End -->
</script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php if ($languages_id=="1") {
require(DIR_WS_INCLUDES . 'header.php');
}
else {
require(DIR_WS_INCLUDES . 'header-fr.php');
} ?>
<!-- header_eof //-->
<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
<tr>
<td width="<?php echo 1; ?>" valign="top"><table border="0" width="<?php echo 1; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->
<td width="100%" valign="top"><?php echo tep_draw_form('enter_contest', tep_href_link(FILENAME_ENTER_CONTEST, 'action=process'), 'post', 'onSubmit="return checkForm();"'); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="pageHeading" valign="top"><?php echo HEADING_TITLE; ?></td>
<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_contact_us.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>
<?php
if ($messageStack->size('contest') > 0) {
?>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
<td><?php echo $messageStack->output('contest'); ?></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<?php
}
?>
<!-- begin prize display information -->
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<?php
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CONTEST);
$time_now = date('Y-m-d');
if ($prize_product = tep_random_select("select p.products_id, pd.products_name, p.products_model, p.products_price, p.products_tax_class_id, p.products_image, hhs.prizes_value, hhs.status, hhs.prizes_date_added, hhs.expires_date from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRIZES . " hhs where p.products_status = '1' and p.products_id = hhs.products_id and pd.products_id = hhs.products_id and pd.language_id = '" . (int)$languages_id . "' and hhs.status = '1' and hhs.expires_date >= '" . $time_now . "' order by hhs.prizes_date_added desc limit 1")) {
?>
<!-- prize //-->
<tr>
<td>
<?php
$info_box_contents = array();
$info_box_contents[] = array('align' => 'left', 'text' => BOX_HEADING_CONTEST);
new infoBoxHeading($info_box_contents, false, false);
$info_box_contents = array();
$info_box_contents[] = array('align' => 'center',
'text' => TEXT_CONTEST_ENDS . '<br>' . tep_date_long($prize_product['expires_date']) . '<br><br>' . TEXT_SIGN_UP_TODAY . '<br> <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $prize_product['products_id']) . '"><br><br>' . $prize_product['products_name'] . '<br>' . tep_image(DIR_WS_IMAGES . $prize_product['products_image'], 'Model : ' . $prize_product['products_model'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><br>Value: ' . '<span class="productSpecialPrice">' . $currencies->display_price($prize_product['prizes_value'], tep_get_tax_rate($prize_product['products_tax_class_id'])) . '</span>');
new infoBox($info_box_contents);
?>
</td>
</tr>
<?php
}
?>
<!-- end prize display information -->
<?php
if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'success')) {
?>
<tr>
<td class="main" align="center"><?php echo TEXT_SUCCESS_THANKS; ?></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
<tr class="infoBoxContents">
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
<td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<?php
} else{
?>
<tr>
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="main">
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
<td colspan="3" class="main" align="left"><?php echo TEXT_CONTEST_DETAILS; ?></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td class="smallText" align="left"></td>
<td class="main" align="right"><?php echo '<a href="javascript:popupWindow('' . tep_href_link(FILENAME_POPUP_CONTEST) . '')">' . TEXT_CONTEST_HELP_LINK . '</a>'; ?> <img src="images/icons/button_more_info.gif" alt="Contest Details" valign="bottom"></td>
<td class="main" align="right"></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
<tr class="infoBoxContents">
<td><table border="0" width="100%" cellspacing="2" cellpadding="2">
<tr>
<td class="main" width="30%"><?php echo ENTRY_NAME; ?></td>
<td class="main"><?php echo tep_draw_input_field('contestant_name', '', 'size="28"') . '  <span class="inputRequirement">* ' . TEXT_REQUIRED . '</span>'; ?></td>
</tr>
<tr>
<td class="main" width="30%"><?php echo ENTRY_LNAME; ?></td>
<td class="main"><?php echo tep_draw_input_field('contestant_lastname', '', 'size="28"') . '  <span class="inputRequirement">* ' . TEXT_REQUIRED . '</span>'; ?></td>
</tr>
<tr>
<td class="main"><?php echo ENTRY_EMAIL; ?></td>
<td class="main"><?php echo tep_draw_input_field('contestant_email', '', 'size="28"') . '  <span class="inputRequirement">* ' . TEXT_REQUIRED . '</span>'; ?></td>
</tr>
<tr>
<td class="main"><?php echo ENTRY_LOCATION; ?></td>
<td class="main"><?php echo tep_draw_input_field('contestant_location', '', 'size="28"') . '  <span class="inputRequirement">* ' . TEXT_REQUIRED . '</span>'; ?></td>
</tr>
<!--<tr>
<td class="main"><?php echo ENTRY_ENQUIRY; ?></td>
</tr>
<tr>
<td colspan="2"><?php echo tep_draw_textarea_field('gb_text', 'soft', 60, 15); ?></td>
</tr>
<tr>
<td colspan="2" class="smallText" align="right"><?php echo TEXT_NO_HTML; ?></td>
</tr>-->
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
<tr class="infoBoxContents">
<td><table background="images/backgrounds/fineline.gif" border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td align="left"> <a href="javascript:history.back(-1);"><?php echo tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
<td class="main" align="right"><?php echo tep_image_submit('button_submit.gif', IMAGE_BUTTON_SUBMIT); ?></td>
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<?php } ?>
</table></form></td>
<!-- body_text_eof //-->
<td width="<?php echo 1; ?>" valign="top"><table border="0" width="<?php echo 1; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<!-- 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'); ?>
Link to comment
Share on other sites

It looks like that code uses the tep_mail function in OSCommerce, which uses a custom email class according to their documentation. The class defined in sendmail.php isn't the one that is used by OSCommerce. I don't see a reason that the code wouldn't work. It looks like there are a lot of people having problems with that though:

 

https://www.google.com/search?client=opera&q=oscommerce+register+long+arrays&sourceid=opera&ie=utf-8&oe=utf-8&channel=suggest#channel=suggest&q=oscommerce+register_long_arrays+sending+email&spell=1

 

What exactly happens when you fill out the form? Is there an error message? Does it say it succeeded or anything like that? I would make sure that all PHP error messages are enabled. In the code you posted above, add these lines on the top of the code right after the line that includes application_top.php:

 

ini_set('display_errors', 1);

error_reporting(E_ALL);

Link to comment
Share on other sites

when filling out the forms, its says that it was sent with success. Normally after that the user would get a confirmation email and the owner gets an email as well, thats the part that doesnt work anymore.

 

I added the code where you told me to and nothing came up, it just went on with the success process

Link to comment
Share on other sites

I'm not sure what to say. Maybe create a PHP script like this, fill out your information in the code, and load it in a browser to see if it says it worked and you get the email. If not, you should probably post your question on the OSCommerce forums.

 

 

 

<?phprequire('includes/application_top.php');$ce_to_name = "MyName";$ce_to_email = "myemail@mywebsite.com";$ce_subject = "Test From tep_mail";$ce_body = "body: This is a test";$ce_from_name = "My Store Name";$ce_from_email = "mystore@mystore.com";if(!tep_mail($ce_to_name, $ce_to_email, $ce_subject, $ce_body, $ce_from_name, $ce_from_email)){  echo "failed";}else{  echo "success";}require(DIR_WS_INCLUDES . 'application_bottom.php');
Link to comment
Share on other sites

That's probably not a good test once I look at it again, it looks like tep_mail doesn't even return a value if it succeeds. I just don't see anything at all that would be affected by register_long_arrays, it doesn't make sense that it would break anything. PHP by default makes arrays like $_POST and $_GET available to a script. When register_long_arrays is on, then PHP will also define the old arrays like $HTTP_POST_VARS and $HTTP_GET_VARS. That's only needed if the code is old enough that it doesn't use $_POST and $_GET. But enabling that should not break $_POST or $_GET or anything else, so that's why I don't understand why you would be having a problem like that. It doesn't make much sense, if something uses $_POST or $_GET it's going to work regardless of what that setting is, and that setting should not affect anything other than code that uses the old long names.

Link to comment
Share on other sites

http://forums.oscommerce.com

 

I'm surprised that any software today requires register_long_arrays in order to work. That option has been removed in PHP 5.4, so that software wouldn't work with a current version of PHP at all. The option was added in PHP 5.0 and removed in PHP 5.4. It sounds like that code is designed to support very old versions of PHP 4, around 13 years old at this point. The correct fix would be to change the portions of the code that require that feature in order to work, and then disable the feature.

Link to comment
Share on other sites

yes that line was added not too long ago because back then, the product categories weren't showing up anymore in listing. Here is the site www.unisondigital.com. Back then, when you clicked on desktop computers, no inventory was showing up anymore, so by adding register_long_arrays the listings came back on but that stopped the email from working. That frankensite is quite a mess in the coding.

Link to comment
Share on other sites

It shouldn't be all that difficult to fix the code so that you can turn that feature off again. If I was to do that, I would use FTP to download the entire site, and then use a program that can search through all files. I use Windows Grep for that usually:

 

http://www.wingrep.com

 

In your case, you would use it to search all PHP files for each of these:

 

$HTTP_POST_VARS

$HTTP_GET_VARS

$HTTP_SERVER_VARS

$HTTP_POST_FILES

$HTTP_SESSION_VARS

$HTTP_ENV_VARS

$HTTP_COOKIE_VARS

 

and replace each occurrence with these (respectively):

 

$_POST

$_GET

$_SERVER

$_FILES

$_SESSION

$_ENV

$_COOKIE

 

After that, you could disable that option again and the code would run fine.

Link to comment
Share on other sites

I did those changes, everything displays fine but still the email has the same issue. I cannot get a confirmation email out for the user and the filled formed is not being forwarded to the target email address.

 

Although, on the user side, I get a confirmation saying that my submission has been successfully sent.

 

What should I tackle next?

Link to comment
Share on other sites

I tried that test.php file again

 

 

 

<?phprequire('includes/application_top.php');$ce_to_name = "MyName";$ce_to_email = "myemail@mywebsite.com";$ce_subject = "Test From tep_mail";$ce_body = "body: This is a test";$ce_from_name = "My Store Name";$ce_from_email = "mystore@mystore.com";if(!tep_mail($ce_to_name, $ce_to_email, $ce_subject, $ce_body, $ce_from_name, $ce_from_email)){ echo "failed";}else{ echo "success";}require(DIR_WS_INCLUDES . 'application_bottom.php');

 

 

 

and I got a failed, where should I go next?

 

 

EDIT: nvm I just reread your reply under that post that it should not be working anyway

Edited by ArtbyPatrick
Link to comment
Share on other sites

The ini files should not have include statements or any other PHP code, they are just for defining the options that PHP will use. Your server might be set up to allow both PHP 4 and PHP 5, so maybe it uses different INI files. I would just stick with PHP 5, but if you're going to delete the other INI file then you should make sure that you're actually using PHP 5. If you create a phpinfo page and open it in the browser then it will tell you which version it is using:

 

<?php phpinfo();

Link to comment
Share on other sites

ok so i removed the include line on the php5.ini, I figured maybe it is needed elsewhere in the code, So I tried including it in the actual page where user needs to fill in form but it returned an error message:

 

Fatal error: Cannot redeclare _pear_call_destructors() (previously declared in /home/content/U/n/i/UnisonDigital/html/includes/pear/PEAR.php:735) in /usr/local/php5/lib/php/PEAR.php on line 777

 

So I removed it again, should I be entering it somewhere else?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...