Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

working on a contribution, but having a problem


sw45859

Recommended Posts

this is probably an easy to solve problem, but i just am too tired and can't get it, the following code will not write the information to mysql database, please let me know why if you do....(the custom_data_array) is what i am trying to write to the database.

 

  require('includes/application_top.php');

 

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CONTACT_US);

   

 $custom_data_array = array('motherboard' => $mboard,

                            'name' => $name,

                            'memory' => $mem,

                            'processor' => $proc,

                            'harddrive' => $hddsiz,

                            'videocard' => $vidcrd,

             'tower' => $tower,

                            'soundcard' => $sndcard,

                            'modem' => $mdmcrd,

                            'usb' => $usbcrd,

                            'firewire' => $frwcrd,

                            'opersys' => $opers,

             'monitor' => $monsiz,

                            'customers_email' => $email,

                            'comment' => $HTTP_POST_VARS['enquiry'],

                            'networkcard' => $netcrd

       );



 

 



 

 $error = false;

 if ($HTTP_GET_VARS['action'] == 'send') {

 tep_db_perform(CUSTOM_BUILDS, $custom_data_array);

    if (tep_validate_email(trim($HTTP_POST_VARS['email']))) {

  tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $HTTP_POST_VARS['enquiry'], $HTTP_POST_VARS['name'], $HTTP_POST_VARS['email'], '');

  tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=success', 'NONSSL'));

  

   } else {

     $error = true;

   }

 }



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

?>

<!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 (getenv('HTTPS') == 'on' ? 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"><table border="0" width="100%" cellspacing="0" cellpadding="0">

     <tr>

       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">

         <tr>

           <td class="pageHeading">Custom Built Computer</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 ($HTTP_GET_VARS['action'] == 'success') {

 

?>

     <tr>

       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">

         <tr>

           <td class="main"><?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 align="right"><br><a href="<?php echo tep_href_link(FILENAME_DEFAULT, '', 'NONSSL'); ?>"><?php echo tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></a></td>

         </tr>

       </table></td>

     </tr>

<?php

 } else {

?>

     <tr>

       <td><form action="<?php echo tep_href_link(FILENAME_CONTACT_US, 'action=send', 'NONSSL'); ?>" method="post"><table border="0" width="100%" cellspacing="0" cellpadding="2">

         <tr>

           <td class="main"><?php echo ENTRY_NAME; ?><br><?php echo tep_draw_input_field('name', ($error ? $HTTP_POST_VARS['name'] : $first_name)); ?></td>

           <td class="main"><?php echo ENTRY_EMAIL; ?><br><?php echo tep_draw_input_field('email', ($error ? $HTTP_POST_VARS['email'] : $email_address)); if ($error) echo ENTRY_EMAIL_ADDRESS_CHECK_ERROR; ?></td>

         </tr>

   <tr>

           <td class="main"> </td>

           <td class="main"> </td>

         </tr>

   <tr>

           <td class="main">MotherBoard:<br><?php echo tep_draw_input_field('mboard', ($error ? $HTTP_POST_VARS['mboard'] : $mboard)); ?></td>

           <td class="main">Amount Of Memory:<br><?php echo tep_draw_input_field('mem', ($error ? $HTTP_POST_VARS['mem'] : $mem)); ?></td>

         </tr>

   <tr>

           <td class="main">Processor:<br><?php echo tep_draw_input_field('proc', ($error ? $HTTP_POST_VARS['proc'] : $proc)); ?></td>

           <td class="main">Case Preference (If Any):<br><?php echo tep_draw_input_field('tower', ($error ? $HTTP_POST_VARS['tower'] : $tower)); ?></td>

         </tr>

   <tr>

           <td class="main">Hard Drive Size:<br><?php echo tep_draw_input_field('hddsiz', ($error ? $HTTP_POST_VARS['hddsiz'] : $hddsiz)); ?></td>

           <td class="main">Video Card:<br><?php echo tep_draw_input_field('vidcrd', ($error ? $HTTP_POST_VARS['vidcrd'] : $usbcrd)); ?></td>

         </tr>

   <tr>

           <td class="main">Sound Card (If Not Using On Board Sound):<br><?php echo tep_draw_input_field('sndcrd', ($error ? $HTTP_POST_VARS['sndcrd'] : $sndcrd)); ?></td>

           <td class="main">Operating System Preference:<br><?php echo tep_draw_input_field('opers', ($error ? $HTTP_POST_VARS['opers'] : $opers)); ?></td>

         </tr>

   <tr>

           <td class="main">Network Card (Yes Or No):<br><?php echo tep_draw_input_field('netcrd', ($error ? $HTTP_POST_VARS['netcrd'] : $netcrd)); ?></td>

           <td class="main">Modem (Yes Or No):<br><?php echo tep_draw_input_field('mdmcrd', ($error ? $HTTP_POST_VARS['mdmcrd'] : $mdmcrd)); ?></td>

         </tr>

   <tr>

           <td class="main">Firewire (Yes Or No):<br><?php echo tep_draw_input_field('frwcrd', ($error ? $HTTP_POST_VARS['frwcrd'] : $frwcrd)); ?></td>

           <td class="main">Usb 2.0 (If Not On Motherboard):<br><?php echo tep_draw_input_field('usbcrd', ($error ? $HTTP_POST_VARS['usbcrd'] : $usbcrd)); ?></td>

         </tr>

   <tr>

           <td class="main">Monitor Size And Brand (If Preferred)<br><?php echo tep_draw_input_field('monsiz', ($error ? $HTTP_POST_VARS['monsiz'] : $monsiz)); ?></td>

         </tr>

   <tr>

           <td class="main">Extra Comments</td>

         </tr>

         <tr>

           <td><?php echo tep_draw_textarea_field('enquiry', 'soft', 50, 15, $HTTP_POST_VARS['enquiry']); ?></td>

         </tr>

         <tr>

           <td class="main" align="right"><br><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>

         </tr>

 </table></form></td>

     </tr>

<?php

 }

?>

   </table></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'); ?>

Link to comment
Share on other sites

Maybe you need to look at the form action?? ;)

Mark Evans

osCommerce Monkey & Lead Guitarist for "Sparky + the Monkeys" (Album on sale in all good record shops)

 

---------------------------------------

Software is like sex: It's better when it's free. (Linus Torvalds)

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