Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Contact Us page error


shova

Recommended Posts

Hi, I'm having a few problems with my contact_us.php page. Whenever I click the continue button nothing happens. It sounds like a form function error, but as I am not very experienced with php I fail to find a solution.

 

Thanks in advance,

 

In case you need my contact_us.php code here it is

 

 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="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="173" align="right" valign="top" bgcolor="#FFFFFF">
<table width="171" cellpadding="0" cellspacing="0" border="0">
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
</table>
</td>
<td width="557" valign="top" align="left">
	<table border="0" cellpadding="0" cellspacing="0" width="555">
		<tr>
						<td width="100%" height="100%" valign="top" bgcolor="#FFFFFF" >

							<table border="0" width="100%" cellpadding="0" cellspacing="0" >
								<tr>
								<td width="100%" height="19" valign="top" >
											<div class="header"><img src="images/marker_header.gif" width="3" height="5" alt="" style="margin:0px 6px 2px 0px;" />
											<?php
										echo HEADING_TITLE; ?></div>   

	   											</td>
								</tr>
								<tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '1'); ?></td>
  </tr>
								<tr>
								<td valign="top" height="416" 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="1" cellpadding="2">
	  <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_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>
  <tr>
		<td colspan="2" height="1" background="images/hpoint.gif" align="left"><img src="images/hpoint.gif" width="3" height="1" alt=""></td>
</tr>
<tr>
		<td colspan="2" height="1" background="images/hpoint.gif" align="left" style="margin-top:2px;"><img src="images/hpoint.gif" width="3" height="1" alt=""></td>
</tr>
<tr>
	<td colspan="2" align="left">
	<Table border="0" cellpadding="0" cellspacing="0" >
	<tr align="left">
	<td width="50%" style="padding-left:20px;"><br/><span style="font-weight:bold;">Phone:</span> 1-800-555-55-55<br>
<br/>
<span style="font-weight:bold;">Fax:</span> 1-800-555-55-55</td>
	<td width="50%" style="padding-left:20px;"> 

<br/><span style="font-weight:bold;">E-mail:</span> ***************<br>
<br/>
<span style="font-weight:bold;">Toll Free:</span> 1-800-555-55-55</td>
	</tr></table></td>
</tr>
	</table></td>
  </tr>

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














					</tr>


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




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

I've provided the source, becuse im currently editing other parts of the site, i.e. changing file and folder locations.

 

Basically when you click the button 'continue' nothing happens....

 

Thanks :rolleyes:

Link to comment
Share on other sites

I've provided the source, becuse im currently editing other parts of the site, i.e. changing file and folder locations.

 

Basically when you click the button 'continue' nothing happens....

 

Thanks :rolleyes:

 

have you edited the site files lately? (Contact_us.php for example)

Regards

 

Mark A Reynolds

Link to comment
Share on other sites

have you edited the site files lately? (Contact_us.php for example)

 

here's a brilliant idea. If you can see an error in the code i posted, then I would love your help. If you cant help, then stop wasting forum space.

Link to comment
Share on other sites

Here is a better idea - lose the attitude especially when you are asking for help.

 

You were asked for the URL of your site so that the contact_us.php page could be requested and the continue button clicked to determine the url that the page is attempting to redirect to.

 

Instead of responding with the URL that was requested in order to provide assistance, you throw attitude. Nobody wants to help a jerk. ;)

 

here's a brilliant idea. If you can see an error in the code i posted, then I would love your help. If you cant help, then stop wasting forum space.

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

Here is a better idea - lose the attitude especially when you are asking for help.

 

You were asked for the URL of your site so that the contact_us.php page could be requested and the continue button clicked to determine the url that the page is attempting to redirect to.

 

Instead of responding with the URL that was requested in order to provide assistance, you throw attitude. Nobody wants to help a jerk. ;)

 

Sorry. www.shova.co.uk/bb/contact_us.php

Link to comment
Share on other sites

the reason that nothing happens is because your contact us form is not defined anywhere. There is no reason to see the actual url because I do not see the form tag being opened. I would expect to see the tep_draw_form function in your source file. But I guess due to the site customizations you may missed it.

 

So you could download the original osc contact us page and see how it sets up the form. Basically you should include something like this in the beginning of the html body

 

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

Link to comment
Share on other sites

DUDE!!!! YOU ARE A GODSEND!!!! I LOVE YOU!!! Thanks you for helping me...Now it WORKS!! Wooo,

 

If I ever meet you, I shall buy you a beer!!!!

 

:thumbsup: :thumbsup: B)

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...