Visualizzazione dei risultati da 1 a 4 su 4

Discussione: problemi form e-mail

  1. #1
    Utente di HTML.it
    Registrato dal
    Feb 2002
    Messaggi
    14

    problemi form e-mail

    Ciao a tutti, ho un file contatti che invia un e-mail direttamente all'amministratore di un sito, vorrei inserire tramite codice, un altro destinatario, premetto che è un file di osC e so che dovrei utilizzare una query ma non capisco dove, posso postare il file? cosi si ci può dare un occhiata?
    Grazie
    Jerry

  2. #2
    posta il codice...


  3. #3
    Utente di HTML.it
    Registrato dal
    Feb 2002
    Messaggi
    14
    Ciao, eccovi il codice, (questo riguarda il form e-mail, che poi inserirò in un latra pagina dovè presente un customer_id che dovrebbe riportarmi all'email che mi interessa) io qui vorrei inserire tramite uan query (penso) il codice per far inviare l'e-mail anche a altre persone tramite richiamo da database.
    So che molto provabilmente non sarà chiaro, se può essere utile posto anche l'atro file.
    Grazie mille
    Jerry

    <?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 (c) 2003 osCommerce

    Released under the GNU General Public License
    */

    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') && tep_email_isfromdomain($_POST['email']))
    {
    $error = true;
    $messageStack->add('contact', ENTRY_EMAIL_ADDRESS_ISFROMDOMAIN_ERROR);
    }
    elseif (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send')) {
    $_POST['email'] = preg_replace( "/\n/", " ", $_POST['email'] );
    $_POST['name'] = preg_replace( "/\n/", " ", $_POST['name'] );
    $_POST['email'] = preg_replace( "/\r/", " ", $_POST['email'] );
    $_POST['name'] = preg_replace( "/\r/", " ", $_POST['name'] );
    $_POST['email'] = str_replace("Content-Type:","",$_POST['email']);
    $_POST['name'] = str_replace("Content-Type:","",$_POST['name']);

    $name = tep_db_prepare_input($_POST['name']);
    $email_address = tep_db_prepare_input($_POST['email']);
    $enquiry = tep_db_prepare_input($_POST['enquiry']);
    $enquiry = tep_db_prepare_input($enquiry . "\n\n IP: " . $_SERVER['REMOTE_ADDR']);

    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="stylesheet.css">
    </head>
    <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">

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



    <table border="0" width="100%" cellspacing="0" cellpadding="0">
    <tr>
    <td width="<?php echo BOX_WIDTH; ?>" valign="top" class="bar_left"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="0">

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

    </table></td>

    <td width="100%" valign="top" class="centercolor"><?php echo tep_draw_form('contact_us', tep_href_link(FILENAME_CONTACT_US, 'action=send')); ?><table border="0" width="95%" cellspacing="0" cellpadding="0" align="center">
    <tr>
    <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
    <tr>
    <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
    </tr>
    </table></td>
    </tr>
    <tr>
    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></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 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 '' . tep_image_button('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
    } else {
    //add customer details - osc@brightstorm.co.uk
    //added 27.10.03

    if (tep_session_is_registered('customer_id')) {
    $account_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
    $account = tep_db_fetch_array($account_query);

    $name = $account['customers_firstname'] . ' ' . $account['customers_lastname'];
    $email = $account['customers_email_address'];
    }

    // end add customer details


    ?>
    <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>
    </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><?php echo tep_draw_textarea_field('enquiry', 'soft', 50, 15, tep_sanitize_string($_POST['enquiry']), '', false); ?></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">
    <tr>
    <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>

    <td width="<?php echo BOX_WIDTH; ?>" valign="top" class="bar_right"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="0">

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

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



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



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

  4. #4
    Utente di HTML.it
    Registrato dal
    Feb 2002
    Messaggi
    14
    nessuno mi può aiutare?
    Grazie

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.