Jump to content

Archived

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

Nathali

urgent problem in 'Contact us' page

Recommended Posts

Hi,

 

I found a problem in my 'emails dates'. ALL my emails that were sent from my contact us page got the currently date !!

 

According to my hosting support team, it caused by my 'contact us' page...

 

The reply of the support team was:

"The issue does not appear to be caused by the SquirrelMail software. The same issue with these particular messages can be observed with all mail clients. It seems that the delivery header is corrupted and the SquirrelMail software is designed in such manner that it will always put the current date if it fails to fetch the correct time frame.

 

As for the cause for the malformed headers, I have examined the messages which are affected and they all seem to be sent through the Contact Us form of your website. I have sent two messages, one from my mail client and one from your contact form and the result was misreported date for the second message. You may wish to contact a web developer to examine more carefully the cause for your contact form issue."

 

COULD someone help please? what might cause this problem??

 

Thanks a lot for the attention!

 

Here is my "contact us" page:

 

<?php

/*

$Id: contact_us.php,v 1.42 2003/06/12 12:17:07 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

require('includes/application_top.php');

 

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

 

$error = false;

if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send')) {

$name = tep_db_prepare_input($HTTP_POST_VARS['name']);

$email_address = tep_db_prepare_input($HTTP_POST_VARS['email']);

$enquiry = tep_db_prepare_input($HTTP_POST_VARS['enquiry']);

 

if (tep_validate_email($email_address)) {

tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $enquiry, $name, $email_address);

 

tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=success'));

} else {

$error = true;

 

$messageStack->add('contact', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);

}

}

 

$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CONTACT_US));

?>

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

<html <?php echo HTML_PARAMS; ?>>

<head>

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

<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">

</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"><?php echo tep_draw_form('contact_us', tep_href_link(FILENAME_CONTACT_US, 'action=send')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

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

<tr>

<td class="pageHeading"><?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>

<!-- testing //-->

<tr>

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

</tr>

<tr>

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

</tr>

<!-- end testing //-->

<?php

if ($messageStack->size('contact') > 0) {

?>

<tr>

<td><?php echo $messageStack->output('contact'); ?></td>

</tr>

<tr>

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

</tr>

<?php

}

 

if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'success')) {

?>

<tr>

<td class="main" align="center"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_man_on_board.gif', HEADING_TITLE, '0', '0', 'align="left"') . TEXT_SUCCESS; ?></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="infoBox">

<tr class="infoBoxContents">

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

<tr>

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

</tr>

<tr>

<td class="main"><?php echo tep_draw_input_field('name'); ?></td>

</tr>

<tr>

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

</tr>

<tr>

<td class="main"><?php echo tep_draw_input_field('email'); ?></td>

</tr>

<tr>

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

</tr>

<tr>

<td><?php echo tep_draw_textarea_field('enquiry', 'soft', 50, 15); ?></td>

</tr>

</table></td>

</tr>

</table></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 tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></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 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'); ?>


Best Regards,

Nathali

Share this post


Link to post
Share on other sites
ALL my emails that were sent from my contact us page got the currently date !!

Call me stupid but what is wrong with the current date? I would guess it would be a problem if you had a date like 1-1-1970.

Share this post


Link to post
Share on other sites
Call me stupid but what is wrong with the current date? I would guess it would be a problem if you had a date like 1-1-1970.

 

 

Hello dear Jan,

 

My problem is that when a customer use my "contact us" page to send a request.. I get the email on my host server mail with the current date. Until now it is ok !

But after a few days that email date is changed to the current date ! very strange.. !!

 

so I asked the support team of my host and they said to me that it is not their problem.. as you can see their reply.. right?

 

Any advise please??

 

Thanks


Best Regards,

Nathali

Share this post


Link to post
Share on other sites
My problem is that when a customer use my "contact us" page to send a request.. I get the email on my host server mail with the current date. Until now it is ok !

But after a few days that email date is changed to the current date ! very strange.. !!

Can't recall I have ever read a post about this. Personally, I would do a view of the source of such an email so all the headers are there and keep a copy of that. Then compare it with the same message the next day to see what has changed. I would also compare it with other emails (like for orders?) and see if there is any noticeable difference in the headers.

 

I don't think this is a very common error so without seeing those headers from those "date resetting" emails noone will be able to offer any advise IMHO. But I could be wrong :)

Share this post


Link to post
Share on other sites

You could do this until the problem is resolved.

 

In /catalog/contact_us.php change this code:

 

	if (tep_validate_email($email_address)) {
  tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $enquiry, $name, $email_address);

To:

 

	if (tep_validate_email($email_address)) {
  $offset = 0; // 3600 = 1 hour. use to adjust server time to local time if necessary
  $enquiry = $enquiry . "\n\n" . date('l dS F Y h:i:s A',time() + $offset);
  tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $enquiry, $name, $email_address);

This will add the date and time the email is sent at the bottom of the email body.

 

Oh, and one more thing...

 

Very nice personal photo!

:wub:

 

:blush:


If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Share this post


Link to post
Share on other sites

Your issue would be with the tep_mail function, not the contact page, but I have come accross this with some servers b4, I just include the date in the message body with other info, like:

 

replace:

 

 

$name = tep_db_prepare_input($HTTP_POST_VARS['name']);
$email_address = tep_db_prepare_input($HTTP_POST_VARS['email']);
$enquiry = tep_db_prepare_input($HTTP_POST_VARS['enquiry']);

if (tep_validate_email($email_address)) {
tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $enquiry, $name, $email_address);

tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=success'));

 

with:

 

  $name = tep_db_prepare_input($HTTP_POST_VARS['name']);
 $email_address = tep_db_prepare_input($HTTP_POST_VARS['email']);
 $xipaddress = $HTTP_SERVER_VARS["REMOTE_ADDR"];
 $phone = tep_db_prepare_input($HTTP_POST_VARS['phone']);
 $enquiry = tep_db_prepare_input($HTTP_POST_VARS['enquiry']);
 $date = 'Date Sent: ' . date("d M Y H:i:s");

if (tep_validate_email($email_address)) {
$enquiry = 'Message from: ' . $name . "\n" . $date . "\n" . 'Phone Number: ' .  $phone . "\n" . 'Client Number: ' .  $customer_id . "\n" . 'At IP: ' . $xipaddress . '.' . "\n\n" . 'Message:' . "\n" . $enquiry;
  tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $enquiry, $name, $email_address);

  tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=success'));

 

this adds

 

Message from: John Smith

Date Sent: 09 Aug 2009 15:14:13

Phone Number: 01234567890

Client Number: 2

At IP: 11.111.111.1.

 

Message:

 

to the message content

 

To ensure the date function is returning your local date instead of servers add:

 

// set local date
  putenv("TZ=Europe/London");

to includes/application_top.php


Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Share this post


Link to post
Share on other sites

Thank you very much Jim and Sam for your kind replies !!

 

I will try that and see the result..

 

No words to describe how much I am grateful to both of you ! :-)

 

All the best,

Nathali


Best Regards,

Nathali

Share this post


Link to post
Share on other sites

×