Hi there, hopefully someone that uses OSCommerce can help me here. I have posted this on the OSCommerce forum too.
I am using the JDC Contact Us Contribution. My problem is that when I click on the submit button it does not do anything so I figured its a coding issue somewhere. I don't get any errors.
Here is my code.
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>