home *** CD-ROM | disk | FTP | other *** search
/ Practical Internet Web Designer 88 / PIWD88.iso / pc / CONTENTS / ECOMMERCE / SOFTWARE / OSCOMMERCE.EXE / oscommerce-2.2ms2 / catalog / contact_us.php < prev    next >
PHP Script  |  2003-06-12  |  6KB  |  169 lines

  1. <?php
  2. /*
  3.   $Id: contact_us.php,v 1.42 2003/06/12 12:17:07 hpdl Exp $
  4.  
  5.   osCommerce, Open Source E-Commerce Solutions
  6.   http://www.oscommerce.com
  7.  
  8.   Copyright (c) 2003 osCommerce
  9.  
  10.   Released under the GNU General Public License
  11. */
  12.  
  13.   require('includes/application_top.php');
  14.  
  15.   require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CONTACT_US);
  16.  
  17.   $error = false;
  18.   if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send')) {
  19.     $name = tep_db_prepare_input($HTTP_POST_VARS['name']);
  20.     $email_address = tep_db_prepare_input($HTTP_POST_VARS['email']);
  21.     $enquiry = tep_db_prepare_input($HTTP_POST_VARS['enquiry']);
  22.  
  23.     if (tep_validate_email($email_address)) {
  24.       tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $enquiry, $name, $email_address);
  25.  
  26.       tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=success'));
  27.     } else {
  28.       $error = true;
  29.  
  30.       $messageStack->add('contact', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
  31.     }
  32.   }
  33.  
  34.   $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CONTACT_US));
  35. ?>
  36. <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
  37. <html <?php echo HTML_PARAMS; ?>>
  38. <head>
  39. <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
  40. <title><?php echo TITLE; ?></title>
  41. <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
  42. <link rel="stylesheet" type="text/css" href="stylesheet.css">
  43. </head>
  44. <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
  45. <!-- header //-->
  46. <?php require(DIR_WS_INCLUDES . 'header.php'); ?>
  47. <!-- header_eof //-->
  48.  
  49. <!-- body //-->
  50. <table border="0" width="100%" cellspacing="3" cellpadding="3">
  51.   <tr>
  52.     <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
  53. <!-- left_navigation //-->
  54. <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
  55. <!-- left_navigation_eof //-->
  56.     </table></td>
  57. <!-- body_text //-->
  58.     <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">
  59.       <tr>
  60.         <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
  61.           <tr>
  62.             <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
  63.             <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>
  64.           </tr>
  65.         </table></td>
  66.       </tr>
  67.       <tr>
  68.         <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  69.       </tr>
  70. <?php
  71.   if ($messageStack->size('contact') > 0) {
  72. ?>
  73.       <tr>
  74.         <td><?php echo $messageStack->output('contact'); ?></td>
  75.       </tr>
  76.       <tr>
  77.         <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  78.       </tr>
  79. <?php
  80.   }
  81.  
  82.   if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'success')) {
  83. ?>
  84.       <tr>
  85.         <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>
  86.       </tr>
  87.       <tr>
  88.         <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  89.       </tr>
  90.       <tr>
  91.         <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
  92.           <tr class="infoBoxContents">
  93.             <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
  94.               <tr>
  95.                 <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
  96.                 <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
  97.                 <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
  98.               </tr>
  99.             </table></td>
  100.           </tr>
  101.         </table></td>
  102.       </tr>
  103. <?php
  104.   } else {
  105. ?>
  106.       <tr>
  107.         <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
  108.           <tr class="infoBoxContents">
  109.             <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
  110.               <tr>
  111.                 <td class="main"><?php echo ENTRY_NAME; ?></td>
  112.               </tr>
  113.               <tr>
  114.                 <td class="main"><?php echo tep_draw_input_field('name'); ?></td>
  115.               </tr>
  116.               <tr>
  117.                 <td class="main"><?php echo ENTRY_EMAIL; ?></td>
  118.               </tr>
  119.               <tr>
  120.                 <td class="main"><?php echo tep_draw_input_field('email'); ?></td>
  121.               </tr>
  122.               <tr>
  123.                 <td class="main"><?php echo ENTRY_ENQUIRY; ?></td>
  124.               </tr>
  125.               <tr>
  126.                 <td><?php echo tep_draw_textarea_field('enquiry', 'soft', 50, 15); ?></td>
  127.               </tr>
  128.             </table></td>
  129.           </tr>
  130.         </table></td>
  131.       </tr>
  132.       <tr>
  133.         <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  134.       </tr>
  135.       <tr>
  136.         <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
  137.           <tr class="infoBoxContents">
  138.             <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
  139.               <tr>
  140.                 <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
  141.                 <td align="right"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
  142.                 <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
  143.               </tr>
  144.             </table></td>
  145.           </tr>
  146.         </table></td>
  147.       </tr>
  148. <?php
  149.   }
  150. ?>
  151.     </table></form></td>
  152. <!-- body_text_eof //-->
  153.     <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
  154. <!-- right_navigation //-->
  155. <?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
  156. <!-- right_navigation_eof //-->
  157.     </table></td>
  158.   </tr>
  159. </table>
  160. <!-- body_eof //-->
  161.  
  162. <!-- footer //-->
  163. <?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
  164. <!-- footer_eof //-->
  165. <br>
  166. </body>
  167. </html>
  168. <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
  169.