Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Super Contact us enhancement 1.0


John-Peter

Recommended Posts

Hello,

 

 

Thank you for the wonderful contribution. I've just installed it, but all I receive in the email is the "Enquiry" text, no Name or Email Address in the body of the email.

 

Does this script normally add this information within the body of the email?

 

If not, is there any way to add this information to the body of email text?

 

My contact_us.php file is below. There are some minor modifications that do not affected the results, I have the same issue regardless.

 

BTW, if anyone knows how to add a new field for "company" to the email, that would be greatly appreciated.

 

Thank you in advance for your help!

 

Regards,

 

Dick

 

<?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.0 
$company = tep_db_prepare_input($HTTP_POST_VARS['company']);
$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, $company);
}else{
  tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, $emailsubject, $enquiry, $name, $email_address, $company);
}
// 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>
<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="0" cellpadding="0">
 <tr>
<!-- 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>
	  </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"><?php echo tep_image(DIR_WS_IMAGES . '', 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.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="290" height="0"></td>
			<td width="592"></td>
		</tr>

		<tr> 
			<td rowspan="11" valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
				  <td width="10"> </td>
				  <td width="200" class="main"><?php echo (CONTACT_INFO); ?></td>
				</tr>
			  </table></td>
			<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="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> 
			<td height="4"></td>
		</tr>
		<tr> 
			<td height="40" valign="top" class="main">
				<?php echo ENTRY_COMPANY; ?><br>
				<?php echo tep_draw_input_field('company'); ?>
			</td> 
		</tr> 
			<td height="4"></td>
		</tr>			
		<tr> 
			<td height="200" width="592" 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>
			</table>
		</td>
	  </tr>
			</table>
			</td>
		</tr>
<?php
 }
?>
<!-- EOF Super Contact us enhancement 1.0 //-->
</table></form></td>
<!-- body_text_eof //-->
 </tr>
</table>
<!-- body_eof //-->

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

Link to comment
Share on other sites

  • Replies 339
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Hello,

Thank you for the wonderful contribution. I've just installed it, but all I receive in the email is the "Enquiry" text, no Name or Email Address in the body of the email.

 

Does this script normally add this information within the body of the email?

 

If not, is there any way to add this information to the body of email text?

 

My contact_us.php file is below. There are some minor modifications that do not affected the results, I have the same issue regardless.

 

BTW, if anyone knows how to add a new field for "company" to the email, that would be greatly appreciated.

 

Thank you in advance for your help!

 

Regards,

 

Dick

 

Dick,

 

I will check your code today but You supposed to see all the information. Here an example of an email when you use my contrib below.

 

Super_contact-email.jpg

John

--------------------

osCommerce 2.3.4 Bootstrap Edge

Link to comment
Share on other sites

  • 3 weeks later...

I am trying to install the "Super Contact Us Enhancement 1.1 and can't seem to get past step1 (typical newbie!!)

 

In the Readme file it sayS

 

Run the following MySQL query in phpMyadmin, or use the contact.sql file provided with this contribution.

 

INSERT INTO configuration SET configuration_title='Set "Contact Us" Email List', date_added=NOW(), sort_order='11', configuration_group_id='1', configuration_key='CONTACT_US_LIST', configuration_value= '', configuration_description='On the "Contact Us" Page, set the list of email addresses , in this format: Name 1 <email@address1>, Name 2 <email@address2>', use_function = NULL , set_function = NULL;

 

This is made to add your email departement via the admin panel. Go to the admin panel and :

 

Select Configuration

Select Store

Edit the section --> Set "Contact Us" Email List

 

And enter your email like this :

 

Example: Sales <[email protected]>, Support <[email protected]> etc....

 

I don't know what it means when it says "Run the following MySQL query in PHPMyadmin so I have made a copy of my configuration.php file and have tried to amend that manually but I don't know where to "INSERT INTO.... at which point in my configure.php should I add this text.

 

Can anyone help - all I want to be able to do is add our Name and Address to the "Contact Us" form and this is the only contribution I can find that appears to do that.

 

Any help greatly appreciated

:)

Link to comment
Share on other sites

I am trying to install the "Super Contact Us Enhancement 1.1 and can't seem to get past step1 (typical newbie!!)

 

In the Readme file it sayS

 

Run the following MySQL query in phpMyadmin, or use the contact.sql file provided with this contribution.

 

INSERT INTO configuration SET configuration_title='Set "Contact Us" Email List', date_added=NOW(), sort_order='11', configuration_group_id='1', configuration_key='CONTACT_US_LIST', configuration_value= '', configuration_description='On the "Contact Us" Page, set the list of email addresses , in this format: Name 1 <email@address1>, Name 2 <email@address2>', use_function = NULL , set_function = NULL;

 

This is made to add your email departement via the admin panel. Go to the admin panel and :

 

Select Configuration

Select Store

Edit the section --> Set "Contact Us" Email List

 

And enter your email like this :

 

Example: Sales <[email protected]>, Support <[email protected]> etc....

 

I don't know what it means when it says "Run the following MySQL query in PHPMyadmin so I have made a copy of my configuration.php file and have tried to amend that manually but I don't know where to "INSERT INTO.... at which point in my configure.php should I add this text.

 

Can anyone help - all I want to be able to do is add our Name and Address to the "Contact Us" form and this is the only contribution I can find that appears to do that.

 

Any help greatly appreciated

:)

 

Hi.

This means you need to run the MySql Query on the database, not on any of the php files. Download and install phpMyAdmin if you havent already. Then select your OSC database on the left and paste the query into a 'Run SQL Query' field and press Go.

Link to comment
Share on other sites

Hello and thanks for a great contribution.

 

It looks and works great.

 

I am looking to making it more secure agains user errors, so I wanted to send the emails to the correct department automatically.

 

Like this: Reason 1 gets sent to the webmaster, Reason 2 gets sent to order management and so on.

 

This eliminates the need for the email selection field on the form.

 

Unfortunately, my form coding is not up to par, so I dont know how to make the form select the proper email address based on the Reason selection.

 

Anyone?

Link to comment
Share on other sites

Hi, I just installed the latest version 1.2 of PelleonUK, dated 7th of may 2006. I get an syntax error on my contact_us.php page. It looks like this:

 

Parse error: syntax error, unexpected ';' in /customers/kjolebutikken.com/kjolebutikken.com/httpd.www/oscdemo1/contact_us.php on line 234

 

I cannot figure out how to solve this. Can anyone help? I can pm or post my file if necessary.

 

Thanks,

Kjolebutikken

Best regards

Kjolebutikken

Link to comment
Share on other sites

I have had no luck installing this mod, I have installed 4 times and everytime I get a blank contact page with nothing on it.

 

Here is my contact page without the mod added.

 

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

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

 

</tr>

 

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

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

<td class="main" align="middle"> We will try to answer all enquires or comments within 24 hours, <br>please add your contact number in the comments section if <br>your request is urgent.<br><br><br><strong>All Balls Pocket Racing </strong><br>ABN 77 223 630 068<br>

PO Box 625<br>

Beaconsfield Victoria 3807 Australia<br>

<strong>Telephone (03) 9769 8146</strong>   Fax (03) 9769 8142<br><br><strong>Mobile Contact No's </strong><br>Steve 0411 477 497     Bryan 0418 586 128 </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'); ?>

Link to comment
Share on other sites

Hi, I just installed the latest version 1.2 of PelleonUK, dated 7th of may 2006. I get an syntax error on my contact_us.php page. It looks like this:

 

Parse error: syntax error, unexpected ';' in /customers/kjolebutikken.com/kjolebutikken.com/httpd.www/oscdemo1/contact_us.php on line 234

 

I cannot figure out how to solve this. Can anyone help? I can pm or post my file if necessary.

 

Thanks,

Kjolebutikken

 

Hi,

I solved the problem with one of the other posts in this thread:-)

I also had to change echo ; to echo ('');

Then it worked ?!?!!

 

Thanks,

Kjolebutikken

Best regards

Kjolebutikken

Link to comment
Share on other sites

I solved my need for automatic recipients of the email based on the reason for the question.

 

Find this line in the top section of contact_us.php around line 23:

 

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

 

INSERT this section right after:

 

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

}

 

The numbers for the $auto_send_to variable refers to the sequence of the email addresses in the database, '0' being the first and so on. Change it to your own setup in reference to your reasons.

 

Next, find this line just below:

 

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

 

REPLACE it with:

 

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

 

I also commented out the whole section dealing with the recipient selection, you will find this around line 235.

 

As you can see I just put HTML comments before and after.

 

<!--

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

}

?>

 

//-->

 

 

Thats it. I found this very useful and I hope someone else can use it.

 

Cheers.

Link to comment
Share on other sites

Hi, I have just installed this contribution, and I had to "move around" the objects of the page a little to suit my need, but I'm not satisfied with how it looks. I hope someone can help me.

 

Heres the link to my contact_us page:

 

http://www.kjolebutikken.com/oscdemo1/contact_us.php

 

1. I wonder if it is possible to get the message field wider, so that it spans over the whole with of the page.

2. If the above is not possible, is it then possible to move the continue button ("fortsett") up and to the right, so that it is plased just beside the message field?

 

Here is my contact_us.php file so you can see how it is:

 

<?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.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;
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);
}
// 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>
<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.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="0" 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="80" align="left" valign="top" class="pageHeading"><h5>
<STRONG><?php echo nl2br(STORE_NAME_ADDRESS); ?></STRONG><br>
<STRONG>E-post: <?php echo nl2br(STORE_OWNER_EMAIL_ADDRESS); ?></STRONG>
<tr>
<td width="333" height="100" align="left" valign="top" class="main">

<?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> 
					   <tr> 
		<td height="10" width="100" align="left" class="main"><p> </p></td>
					</tr>
					   <td height="0" width="547" 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="100" 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></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'); ?>

 

Thanks:-)

Kjolebutikken

Best regards

Kjolebutikken

Link to comment
Share on other sites

Forgot one last line that needs to be edited for my previous post to work properly.

 

Around line 35, find this:

 

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

 

REPLACE it with:

 

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

Link to comment
Share on other sites

Hi, I have just installed this contribution, and I had to "move around" the objects of the page a little to suit my need, but I'm not satisfied with how it looks. I hope someone can help me.

 

Heres the link to my contact_us page:

 

http://www.kjolebutikken.com/oscdemo1/contact_us.php

 

1. I wonder if it is possible to get the message field wider, so that it spans over the whole with of the page.

2. If the above is not possible, is it then possible to move the continue button ("fortsett") up and to the right, so that it is plased just beside the message field?

 

To change the width alter this line around 499:

 

<td height="0" width="547" valign="top" class="main">

 

to:

 

<td colspan= "2" height="0" width="547" valign="top" class="main">

 

cheers :)

Edited by athyholdt
Link to comment
Share on other sites

To change the width alter this line around 499:

 

<td height="0" width="547" valign="top" class="main">

 

to:

 

<td colspan= "2" height="0" width="547" valign="top" class="main">

 

cheers :)

 

Wow!!! Thanks:-)

I tried for two hours before I gave up, and it was that simple, he, he.

Well, now I learned something new:-)

 

You wouldn't by any chance also know if it is possible to get more room between the adress / text and the fields for name, e-mail, order etc. I mean move the fields a bit to the right to get more space in the middle, if you know what I mean???

 

Thank you

Kjolebutikken!

Best regards

Kjolebutikken

Link to comment
Share on other sites

You wouldn't by any chance also know if it is possible to get more room between the adress / text and the fields for name, e-mail, order etc. I mean move the fields a bit to the right to get more space in the middle, if you know what I mean???

 

Sure, as long as I know how, I will try to help.

 

Find this line at around 328 in your file (line numbers are from the text I copied from this subject) right after the echo (OPENING_HOURS) lines:

 

<td width="1"> </td>

 

change to:

<td width="40"> </td>

 

Substitute 40 with your desired width.

 

PS: Whenever I try to modify tables, I always turn on the borders with a border="1" option in the table statement. That way it is much easier to see whats going on. Lately, I've started to use Firefox with the web developer extension to troubleshoot tables as I dont have to modify the source code to show the borders.

 

Cheers :)

Link to comment
Share on other sites

Sure, as long as I know how, I will try to help.

 

Find this line at around 328 in your file (line numbers are from the text I copied from this subject) right after the echo (OPENING_HOURS) lines:

 

<td width="1"> </td>

 

change to:

<td width="40"> </td>

 

Substitute 40 with your desired width.

 

PS: Whenever I try to modify tables, I always turn on the borders with a border="1" option in the table statement. That way it is much easier to see whats going on. Lately, I've started to use Firefox with the web developer extension to troubleshoot tables as I dont have to modify the source code to show the borders.

 

Cheers :)

 

Nice work... It's a plus for this contribution. I will add this in the future version.

:thumbsup:

John

--------------------

osCommerce 2.3.4 Bootstrap Edge

Link to comment
Share on other sites

Sure, as long as I know how, I will try to help.

 

Find this line at around 328 in your file (line numbers are from the text I copied from this subject) right after the echo (OPENING_HOURS) lines:

 

<td width="1"> </td>

 

change to:

<td width="40"> </td>

 

Substitute 40 with your desired width.

 

PS: Whenever I try to modify tables, I always turn on the borders with a border="1" option in the table statement. That way it is much easier to see whats going on. Lately, I've started to use Firefox with the web developer extension to troubleshoot tables as I dont have to modify the source code to show the borders.

 

Cheers :)

 

Hi Andreas,

Thank you so much for all your help. It worked perfectly:-)

Kjolebutikken

Best regards

Kjolebutikken

Link to comment
Share on other sites

Hi,

 

I liked the end result so much that I wanted to use my updated contact_us file another place om my site. I have a page called Feedback (Kommentarer & Tips) which is for the cusomers to e-mail me if they have any suggestions for new ideas for the page or comments about it. The form I had did not work like I wanted it to and I thought I could use the same code as in the contact_us page instead, and only change the options in the dropdown menu and the text and headline etc.

 

I copied the code from contact_us.php to my feedback.php file and I also copied the code form includes/languages/norwegian/contact_us.php to my file includes/languages/norwegian/feedback.php

 

My problem is that when I change the options and the text in the feedback language file, nothing happens.

 

I wonder if anyone can tell me if I'm doing something wrong? Do I have to change something in my database also? If yes, what sql query do I have to put in my phpmyadmin to get this to work?

 

Thanks:-)

Kjolebutikken

Best regards

Kjolebutikken

Link to comment
Share on other sites

Hi,

 

I liked the end result so much that I wanted to use my updated contact_us file another place om my site. I have a page called Feedback (Kommentarer & Tips) which is for the cusomers to e-mail me if they have any suggestions for new ideas for the page or comments about it. The form I had did not work like I wanted it to and I thought I could use the same code as in the contact_us page instead, and only change the options in the dropdown menu and the text and headline etc.

 

I copied the code from contact_us.php to my feedback.php file and I also copied the code form includes/languages/norwegian/contact_us.php to my file includes/languages/norwegian/feedback.php

 

My problem is that when I change the options and the text in the feedback language file, nothing happens.

 

I wonder if anyone can tell me if I'm doing something wrong? Do I have to change something in my database also? If yes, what sql query do I have to put in my phpmyadmin to get this to work?

 

Thanks:-)

Kjolebutikken

 

 

You probably have'nt remembered to change the require statement that actually reads in the language file in the beginning of feedback.php, so its still reading from the contact_us.php language file.

 

Find near line 15:

 

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

 

Change it to:

 

require(DIR_WS_LANGUAGES . $language . '/' . 'feedback.php');

 

(or if you have defined your feedback.php in filenames.php, to your variable name, such as FILENAME_FEEDBACK)

 

That should do the trick.

 

Cheers.

Link to comment
Share on other sites

You probably have'nt remembered to change the require statement that actually reads in the language file in the beginning of feedback.php, so its still reading from the contact_us.php language file.

 

Find near line 15:

 

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

 

Change it to:

 

require(DIR_WS_LANGUAGES . $language . '/' . 'feedback.php');

 

(or if you have defined your feedback.php in filenames.php, to your variable name, such as FILENAME_FEEDBACK)

 

That should do the trick.

 

Cheers.

 

That was just it. Thank you so much. Really appreciate it. Now it works like a charm:-)

Best regards to you

Kjolebutikken

Best regards

Kjolebutikken

Link to comment
Share on other sites

Hi, could anyone help me arrange this contribution to be just like the original contactus layout.

 

i.e.

1. The continue button is in a seperate box aligned to the right

2. The Text boxes are aligned to the left with the shop text on the opposite side surounded by border

3. The Enquiry box takes the full page width.

 

Also when i am sent the emails the header arrives like this General Inquiry Enquiry From Oscommerce

 

btw I installed the version with order id so I think the contactus file is slightly different.

 

Thanks B)

Link to comment
Share on other sites

Shayne,

 

Ok I got it working, you must install my contrib and after do the following :

 

Search the lines in catalog/contact_us.php :

 

	} else {
  $error = true;

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

 

Add just after it, the following lines :

//VISUAL VERIFY CODE start
 require(DIR_WS_FUNCTIONS . 'visual_verify_code.php');

$code_query = tep_db_query("select code from visual_verify_code where oscsid = '" . tep_session_id($HTTP_GET_VARS[tep_session_name()]) . "'");
$code_array = tep_db_fetch_array($code_query);
$code = $code_array['code'];

tep_db_query("DELETE FROM " . TABLE_VISUAL_VERIFY_CODE . " WHERE oscsid='" . $vvcode_oscsid . "'"); //remove the visual verify code associated with this session to clean database and ensure new results

$user_entered_code = $HTTP_POST_VARS['visual_verify_code'];
if (!(strcasecmp($user_entered_code, $code) == 0)) {	//make the check case insensitive
	$error = true;
	$messageStack->add('contact', VISUAL_VERIFY_CODE_ENTRY_ERROR);
}
//VISUAL VERIFY CODE stop

 

Then search for the following lines :

 

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

 

Add the following lines just after it :

 

<!-- VISUAL VERIFY CODE-- START-->
		<tr>
			<td class="main">
				<?php echo VISUAL_VERIFY_CODE_CATEGORY; ?>
				<br>
				<?php echo VISUAL_VERIFY_CODE_TEXT_INSTRUCTIONS; ?> <?php echo tep_draw_input_field('visual_verify_code'); ?>
			  <?php
			  //can replace the following loop with $visual_verify_code = substr(str_shuffle (VISUAL_VERIFY_CODE_CHARACTER_POOL), 0, rand(3,6)); if you have PHP 4.3
			  $visual_verify_code = "";
			  for ($i = 1; $i <= rand(3,6); $i++){
			  $visual_verify_code = $visual_verify_code . substr(VISUAL_VERIFY_CODE_CHARACTER_POOL, rand(0, strlen(VISUAL_VERIFY_CODE_CHARACTER_POOL)-1), 1);
			  }
			  $vvcode_oscsid = tep_session_id($HTTP_GET_VARS[tep_session_name()]);
			  tep_db_query("DELETE FROM " . TABLE_VISUAL_VERIFY_CODE . " WHERE oscsid='" . $vvcode_oscsid . "'");
			  $sql_data_array = array('oscsid' => $vvcode_oscsid, 'code' => $visual_verify_code);
			  tep_db_perform(TABLE_VISUAL_VERIFY_CODE, $sql_data_array);
			  $visual_verify_code = "";
			  echo('<img src="' . FILENAME_VISUAL_VERIFY_CODE_DISPLAY . '?vvc=' . $vvcode_oscsid . '"');
			  ?> <?php echo VISUAL_VERIFY_CODE_BOX_IDENTIFIER; ?>
			</td>
		</tr>
		<tr> 
			<td height="4"></td>
		</tr>			
<!-- VISUAL VERIFY CODE-- STOP -->

 

That's it, it's should be work. I have included in this the Cookie fix for VVC :rolleyes: . Let me know if all the thing is ok for you....

 

 

 

Hello Jeep_ice, you have done a great job coming up with this contribution! I implemented your contribution together with VVC and it kinda work. It sent the emails despite a wrong entry or no entry in the VVC box. Any ideas on how to resolve this issue? Thks!

 

MaRtin

Link to comment
Share on other sites

Hello Jeep_ice, you have done a great job coming up with this contribution! I implemented your contribution together with VVC and it kinda work. It sent the emails despite a wrong entry or no entry in the VVC box. Any ideas on how to resolve this issue? Thks!

 

MaRtin

Martin,

 

Thank you, yes the only problem is the continue button and the submit button from the VVC code. We have to adjust the code and when I will have time, i will do it... Time, time, time..... :rolleyes:

John

--------------------

osCommerce 2.3.4 Bootstrap Edge

Link to comment
Share on other sites

Martin,

 

Thank you, yes the only problem is the continue button and the submit button from the VVC code. We have to adjust the code and when I will have time, i will do it... Time, time, time..... :rolleyes:

 

 

Dear Enigma1,

 

Thks for replying! Its a wonderful thing to the community that we have such a dedicated contributor like u! Keep it up! U can PM me anytime when u've got a new release!

 

Martin

Link to comment
Share on other sites

  • 2 weeks later...

When a customer sends mail through contact_us.php

 

it appears to the customer as though it was successful....

 

but infact no mail is ever sent.

 

I checked admin...and it all looks correct so i contacted the server provider.

 

they looked at contact_us.php and tested the email I have with them...and replied me with,

 

"there is no mail ID set in the script to which the enquiery has to be sent. This is the reason why the sending of the mails is failing."

 

I have contact_us.php below but have no idea....and it has been hard to get an answer,

 

I have checked and rechecked admin at least 10 times now!,

 

COME ON GUYS Please help!

QUOTE

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

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

}

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

<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="0" cellpadding="0">

<tr>

<td width="<?php echo BOX_WIDTH; ?>" class="A3" valign="top"><table border="0" width="90%" 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="6">

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

</tr>

<tr>

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

<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_HOME) . '">' . 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.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></form></td>

<!-- body_text_eof //-->

 

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...