Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

creating New forms


andrew40

Recommended Posts

I need to create some new forms for a new client, so have added the form fields etc etc but cannot seem to get them to work, i have based it on the contact_us page ad added extra fields, renamed as request_info and added this file to the filenames.php file. What else do I need to change to get it to work. here is my new code.

 

all i get is a blank screen so not sure what is going on, i have probably missed something somewhere in the beginning section.

 

<?php

/*

$Id: contact_us.php,v 1.42 2003/06/12 12:17:07 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

require('includes/application_top.php');

 

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

 

$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_REQUEST_INFO, 'action=success'));

} else {

$error = true;

 

$messageStack->add('email', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);

}

}

 

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

?>

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

<style type="text/css">

<!--

.style1 {

color: #666666;

font-weight: bold;

}

-->

</style>

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

<?php include('bodyhead_request.php'); ?>

<!-- body_text //-->

<td width="100%" valign="top"><?php echo tep_draw_form('request', tep_href_link(FILENAME_REQUEST_INFO, '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="main"><strong>Request Information </strong></td>

<td class="pageHeading" align="right"> </td>

</tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<?php

if ($messageStack->size('email') > 0) {

?>

<tr>

<td><?php echo $messageStack->output('email'); ?></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="90%" cellspacing="0" cellpadding="2">

<tr>

<td colspan="3" class="main"><p>For further information or details

on our products please use the request form below for a fast

response.</p>

<p>* indicates a required field </p>

<p>Complete your details below and click 'Continue' </p>

<p><br>

</p></td>

</tr>

<tr>

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

<td colspan="2" class="main"><select name="title">

<option value="Mr">Mr</option>

<option value="Mrs">Mrs</option>

<option value="Miss">Miss</option>

<option value="Dr">Dr</option>

</select></td>

</tr>

<tr>

<td width="30%" class="main">Full Name * </td>

<td colspan="2" class="main"><?php echo tep_draw_input_field('name'); ?></td>

</tr><tr>

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

<td colspan="2" class="main"><?php echo tep_draw_input_field('company'); ?></td>

</tr><tr>

<td class="main">Email Address * </td>

<td colspan="2" class="main"><?php echo tep_draw_input_field('email'); ?></td>

</tr>

<tr>

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

<td colspan="2" class="main"><?php echo tep_draw_input_field('telephone'); ?></td>

</tr><tr>

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

<td colspan="2" class="main"><?php echo tep_draw_input_field('address1'); ?></td>

</tr>

<tr>

<td class="main">Address (continued) </td>

<td colspan="2" class="main"><?php echo tep_draw_input_field('address2'); ?></td>

</tr>

<tr>

<td class="main">Post Code * </td>

<td colspan="2" class="main"><?php echo tep_draw_input_field('post_code'); ?></td>

</tr>

<tr>

<td class="main"><?php echo tep_draw_checkbox_field('wine_racks'); ?> Wine

Racks </td>

<td colspan="2" class="main"><?php echo tep_draw_checkbox_field('decant'); ?> Decanting

& Serving </td>

</tr>

<tr>

<td class="main"><?php echo tep_draw_checkbox_field('cellarware'); ?> Cellarware </td>

<td colspan="2" class="main"><label>

<?php echo tep_draw_checkbox_field('order_number'); ?> Corkscrews </label></td>

</tr>

<tr>

<td class="main"><?php echo tep_draw_checkbox_field('fridges'); ?> Wne Fridges </td>

<td colspan="2" class="main"><?php echo tep_draw_checkbox_field('education'); ?> Education </td>

</tr>

<tr>

<td class="main"><?php echo tep_draw_checkbox_field('tasting'); ?> Wine Tasting </td>

<td colspan="2" class="main"><?php echo tep_draw_checkbox_field('trade'); ?> Trade Account </td>

</tr>

<tr>

<td class="main"><?php echo tep_draw_checkbox_field('glassware'); ?> Glassware </td>

<td colspan="2" class="main"><?php echo tep_draw_checkbox_field('newsletter'); ?> Receive

Wine Case Newsletter </td>

</tr>

<tr>

<td colspan="3" class="main">Other: <?php echo tep_draw_input_field('other'); ?></td>

</tr>

<tr>

<td colspan="3" class="main">Please use this free format space if you have any comments of questions:

</td>

</tr>

<tr>

<td colspan="3" valign="top" class="main"><?php echo tep_draw_textarea_field('enquiry', 'soft', 15, 5); ?></td>

</tr>

<tr>

<td colspan="3" valign="top" class="main"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>

</tr>

<tr>

<td colspan="3" valign="top" class="main"><div align="left"></div></td>

</tr>

<tr>

<td colspan="3"></td>

</tr>

</table></td>

</tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td> </td>

</tr>

<?php

}

?>

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

<!-- body_text_eof //-->

<?php include('bodytail1.php'); ?>

</body>

</html>

<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Link to comment
Share on other sites

Have changed beginning to

 

require('includes/application_top.php');

 

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

 

$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']);

$company = tep_db_prepare_input($HTTP_POST_VARS['company']);

$telephone = tep_db_prepare_input($HTTP_POST_VARS['telephone']);

$address1 = tep_db_prepare_input($HTTP_POST_VARS['address1']);

$address2 = tep_db_prepare_input($HTTP_POST_VARS['address2']);

$postcode = tep_db_prepare_input($HTTP_POST_VARS['post_code']);

$wineracks = tep_db_prepare_input($HTTP_POST_VARS['wine_racks']);

$decant = tep_db_prepare_input($HTTP_POST_VARS['decant']);

$cellarware = tep_db_prepare_input($HTTP_POST_VARS['cellarware']);

$corkscrews = tep_db_prepare_input($HTTP_POST_VARS['corkscrews']);

$fridges = tep_db_prepare_input($HTTP_POST_VARS['fridges']);

$education = tep_db_prepare_input($HTTP_POST_VARS['education']);

$glassware = tep_db_prepare_input($HTTP_POST_VARS['glassware']);

$newsletter = tep_db_prepare_input($HTTP_POST_VARS['newsletter']);

$other = tep_db_prepare_input($HTTP_POST_VARS['other']);

$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, $company, $telephone, $address1, $address2, $postcode, $wineracks, $decant, $cellarware, $corkscrews, $fridges, $education, $glassware, $newsletter, $other);

 

but still no luck

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...