Jump to content
John-Peter

Super Contact us enhancement 1.0

Recommended Posts

I just installed this contribution (Great one BTW!) and also the Anti Spambot contribution. Right now I am having problems with it telling me that my email does not appear to be valid (duplicate error message on top) and that I have entered the wrong code. Has anyone been able to succesfully use these two contributions together? If so, could I see your contact_us.php code so I know what to change in mine?

 

Also - does the Super Enhancement force the person to be logged in before they can submit the Contact Us form? If so - where do I turn that off? I saw some mention of one of the Contact Us contributions doing that and I can't remember which one :blush:


~Tracy
 

Share this post


Link to post
Share on other sites

I just tried it without the Anti Spambot contribution and found that - even though it sending the emails, it just redirects back to the form :huh:

 

Does it have a redirect upon successful submission? I would like to let the customers see a message letting them know that their email has been sent ;)


~Tracy
 

Share this post


Link to post
Share on other sites

Tracy, dont use the 1.2 or 1.3 version... the 1.1 is working fine.. and I hope to have time soon to really make my antibot addition works!!!

Share this post


Link to post
Share on other sites
Tracy, dont use the 1.2 or 1.3 version... the 1.1 is working fine.. and I hope to have time soon to really make my antibot addition works!!!

 

Thank you for the quick reply! :D

 

I compared my contact_us.php from 1.3 install to 1.1 install and ended up with a 1.3 that works (YAY!!) :thumbsup: (I wanted the Order Number field )

 

My only problem is that the Anti-Spambot contrib. does not seem to work with it <_<

 

Is the antibot addition you mentioned separate from the Anti-Spambot contrib? Just trying to determine if I'm better off waiting for your antibot or asking on the Anti-Spambot thread for help merging the two :blush:


~Tracy
 

Share this post


Link to post
Share on other sites

Actually that could be a good idea to ask the support of the other contribution see what they can do...

I dont expect to have time before next week...

otherwise, the other solution would be to restrict the contact us page to people who are regsitered.. if you have the antibot registration contribution on, then you are sure that only registered members can send messages...

Share this post


Link to post
Share on other sites
I compared my contact_us.php from 1.3 install to 1.1 install and ended up with a 1.3 that works (YAY!!)

 

TracyS , that would be nice of you t post a version 1.4 with the 1.3 corrected , as you can see there are many struggling to make it work and only way is to get back to 1.1 version

 

hope you take the time :rolleyes:


MS2

Share this post


Link to post
Share on other sites

ok it seems i found out form 1.3 version what was not working

 

install text should be :

 

 

replace

$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);

 

by

 

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

if ($order_id <> NULL){

$enquiry = 'Order ID: ' . $order_id . "\n\n" . tep_db_prepare_input($HTTP_POST_VARS['enquiry']);

}else{

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

}

 

$emailsubject = tep_db_prepare_input($HTTP_POST_VARS['reason']) . ' ' . EMAIL_SUBJECT;

if (tep_validate_email($email_address)) {

if (CONTACT_US_LIST !=''){

$send_to_array=explode("," ,CONTACT_US_LIST);

preg_match('/\<[^>]+\>/', $send_to_array[$send_to], $send_email_array);

$send_to_email= eregi_replace (">", "", $send_email_array[0]);

$send_to_email= eregi_replace ("<", "", $send_to_email);

 

tep_mail(preg_replace('/\<[^*]*/', '', $send_to_array[$send_to]), $send_to_email, $emailsubject, $enquiry, $name, $email_address);

}else{

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

}

 

hope somone test it and then make a package for 1.4 , feedback are welcome ! :lol:


MS2

Share this post


Link to post
Share on other sites
TracyS , that would be nice of you t post a version 1.4 with the 1.3 corrected , as you can see there are many struggling to make it work and only way is to get back to 1.1 version

 

hope you take the time :rolleyes:

 

I would be more than happy to - but I'm not very strong in PHP yet so I'm not positive that my fix will work for everyone. Here is my contact_us.php code (that's all I changed in v1.3) for a quick glance to make sure that I did things correctly and didn't mess up some logic that it needs. If it looks good to you then I'll be happy to zip it up (and see if I can use WinMerge to figure out what I changed and change the install instructions) :blush:

 

<?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 (c) 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']);
// BOF Super Contact us enhancement 1.3
$order_id = tep_db_prepare_input($HTTP_POST_VARS['order_id']);
if ($order_id <> NULL){
		$enquiry = 'Order ID: ' . $order_id . "\n\n" . tep_db_prepare_input($HTTP_POST_VARS['enquiry']);
}else{
	$enquiry = tep_db_prepare_input($HTTP_POST_VARS['enquiry']);
}

$emailsubject = tep_db_prepare_input($HTTP_POST_VARS['reason']) . ' ' . EMAIL_SUBJECT;
if (tep_validate_email($email_address)) {

if (CONTACT_US_LIST !=''){
	$send_to_array=explode("," ,CONTACT_US_LIST);
	preg_match('/\<[^>]+\>/', $send_to_array[$send_to], $send_email_array);
	$send_to_email= eregi_replace (">", "", $send_email_array[0]);
	$send_to_email= eregi_replace ("<", "", $send_to_email);

	tep_mail(preg_replace('/\<[^*]*/', '', $send_to_array[$send_to]), $send_to_email, $emailsubject, $enquiry, $name, $email_address);
	tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=success'));
}else{
	tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, $emailsubject, $enquiry, $name, $email_address);
	tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=success'));
}
// EOF Super Contact us enhancement 1.3
} 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>
<?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>
<!-- BOF Super Contact us enhancement 1.3 //-->
<?php
 } else {
 if (tep_session_is_registered('customer_id')) {
$account_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
$account = tep_db_fetch_array($account_query);

$name = $account['customers_firstname'] . ' ' . $account['customers_lastname'];
$email = $account['customers_email_address'];
 }
?>
<tr><td>

<table border="0" width="100%" cellspacing="1" cellpadding="3" class="infoBox">
<tr class="infoBoxContents"><td><table cellpadding="5"><tr>
	 <td class="main" valign="top" width=40%><b><?php echo nl2br(STORE_NAME_ADDRESS); ?></b><br><br>
			<?php echo (OPENING_HOURS); ?><br><br></td>
			<td class="main" valign="top" width="60%"><?php echo ENTRY_NAME; ?><br>
				<?php echo tep_draw_input_field('name'); ?><br />
				<?php echo ENTRY_EMAIL; ?><br>
				<?php echo tep_draw_input_field('email'); ?><br />
				<?php echo ENTRY_ORDER_ID; ?><br>
				<?php echo tep_draw_input_field('order_id'); ?><br />
				<?php
				 if (CONTACT_US_LIST !=''){
			 echo SEND_TO_TEXT . '<br>';
			 if(SEND_TO_TYPE=='radio'){
			 foreach(explode("," ,CONTACT_US_LIST) as $k => $v) {
				if($k==0){
				$checked=true;
				}else{
				$checked=false;
				}
				echo tep_draw_radio_field('send_to', "$k", $checked). " " .preg_replace('/\<[^*]*/', '', $v);
						  }

									}else{
						  foreach(explode("," ,CONTACT_US_LIST) as $k => $v) {
					$send_to_array[] = array('id' => $k, 'text' => preg_replace('/\<[^*]*/', '', $v));
				 }
													   echo tep_draw_pull_down_menu('send_to',  $send_to_array);
									 }

									echo;
									}
																  ?><br />
																<?php echo ENTRY_REASON; ?><br>
				<select name="reason">
					<?php echo '<option value="' . REASONS1 . '">' . REASONS1 . '</option>'; ?>
					<?php echo '<option value="' . REASONS2 . '">' . REASONS2 . '</option>'; ?>
					<?php echo '<option value="' . REASONS3 . '">' . REASONS3 . '</option>'; ?>
					<?php echo '<option value="' . REASONS4 . '">' . REASONS4 . '</option>'; ?>
					<?php echo '<option value="' . REASONS5 . '">' . REASONS5 . '</option>'; ?>
					<?php echo '<option value="' . REASONS6 . '">' . REASONS6 . '</option>'; ?>

				</select><br />
				<?php echo ENTRY_ENQUIRY; ?><BR>
				<?php echo tep_draw_textarea_field('enquiry', 'soft', 40, 15, tep_sanitize_string($_POST['enquiry']), '', false); ?>
				<br />
				<br />
				<p align="right"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></p>
				</td></tr></table></td>
</tr>
</table>
<br />
<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"> </td>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td></tr>   
<?php
 }
?>
<!-- EOF Super Contact us enhancement 1.3 //-->
</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'); ?>


~Tracy
 

Share this post


Link to post
Share on other sites

Thanks to Alex studio who had created a special thread to add the antirobot to the the super contact us enhancement, the problem is cracked!!

 

I re-uploaded my files to share a ready to use contact_us.php now including the great work of Jeep Ice, Alex Studio and the order ID field form the 1.2 version.

 

IT IS Working :) I'm happy I hope you will be too!!

Share this post


Link to post
Share on other sites
Thanks to Alex studio who had created a special thread to add the antirobot to the the super contact us enhancement, the problem is cracked!!

 

I re-uploaded my files to share a ready to use contact_us.php now including the great work of Jeep Ice, Alex Studio and the order ID field form the 1.2 version.

 

IT IS Working :) I'm happy I hope you will be too!!

 

WOOHOO!!! It works!! It took me a bit to find the right workaround for Anti Robot Registration Validation to get the PNG images showing with my modified site - but it's all working now!! :thumbsup: YAY!!!

 

Thank You!! :D


~Tracy
 

Share this post


Link to post
Share on other sites

Tracy,

 

i have just used your full contact_us.php with the rest coming from 1.3 and it seems to work very well. Well the success page comes up and the email subject is in the right place whereas it wasn't with 1.3!

 

Thanks

 

Becki

Share this post


Link to post
Share on other sites
Tracy,

 

i have just used your full contact_us.php with the rest coming from 1.3 and it seems to work very well. Well the success page comes up and the email subject is in the right place whereas it wasn't with 1.3!

 

Thanks

 

Becki

 

One question actually if anyone can help me out.

 

I want the customer email and name field boxes to be longer (as i hate it when you can't see all of the email address) - where can i change them, i had a look in contact_us but didn't seem to be there?

 

many thanks

Becki

Share this post


Link to post
Share on other sites
One question actually if anyone can help me out.

 

I want the customer email and name field boxes to be longer (as i hate it when you can't see all of the email address) - where can i change them, i had a look in contact_us but didn't seem to be there?

 

many thanks

Becki

 

I'm glad it is working for you! I had a look and I have no idea how to set the size of the text fields :( Hopefully someone else will know how to do that :blush:


~Tracy
 

Share this post


Link to post
Share on other sites

Im getting this error?

Warning: implode() [function.implode]: Bad arguments. in /home/airassis/public_html/osCommerce/catalog/includes/classes/email.php on line 499

 

It sends the mail. I get it. But something looks wrong to the person who sends it.

 

Any ideas?

Share this post


Link to post
Share on other sites

Hello,

 

I previously installed version 1.1 and now upgraded to version 1.3

 

My problem is that when I receive the message I never receive any of the data. I get the text message...the typed in comments, but never receive any of the other data, email, name etc. (Didn't work for me with version 1.1 either)

 

Am I doing something wrong in my POP confirguration?? I am using forwards and autoresponders. Even when I check my original email boxes there is no info there.

 

 

Everything else seems to work....success page etc.

 

 

Help,

Rod

Share this post


Link to post
Share on other sites
Hello,

 

I previously installed version 1.1 and now upgraded to version 1.3

 

My problem is that when I receive the message I never receive any of the data. I get the text message...the typed in comments, but never receive any of the other data, email, name etc. (Didn't work for me with version 1.1 either)

 

Am I doing something wrong in my POP confirguration?? I am using forwards and autoresponders. Even when I check my original email boxes there is no info there.

Everything else seems to work....success page etc.

Help,

Rod

as far as I've seen, the 1.3 version is NOT working fine... but I dont know why...

best is or to use the 1.1, or my version if you want to have the anti robot feature and the order ID with the rest of the 1.1 version...

 

just a question, was your contact page working before you made any change?? cause if it's a POP config problem, we can't really help you out there can we?

Edited by Burntheweb

Share this post


Link to post
Share on other sites

Im having the same issue

 

Not getting the email at all then in my catch all box this is what it says

 

A message that you sent contained no recipient addresses, and therefore no

delivery could be attempted.

 

 

Any idea

Thanks


Eric

 

Keep up on osCommerce changes and updates at

Github | Understand osCommerce a little further at OsCommerce Documentation | Copy and paste your error message in Google add "in osCommerce" at the end to get relevant answers to most issues.

Share this post


Link to post
Share on other sites

For anyone who still hasnt found the answer to the "Not sending of emails, not going to the success page and other things"

 

Here is your answer I reworked and modified it abit but basically I had to start from scratch because none of them worked here is my contact_us.php

 

And this will show the Customers name, order number and message that they typed in the form and will also show the reason why in the email subject line(for which ever reason they chose)

<?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 (c) 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']);
$order_number = tep_db_prepare_input($HTTP_POST_VARS['order_number']);
// BOF Super Contact us enhancement 1.0 
$order_id = tep_db_prepare_input($HTTP_POST_VARS['order_id']);
if ($order_id <> NULL){
		$enquiry = 'Order ID: ' . $order_id . "\n\n" . tep_db_prepare_input($HTTP_POST_VARS['enquiry']);
}else{
	$enquiry = tep_db_prepare_input($HTTP_POST_VARS['enquiry']);
}

$emailsubject = tep_db_prepare_input($HTTP_POST_VARS['reason']) . ' ' . EMAIL_SUBJECT;

switch ($HTTP_POST_VARS['reason']) {

case REASONS1:
$auto_send_to = '1';
break;

case REASONS2:
$auto_send_to = '1';
break;

case REASONS3:
$auto_send_to = '0';
break;

case REASONS4:
$auto_send_to = '1';
break;

case REASONS5:
$auto_send_to = '1';
break;

case REASONS6:
$auto_send_to = '2';
break;

default:
$auto_send_to = '1';
}

if (tep_validate_email($email_address)) {
if (CONTACT_US_LIST !=''){
	$send_to_array=explode("," ,CONTACT_US_LIST);
		preg_match('/\<[^>]+\>/', $send_to_array[$auto_send_to], $send_email_array);
	//preg_match('/\<[^>]+\>/', $send_to_array[$send_to], $send_email_array);
	$send_to_email= eregi_replace (">", "", $send_email_array[0]);
	$send_to_email= eregi_replace ("<", "", $send_to_email);

	//tep_mail(preg_replace('/\<[^*]*/', '', $send_to_array[$send_to]), $send_to_email, $emailsubject, $enquiry, $name, $email_address);
		tep_mail(preg_replace('/\<[^*]*/', '', $send_to_array[$auto_send_to]), $send_to_email, $emailsubject, $enquiry, $name, $email_address, $order_number);
}else{
  tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, '<STRONG>Name:</STRONG>  ' . $name . "\r\n" . '<STRONG>Order #:</STRONG>  ' . $order_number . "\r\n\r\n" . '  ' . $enquiry, $name, $email_address);
//////tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, $emailsubject, $enquiry, $name, $email_address);
}
// EOF Super Contact us enhancement 1.0

  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>
<?php
// Header Tag Controller 
if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {
 require(DIR_WS_INCLUDES . 'header_tags.php');
} else {
?> 
 <title><?php echo TITLE; ?></title>
<?php
}
// EOF  Header Tag Controller 
?>
<base href="<?php echo (getenv('HTTPS') == 'on' ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<script language="JavaScript">
<!--
function MM_reloadPage(init) {  //Updated by PVII. Reloads the window if Nav4 resized
 if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
 else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
</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="0" cellpadding="3">
<tr>
<td width="<?php echo BOX_WIDTH; ?>" valign="top" class="left"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="0">
<!-- 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>
<?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><table border="0" width="100%" cellspacing="0" cellpadding="2">
	  <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 align="right"><br><a href="<?php echo tep_href_link(FILENAME_DEFAULT, '', 'NONSSL'); ?>"><?php echo tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></a></td>
	  </tr>
	</table></td>
  </tr>
<!-- BOF Super Contact us enhancement 1.0 //-->
<?php
 } else {
 if (tep_session_is_registered('customer_id')) {
$account_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
$account = tep_db_fetch_array($account_query);

$name = $account['customers_firstname'] . ' ' . $account['customers_lastname'];
$email = $account['customers_email_address'];
 }
?>  

<tr>
<td>
	<table border="0" width="100%" cellspacing="0" cellpadding="0">
		<tr> 
			<td width="650" height="0"></td>
			<td width="600"></td>
		</tr>

		<tr> 
			<td rowspan="11" valign="top"> 
				<table width="100%" border="0" cellpadding="0" cellspacing="0">
			   		<tr> 
				   		<td colspan="2" align="left" valign="top" class="main"></td>
			   		</tr>
					<tr> 
						<td width="38" height="120" align="left" valign="top" class="main"></td>
							<td width="334" valign="top">
								  <table width="100%" border="0" cellpadding="0" cellspacing="0">
									<tr> 
										  <td width="333" height="120" align="left" valign="top" class="main">
										  <STRONG><?php echo nl2br(STORE_NAME_ADDRESS); ?></STRONG><br><br><br>
										  <?php echo (OPENING_HOURS); ?>
										  </td>
										  <td width="1"> </td>
			 						</tr>
								</table>
							</td>
					  </tr>
					<tr> 
						<td align="left" valign="top" class="main"><p> </p></td>
					</tr>
				</table>
			</td>
			<td height="40" valign="top" class="main">
				<?php echo ENTRY_NAME; ?><br>
				<?php echo tep_draw_input_field('name'); ?>
			</td> 
		</tr>
		<tr> 
			<td height="4"></td>
		</tr>
		<tr> 
			<td height="40" valign="top" class="main">
				<?php echo ENTRY_EMAIL; ?><br>
				<?php echo tep_draw_input_field('email'); ?>
			</td> 
		</tr>
		<tr> 
			<td height="40" valign="top" class="main">
				<?php echo ENTRY_ORDER_ID; ?><br>
				<?php echo tep_draw_input_field('order_id'); ?>
			</td> 
		</tr>
		<tr> 
			<td height="4"></td>
		</tr>

		<tr> 
			<td height="40" valign="top" class="main">
<!--
<?php 
	  if (CONTACT_US_LIST !=''){
				  echo SEND_TO_TEXT . '<br>';
			 if(SEND_TO_TYPE=='radio'){
			 foreach(explode("," ,CONTACT_US_LIST) as $k => $v) {
				if($k==0){
				$checked=true;
				}else{
				$checked=false;
				}
				echo tep_draw_radio_field('send_to', "$k", $checked). " " .preg_replace('/\<[^*]*/', '', $v);
			 }

		   }else{
			   foreach(explode("," ,CONTACT_US_LIST) as $k => $v) {
					$send_to_array[] = array('id' => $k, 'text' => preg_replace('/\<[^*]*/', '', $v));
				 }
			echo tep_draw_pull_down_menu('send_to',  $send_to_array);
		   }

		echo;
		}
?>
//-->
			</td> 
		</tr>
		<tr> 
			<td height="4"></td>
		</tr>
		<tr> 
			<td height="40" valign="top" class="main">
				<?php echo ENTRY_REASON; ?><br>
				<select name="reason">
					<?php echo '<option value="' . REASONS1 . '">' . REASONS1 . '</option>'; ?>
					<?php echo '<option value="' . REASONS2 . '">' . REASONS2 . '</option>'; ?>
					<?php echo '<option value="' . REASONS3 . '">' . REASONS3 . '</option>'; ?>
					<?php echo '<option value="' . REASONS4 . '">' . REASONS4 . '</option>'; ?>
					<?php echo '<option value="' . REASONS5 . '">' . REASONS5 . '</option>'; ?>
					<?php echo '<option value="' . REASONS6 . '">' . REASONS6 . '</option>'; ?>

				</select>
			</td> 
		</tr>
		<tr> 
			<td height="4"></td>
		</tr>
		<tr> 
			<td height="200" width="350" valign="top" class="main">
				<?php echo ENTRY_ENQUIRY; ?><BR>
				<!-- BOF This is the change for the Form Vunerability Fix //-->
				<?php echo tep_draw_textarea_field('enquiry', 'soft', 50, 15, tep_sanitize_string($_POST['enquiry']), '', false); ?>
				<!-- EOF This is the change for the Form Vunerability Fix //-->
			</td>
		</tr>
		<tr> 
			<td height="4"></td>
		</tr>
		<tr> 
			<td height="66" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
				<tr> 
					<td width="547" height="62" valign="top" align="middle"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
				</tr>
				<tr>
					<td height="4"></td>
				</tr>
			</table>
		</td>
	  </tr>
		<tr> 
			<td height="41" colspan="2" align="left" class="main"><br> </td>
		</tr>
			</table>
			</td>
		</tr>
		<tr>
			<td height="41" colspan="2" align="left" class="main"><br> </td>
		</tr>
<?php
 }
?>
<!-- EOF Super Contact us enhancement 1.0 //-->
</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 //-->
<!-- right_navigation_eof //-->
</table></td>
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

Eric

Edited by matrix2223

Eric

 

Keep up on osCommerce changes and updates at

Github | Understand osCommerce a little further at OsCommerce Documentation | Copy and paste your error message in Google add "in osCommerce" at the end to get relevant answers to most issues.

Share this post


Link to post
Share on other sites

I tried Matrix2223 code but I get the error

Parse error: parse error, unexpected ',' in /homepages/26/d96678039/htdocs/buy-citizenship-study-guide/contact_us.php on line 73

 

I don't know how to fix it as there doesn't seem to be any ',' on line 73.

 

Can anyone help with this?

 

 

For anyone who still hasnt found the answer to the "Not sending of emails, not going to the success page and other things"

 

Here is your answer I reworked and modified it abit but basically I had to start from scratch because none of them worked here is my contact_us.php

 

And this will show the Customers name, order number and message that they typed in the form and will also show the reason why in the email subject line(for which ever reason they chose)


Mary-Ann

Chief Cook and Bottlewasher

Jack-of-All-Trades

Running 2.2MS2

Share this post


Link to post
Share on other sites

Maybe a silly question, but how do I get a linebreak between each contact form email I have entered?

Share this post


Link to post
Share on other sites

Any idea how to add an ATTACHMENT feature to the email form? I need to have users submit .jpgs. Of course, a button would need to be created.

Share this post


Link to post
Share on other sites

Hi all

Great contribution,

I had some problem installing it earlier, when i changed

echo tep_draw_pull_down_menu('send_to',  $send_to_array);
		                             }

		                            echo ;

 

to

echo tep_draw_pull_down_menu('send_to',  $send_to_array);
		   }

		echo (''); 

 

It is working fine, dont understand reason.

now, COntact us form sending email, but I am recieving same email twice in mailbox, dont understand the reason.

other then that all perfect.

 

thanks for this great contribution.

regards

zee

Share this post


Link to post
Share on other sites

Hi

 

Im have tryed all the release but all i get is a blank page.

 

I have spent hours trying to find the problem.

 

Could some one see if they can see a problem

 

Thanks

 

<?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']);

 

// BOF Super Contact us enhancement 1.4

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

if ($order_id <> NULL){

$enquiry = 'Order ID: ' . $order_id . "\n\n" . tep_db_prepare_input($HTTP_POST_VARS['enquiry']);

}else{

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

}

 

$emailsubject = tep_db_prepare_input($HTTP_POST_VARS['reason']) . ' ' . EMAIL_SUBJECT;

if (tep_validate_email($email_address)) {

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

if (CONTACT_US_LIST !=''){

$send_to_array=explode("," ,CONTACT_US_LIST);

preg_match('/\<[^>]+\>/', $send_to_array[$send_to], $send_email_array);

$send_to_email= eregi_replace (">", "", $send_email_array[0]);

$send_to_email= eregi_replace ("<", "", $send_to_email);

 

tep_mail(preg_replace('/\<[^*]*/', '', $send_to_array[$send_to]), $send_to_email, $emailsubject, $enquiry, $name, $email_address);

}else{

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

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

 

// EOF Super Contact us enhancement 1.4

 

} 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_LEFT_IS; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH_LEFT_IS; ?>" cellspacing="0" cellpadding="2">

<!-- left_navigation //-->

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

<!-- left_navigation_eof //-->

</table></td>

<!-- body_text //-->

<?php echo mws_header_main (''); ?>

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

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

<!-- BOF Super Contact us enhancement 1.4 //-->

<?php

} else {

if (tep_session_is_registered('customer_id')) {

$account_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");

$account = tep_db_fetch_array($account_query);

 

$name = $account['customers_firstname'] . ' ' . $account['customers_lastname'];

$email = $account['customers_email_address'];

}

?>

<tr><td>

 

<table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">

<tr class="infoBoxContents"><td><table><tr>

<td class="main" valign="top" width=40%><b><?php echo nl2br(STORE_NAME_ADDRESS); ?></b><br><br>

<?php echo (OPENING_HOURS); ?><br><br></td>

<td class="main" valign="top" width="60%"><?php echo ENTRY_NAME; ?><br>

<?php echo tep_draw_input_field('name'); ?><br />

<?php echo ENTRY_EMAIL; ?><br>

<?php echo tep_draw_input_field('email'); ?><br />

<?php echo ENTRY_ORDER_ID; ?><br>

<?php echo tep_draw_input_field('order_id'); ?><br />

<?php

if (CONTACT_US_LIST !=''){

echo SEND_TO_TEXT . '<br>';

if(SEND_TO_TYPE=='radio'){

foreach(explode("," ,CONTACT_US_LIST) as $k => $v) {

if($k==0){

$checked=true;

}else{

$checked=false;

}

echo tep_draw_radio_field('send_to', "$k", $checked). " " .preg_replace('/\<[^*]*/', '', $v);

}

 

}else{

foreach(explode("," ,CONTACT_US_LIST) as $k => $v) {

$send_to_array[] = array('id' => $k, 'text' => preg_replace('/\<[^*]*/', '', $v));

}

echo tep_draw_pull_down_menu('send_to', $send_to_array);

}

 

echo ;

}

?>

<?php echo ENTRY_REASON; ?><br>

<select name="reason">

<?php echo '<option value="' . REASONS1 . '">' . REASONS1 . '</option>'; ?>

<?php echo '<option value="' . REASONS2 . '">' . REASONS2 . '</option>'; ?>

<?php echo '<option value="' . REASONS3 . '">' . REASONS3 . '</option>'; ?>

<?php echo '<option value="' . REASONS4 . '">' . REASONS4 . '</option>'; ?>

<?php echo '<option value="' . REASONS5 . '">' . REASONS5 . '</option>'; ?>

<?php echo '<option value="' . REASONS6 . '">' . REASONS6 . '</option>'; ?>

 

</select><br />

<?php echo ENTRY_ENQUIRY; ?><BR>

<?php echo tep_draw_textarea_field('enquiry', 'soft', 50, 15, tep_sanitize_string($_POST['enquiry']), '', false); ?>

<br />

</td></tr></table></td>

</tr>

</table>

<br />

<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

}

?>

<!-- EOF Super Contact us enhancement 1.4 //-->

 

</table></form></td>

<?php echo mws_footer_main (''); ?>

<!-- body_text_eof //-->

<td width="<?php echo BOX_WIDTH_RIGHT_IS; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH_RIGHT_IS; ?>" 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'); ?>

Share this post


Link to post
Share on other sites

can any one help.

 

Just install on a fresh install and still coming up with a blank page.

 

am i missing somthing

 

would realy like this to work.

 

 

Thanks

Share this post


Link to post
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

×