Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

custom form page for wants list


idlerob

Recommended Posts

Posted

Ive made a new page within the shop and linked to it in the information box etc... I now want to put a form on this page and for it to be emailed to the store email when customers fill it out. The form is like a wants / request form that customers can fill out and we can try and get the product in stock.

Ive created the form on the page the way i want it i just now need it to work as php and get emailed to the stores email address????

 

Greatly appreciate any help

 

link to the page with the form

http://www.wantitmusic.com/wantlist.php

Posted
Ive made a new page within the shop and linked to it in the information box etc... I now want to put a form on this page and for it to be emailed to the store email when customers fill it out. The form is like a wants / request form that customers can fill out and we can try and get the product in stock.

Ive created the form on the page the way i want it i just now need it to work as php and get emailed to the stores email address????

 

Greatly appreciate any help

 

link to the page with the form

http://www.wantitmusic.com/wantlist.php

 

well, the source would be more helpful than the page itself

Treasurer MFC

Posted

Ive managed to kind of duplicate the contact form page and add in extra fields for what i wanted but now for some reason when the email gets sent to the store owner only one field the 'name' from the form gets passed on. here is my source code:

 

<?php


/*


 $Id: shipping.php,v 1.22 2003/06/05 23:26:23 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_WANTLIST);

$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']);
$telephone = tep_db_prepare_input($HTTP_POST_VARS['telephone']);
$artist = tep_db_prepare_input($HTTP_POST_VARS['artist']);
$title = tep_db_prepare_input($HTTP_POST_VARS['title']);
$format = tep_db_prepare_input($HTTP_POST_VARS['format']);
$condition = tep_db_prepare_input($HTTP_POST_VARS['condition']);
$maxprice = tep_db_prepare_input($HTTP_POST_VARS['maxprice']);
$timelimit = tep_db_prepare_input($HTTP_POST_VARS['timelimit']);
$comment = tep_db_prepare_input($HTTP_POST_VARS['comment']);

if (tep_validate_email($email_address)) {
  tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $name, $email_address, $telephone, $artist, $title, $format, $condition, $maxprice, $timelimit, ?comment);

  tep_redirect(tep_href_link(FILENAME_WANTLIST, 'action=success'));
} else {
  $error = true;

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



 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_WANTLIST));


?>


<!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('wantlist', tep_href_link(FILENAME_WANTLIST, '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('wantlist') > 0) {
?>
  <tr>
	<td><?php echo $messageStack->output('wantlist'); ?></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><td class="main"><?php echo ENTRY_EMAIL; ?></td>
		  </tr>
		  <tr>
   <td class="main"><?php echo tep_draw_input_field('name'); ?></td><td class="main"><?php echo tep_draw_input_field('email'); ?></td>
		  </tr>
		  <tr>
			<td class="main"><?php echo ENTRY_TELEPHONE; ?></td>
		  </tr>
		  <tr>
			<td class="main"><?php echo tep_draw_input_field('telephone'); ?></td>
		  </tr>
		  <tr>
			<td class="main"><?php echo ENTRY_ARTIST; ?></td><td class="main"><?php echo ENTRY_TITLE; ?></td>
		  </tr>
		  <tr>
			<td class="main"><?php echo tep_draw_input_field('artist'); ?></td><td class="main"><?php echo tep_draw_input_field('title'); ?></td>

		  </tr>
		  <tr>
			<td class="main"><?php echo ENTRY_FORMAT; ?></td><td class="main"><?php echo ENTRY_CONDITION; ?></td>
		  </tr>
		  <tr>
			<td class="main"><?php echo tep_draw_input_field('format'); ?></td><td class="main"><?php echo tep_draw_input_field('condition'); ?></td>
		  </tr>
		   <tr>
			<td class="main"><?php echo ENTRY_MAXPRICE; ?></td><td class="main"><?php echo ENTRY_TIMELIMIT; ?></td>
		  </tr>
		  <tr>
			<td class="main"><?php echo tep_draw_input_field('maxprice'); ?></td><td class="main"><?php echo tep_draw_input_field('timelimit'); ?></td>
		  </tr>
						<tr >
			<td colspan="2" class="main"><?php echo ENTRY_COMMENT; ?></td>
		  </tr>
		  <tr>
			<td colspan="2"><?php echo tep_draw_textarea_field('comment', 'soft', 50, 8); ?></td>
		  </tr>
		</table></td>
	  </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>
	  </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'); ?>

Posted

How can i get this pages form to return all the fields to the store owner email address. I did try to make everything the same as the contact form page but just added extra fields.

 

cheers

Archived

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

×
×
  • Create New...