Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

JDC Contact Us


Guest

Recommended Posts

Hi there, I am using the contribution for the Contact Form which allows the user to select which department they would like the form to go to. I don't get any errors but when I test the form and click the submit button. The button does not seem to do anything and I don't get my email?

 

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

  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, EMAIL_SUBJECT, $enquiry, $name, $email_address);
}else{
		  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 XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<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="style.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 //-->

<tr>
<td width="182" align="left" valign="top">
<table width="182" cellpadding="0" cellspacing="0" border="0">
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
</table>
</td>
<td width="509" valign="top" style="padding-left:2px;">

	<table border="0" cellpadding="0" cellspacing="0" width="620">
		<tr>
						<td width="100%" height="100%" valign="top" bgcolor="#FFFFFF">

							<table border="0" width="100%" cellpadding="0" cellspacing="0" >
								<tr>
								<td width="100%" height="25" valign="top">
											<table width="100%" border="0" cellpadding="0" cellspacing="0" height="24">
	<tr>
		<td><img src="images/left_header.gif" width="4" height="24" alt="" /></td>
		<td width="100%" style="background-image:url(images/header_bg.gif); text-align:left; color:#FFF; padding-left:5px; font-size:110%; font-weight:bold "><?php
										echo HEADING_TITLE; ?>   
											</td>
		<td><img src="images/right_header.gif" width="4" height="24" alt="" /></td>			
	</tr>
</table>
	   											</td>
								</tr>

								<tr>
								<td valign="top" height="409" style="padding:0px 5px; " class="infoBox">
								<table border="0" cellpadding="0" cellspacing="0" width="100%">





	 <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '1'); ?></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="0" >
  <tr>
	<td class="main" align="center"><?php echo TEXT_SUCCESS; ?></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td align="left"><table border="0" width="100%" cellspacing="1" cellpadding="2" >
	  <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>
  </table></td></tr>
<?php
 } else {
?>

  <tr>
	<td align="left" ><table border="0" width="100%" cellspacing="5" cellpadding="5">
	  <tr class="infoBoxContents">

		<td width="100%" style="padding:5px; "><table border="0" width="100%" cellspacing="0" cellpadding="2">
		<tr>
			<!--<td class="main" ><?php echo ENTRY_EMAIL; ?></td> -->
			<?php 
	  if (CONTACT_US_LIST !=''){
				  echo '<tr><td class="main">'. SEND_TO_TEXT. '</td></tr>'
			 		.'<tr><td class="main">';
			 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)."<br>\n";
			 }

		   }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 "\n</td></tr>\n";

		}
		 ?>
</tr>
		  <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 align="left" style="padding-left:3px; "><?php echo tep_draw_textarea_field('enquiry', 'soft', 30, 7); ?></td>
		  </tr>
		</table></td>
	  </tr>
	  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td colspan="2"><table border="0" width="100%" cellspacing="1" cellpadding="2" >
	  <tr class="infoBoxContents">
		<td align="left"><table border="0" width="180" 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>
   <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>

Link to comment
Share on other sites

Funny how silly little things like <form> tags can make a difference... at least my button is working now. I am still not getting the email but I am one step closer!

Link to comment
Share on other sites

Funny how silly little things like <form> tags can make a difference... at least my button is working now. I am still not getting the email but I am one step closer!

 

I'm having the same problem with a fresh install. Could you please tell me where you placed the form tags? Thanks in advance

 

-Caroofikus

Link to comment
Share on other sites

Hi there, the opening tag I put in after you close the column left.

 

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
</table>
</td>
<td width="509" valign="top" style="padding-left:2px;">

	<form><table border="0" cellpadding="0" cellspacing="0" width="620">

 

the closing form tag was already there... right at the bottom of the page, just before you include the footer.

<?php
 }
?>
</table></td></tr>  </table></td>
								</form>

 

 

I hope this helps... I am still trying to get my from to send to my required email address. If you get it right please let me know.

Link to comment
Share on other sites

Hi there... my form is still not being sent to my selected department... any help will be greatly appreciated.

Have you tried the super contact enhancement instead of this very old contribution?

Link to comment
Share on other sites

No joy!!! I installed the Super Enhancement Contact Us... still not receiving the mail but I like the features.

I had a look at http://www.oscommerce.com/forums/index.php?showtopic=195314

 

Didn't find a solution there... will add a post on that thread. I am wondering if its not because my contact form is part of a template design and not the original contact us page?!

Link to comment
Share on other sites

  • 3 weeks later...
I'm having the same problem with a fresh install. Could you please tell me where you placed the form tags? Thanks in advance

 

-Caroofikus

 

My contact_us.php was missing a the <form> tag too but it did not make it start working... Still in the dark. I figure it has to be something simple but I have looked everywhere I can think of.

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