Jump to content

ArtbyPatrick

Members
  • Posts

    35
  • Joined

  • Last visited

Everything posted by ArtbyPatrick

  1. it produced this: <td width="100%" valign="top"><form name="contact_us" action="http://www.unisondigital.com/store.php?action=send" method="post"><table border="0" width="100%" cellspacing="0" cellpadding="0"> if I am not mistaking Technically it should work right?
  2. yes here is what I found in the code as action: <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"> so I believe, if I am not mistaking, this counts as the <form action="action=send"> Am I right?
  3. then maybe the error is from the form itself as it is not sending an email to the admin nor a confirmation email to the user. But after looking at the code itself, it seems that I have everything entered correctly, but again I am no expert at php. Here is the code from the contact page that I believe is responsible to send the email: require('includes/application_top.php'); require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CONTACT_US); $error = false; if (isset($_GET['action']) && ($_GET['action'] == 'send')) { $name = tep_db_prepare_input($_POST['name']); $email_address = tep_db_prepare_input($_POST['email']); $enquiry = tep_db_prepare_input($_POST['enquiry']); if (tep_validate_email($email_address)) { tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $enquiry, $name, $email_address); // tep_mail("info@itnexus.ca", "info@itnexus.ca", 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); } } Is this the correct way ? Thanks for all of your help
  4. ok so i removed the include line on the php5.ini, I figured maybe it is needed elsewhere in the code, So I tried including it in the actual page where user needs to fill in form but it returned an error message: Fatal error: Cannot redeclare _pear_call_destructors() (previously declared in /home/content/U/n/i/UnisonDigital/html/includes/pear/PEAR.php:735) in /usr/local/php5/lib/php/PEAR.php on line 777 So I removed it again, should I be entering it somewhere else?
  5. I created a file phpinfo.php and opened it The version php its using is : PHP Version 5.2.17
  6. I wa wondering if I should have a php.ini and a php5.ini on the server, or do I need just one? Reason I am asking is that they both have the include "pear/PEAR.php"; line in them. Could that cause a problem with the email?
  7. I tried that test.php file again and I got a failed, where should I go next? EDIT: nvm I just reread your reply under that post that it should not be working anyway
  8. I did those changes, everything displays fine but still the email has the same issue. I cannot get a confirmation email out for the user and the filled formed is not being forwarded to the target email address. Although, on the user side, I get a confirmation saying that my submission has been successfully sent. What should I tackle next?
  9. yes that line was added not too long ago because back then, the product categories weren't showing up anymore in listing. Here is the site www.unisondigital.com. Back then, when you clicked on desktop computers, no inventory was showing up anymore, so by adding register_long_arrays the listings came back on but that stopped the email from working. That frankensite is quite a mess in the coding.
  10. when filling out the forms, its says that it was sent with success. Normally after that the user would get a confirmation email and the owner gets an email as well, thats the part that doesnt work anymore. I added the code where you told me to and nothing came up, it just went on with the success process
  11. ok here is the code: <?php /* $Id: enter_contest.php,v 1.0 2003/07/15 Exp $ Contest for osC(2.2MS2) v1.0 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'); if (CONTEST_SHOW == 'false') { $navigation->set_snapshot(); tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'SSL')); } require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ENTER_CONTEST); if (isset($_GET['action']) && ($_GET['action'] == 'process')) { $contestant_name = tep_db_prepare_input($_POST['contestant_name']); $contestant_lastname = tep_db_prepare_input($_POST['contestant_lastname']); $contestant_email = tep_db_prepare_input($_POST['contestant_email']); $contestant_location = tep_db_prepare_input($_POST['contestant_location']); // $gb_text = tep_db_prepare_input($_POST['gb_text']); // not being used. no reason why need customer to enter comments $error = false; if (strlen($contestant_name) < 2) { $error = true; $messageStack->add('contest', JS_CONTESTANTS_NAME); } if (strlen($contestant_lastname) < 3) { $error = true; $messageStack->add('contest', JS_CONTESTANTS_LNAME); } if (strlen($contestant_location) <= 6) { $error = true; $messageStack->add('contest', JS_CONTESTANTS_LOCATION); } if (tep_validate_email($contestant_email)) { $mail_query = tep_db_query("select contestants_email, contestants_name, contestants_lastname from " . TABLE_CONTEST . " where contestants_email = '". $contestant_email ."'"); $customers_values = tep_db_fetch_array($mail_query); if($customers_values == 0) { // mail to store owner $texte = $contestant_name . ' ' . $contestant_lastname . ' ' . $contestant_location; tep_mail("contest@unisondigital.com", "contest@unisondigital.com", EMAIL_CONTESTANT_SUBJECT, $texte, $contestant_location, $contestant_email); // mail to contestant $email_text = sprintf(EMAIL_CONTESTANT_GREET, $contestant_name); $email_text .= EMAIL_CONTESTANT_MESSAGE; tep_mail($contestant_name, $contestant_email, EMAIL_CONTESTANT_SUBJECT, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); } else { $error = true; $messageStack->add('contest', ENTRY_EMAIL_DUPLICATE_CHECK_ERROR); } } else { $error = true; $messageStack->add('contest', ENTRY_EMAIL_ADDRESS_CHECK_ERROR); } if ($error == false) { tep_db_query("insert into " . TABLE_CONTEST . " (contestants_name, contestants_lastname, contestants_email, contestants_location, date_added) values ('" . tep_db_input($contestant_name) . "', '" . tep_db_input($contestant_lastname) . "', '" . tep_db_input($contestant_email) . "', '" . tep_db_input($contestant_location) . "', now())"); $insert_id = tep_db_insert_id(); tep_db_query("insert into " . TABLE_ENTER_CONTEST_DESCRIPTION . " (entry_id, languages_id, entry_text) values ('" . (int)$insert_id . "', '" . (int)$languages_id . "', '" . tep_db_input($gb_text) . "')"); //tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT, tep_get_all_get_params(array('action')))); tep_redirect(tep_href_link(FILENAME_ENTER_CONTEST, 'action=success')); } } elseif (tep_session_is_registered('customer_id')) { $account_query_one = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'"); $account_one = tep_db_fetch_array($account_query_one); $account_query_two = tep_db_query("select a.entry_country_id, b.countries_id, b.countries_name from " . TABLE_ADDRESS_BOOK . " a, " . TABLE_COUNTRIES ." b where a.customers_id = '" . (int)$customer_id . "' and a.entry_country_id = b.countries_id"); $account_two = tep_db_fetch_array($account_query_two); $contestant_name = $account_one['customers_firstname']; $contestant_lastname = $account_one['customers_lastname']; $contestant_email = $account_one['customers_email_address']; $contestant_location = $account_two['countries_name']; } $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CONTEST, tep_get_all_get_params())); ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <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"> <script language="javascript"><!-- function checkForm() { var error = 0; var error_message = "<?php echo JS_ERROR; ?>"; var contestant_name = document.enter_contest.contestant_name.value; var contestant_lastname = document.enter_contest.contestant_lastname.value; if (contestant_name.length < 2) { error_message = error_message + "<?php echo JS_CONTESTANTS_NAME; ?>"; error = 1; } if (contestant_lastname.length < 3) { error_message = error_message + "<?php echo JS_CONTESTANT_LNAME; ?>"; error = 1; } if (error == 1) { alert(error_message); return false; } else { return true; } } function popupWindow(url) { window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=700,height=480,screenX=150,screenY=150,top=150,left=150') } //--></script> <link rel="stylesheet" type="text/css" href="stylesheet.css"> <script type="text/javascript" src="js/jquery.min.js"></script> <script type="text/javascript" src="js/home2.8.js"></script> <link rel="STYLESHEET" type="text/css" href="slides.css"> <script language="javaScript"> <!-- Begin function movepic(img_name,img_src) { document[img_name].src=img_src; } // End --> </script> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> <!-- header //--> <?php if ($languages_id=="1") { require(DIR_WS_INCLUDES . 'header.php'); } else { require(DIR_WS_INCLUDES . 'header-fr.php'); } ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" cellspacing="3" cellpadding="3"> <tr> <td width="<?php echo 1; ?>" valign="top"><table border="0" width="<?php echo 1; ?>" cellspacing="0" cellpadding="2"> <!-- left_navigation //--> <!-- left_navigation_eof //--> </table></td> <!-- body_text //--> <td width="100%" valign="top"><?php echo tep_draw_form('enter_contest', tep_href_link(FILENAME_ENTER_CONTEST, 'action=process'), 'post', 'onSubmit="return checkForm();"'); ?><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading" valign="top"><?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('contest') > 0) { ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><?php echo $messageStack->output('contest'); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } ?> <!-- begin prize display information --> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CONTEST); $time_now = date('Y-m-d'); if ($prize_product = tep_random_select("select p.products_id, pd.products_name, p.products_model, p.products_price, p.products_tax_class_id, p.products_image, hhs.prizes_value, hhs.status, hhs.prizes_date_added, hhs.expires_date from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRIZES . " hhs where p.products_status = '1' and p.products_id = hhs.products_id and pd.products_id = hhs.products_id and pd.language_id = '" . (int)$languages_id . "' and hhs.status = '1' and hhs.expires_date >= '" . $time_now . "' order by hhs.prizes_date_added desc limit 1")) { ?> <!-- prize //--> <tr> <td> <?php $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => BOX_HEADING_CONTEST); new infoBoxHeading($info_box_contents, false, false); $info_box_contents = array(); $info_box_contents[] = array('align' => 'center', 'text' => TEXT_CONTEST_ENDS . '<br>' . tep_date_long($prize_product['expires_date']) . '<br><br>' . TEXT_SIGN_UP_TODAY . '<br> <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $prize_product['products_id']) . '"><br><br>' . $prize_product['products_name'] . '<br>' . tep_image(DIR_WS_IMAGES . $prize_product['products_image'], 'Model : ' . $prize_product['products_model'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><br>Value: ' . '<span class="productSpecialPrice">' . $currencies->display_price($prize_product['prizes_value'], tep_get_tax_rate($prize_product['products_tax_class_id'])) . '</span>'); new infoBox($info_box_contents); ?> </td> </tr> <?php } ?> <!-- end prize display information --> <?php if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'success')) { ?> <tr> <td class="main" align="center"><?php echo TEXT_SUCCESS_THANKS; ?></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="main"> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td colspan="3" class="main" align="left"><?php echo TEXT_CONTEST_DETAILS; ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="smallText" align="left"></td> <td class="main" align="right"><?php echo '<a href="javascript:popupWindow('' . tep_href_link(FILENAME_POPUP_CONTEST) . '')">' . TEXT_CONTEST_HELP_LINK . '</a>'; ?> <img src="images/icons/button_more_info.gif" alt="Contest Details" valign="bottom"></td> <td class="main" align="right"></td> </tr> </table></td> </tr> </table></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="2" cellpadding="2"> <tr> <td class="main" width="30%"><?php echo ENTRY_NAME; ?></td> <td class="main"><?php echo tep_draw_input_field('contestant_name', '', 'size="28"') . ' <span class="inputRequirement">* ' . TEXT_REQUIRED . '</span>'; ?></td> </tr> <tr> <td class="main" width="30%"><?php echo ENTRY_LNAME; ?></td> <td class="main"><?php echo tep_draw_input_field('contestant_lastname', '', 'size="28"') . ' <span class="inputRequirement">* ' . TEXT_REQUIRED . '</span>'; ?></td> </tr> <tr> <td class="main"><?php echo ENTRY_EMAIL; ?></td> <td class="main"><?php echo tep_draw_input_field('contestant_email', '', 'size="28"') . ' <span class="inputRequirement">* ' . TEXT_REQUIRED . '</span>'; ?></td> </tr> <tr> <td class="main"><?php echo ENTRY_LOCATION; ?></td> <td class="main"><?php echo tep_draw_input_field('contestant_location', '', 'size="28"') . ' <span class="inputRequirement">* ' . TEXT_REQUIRED . '</span>'; ?></td> </tr> <!--<tr> <td class="main"><?php echo ENTRY_ENQUIRY; ?></td> </tr> <tr> <td colspan="2"><?php echo tep_draw_textarea_field('gb_text', 'soft', 60, 15); ?></td> </tr> <tr> <td colspan="2" class="smallText" align="right"><?php echo TEXT_NO_HTML; ?></td> </tr>--> </tr> </table></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></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 background="images/backgrounds/fineline.gif" border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td align="left"> <a href="javascript:history.back(-1);"><?php echo tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td> <td class="main" align="right"><?php echo tep_image_submit('button_submit.gif', IMAGE_BUTTON_SUBMIT); ?></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 1; ?>" valign="top"><table border="0" width="<?php echo 1; ?>" cellspacing="0" cellpadding="2"> <!-- right_navigation //--> <!-- 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'); ?>
  12. ok here is the sendmail.php code <?php // // +----------------------------------------------------------------------+ // | PHP Version 4 | // +----------------------------------------------------------------------+ // | Copyright © 1997-2003 The PHP Group | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.02 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is | // | available at through the world-wide-web at | // | http://www.php.net/license/2_02.txt. | // | If you did not receive a copy of the PHP license and are unable to | // | obtain it through the world-wide-web, please send a note to | // | license@php.net so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // | Author: Chuck Hagenbuch <chuck@horde.org> | // +----------------------------------------------------------------------+ /** * Sendmail implementation of the PEAR Mail:: interface. * @access public * @package Mail * @version $Revision: 294744 $ */ class Mail_sendmail extends Mail { /** * The location of the sendmail or sendmail wrapper binary on the * filesystem. * @var string */ var $sendmail_path = '/usr/sbin/sendmail'; /** * Any extra command-line parameters to pass to the sendmail or * sendmail wrapper binary. * @var string */ var $sendmail_args = '-i'; /** * Constructor. * * Instantiates a new Mail_sendmail:: object based on the parameters * passed in. It looks for the following parameters: * sendmail_path The location of the sendmail binary on the * filesystem. Defaults to '/usr/sbin/sendmail'. * * sendmail_args Any extra parameters to pass to the sendmail * or sendmail wrapper binary. * * If a parameter is present in the $params array, it replaces the * default. * * @param array $params Hash containing any parameters different from the * defaults. * @access public */ function Mail_sendmail($params) { if (isset($params['sendmail_path'])) { $this->sendmail_path = $params['sendmail_path']; } if (isset($params['sendmail_args'])) { $this->sendmail_args = $params['sendmail_args']; } /* * Because we need to pass message headers to the sendmail program on * the commandline, we can't guarantee the use of the standard "rn" * separator. Instead, we use the system's native line separator. */ if (defined('PHP_EOL')) { $this->sep = PHP_EOL; } else { $this->sep = (strpos(PHP_OS, 'WIN') === false) ? "n" : "rn"; } } /** * Implements Mail::send() function using the sendmail * command-line binary. * * @param mixed $recipients Either a comma-seperated list of recipients * (RFC822 compliant), or an array of recipients, * each RFC822 valid. This may contain recipients not * specified in the headers, for Bcc:, resending * messages, etc. * * @param array $headers The array of headers to send with the mail, in an * associative array, where the array key is the * header name (ie, 'Subject'), and the array value * is the header value (ie, 'test'). The header * produced from those values would be 'Subject: * test'. * * @param string $body The full text of the message body, including any * Mime parts, etc. * * @return mixed Returns true on success, or a PEAR_Error * containing a descriptive error message on * failure. * @access public */ function send($recipients, $headers, $body) { if (!is_array($headers)) { return PEAR::raiseError('$headers must be an array'); } $result = $this->_sanitizeHeaders($headers); if (is_a($result, 'PEAR_Error')) { return $result; } $recipients = $this->parseRecipients($recipients); if (is_a($recipients, 'PEAR_Error')) { return $recipients; } $recipients = implode(' ', array_map('escapeshellarg', $recipients)); $headerElements = $this->prepareHeaders($headers); if (is_a($headerElements, 'PEAR_Error')) { return $headerElements; } list($from, $text_headers) = $headerElements; /* Since few MTAs are going to allow this header to be forged * unless it's in the MAIL FROM: exchange, we'll use * Return-Path instead of From: if it's set. */ if (!empty($headers['Return-Path'])) { $from = $headers['Return-Path']; } if (!isset($from)) { return PEAR::raiseError('No from address given.'); } elseif (strpos($from, ' ') !== false || strpos($from, ';') !== false || strpos($from, '&') !== false || strpos($from, '`') !== false) { return PEAR::raiseError('From address specified with dangerous characters.'); } $from = escapeshellarg($from); // Security bug #16200 $mail = @popen($this->sendmail_path . (!empty($this->sendmail_args) ? ' ' . $this->sendmail_args : '') . " -f$from -- $recipients", 'w'); if (!$mail) { return PEAR::raiseError('Failed to open sendmail [' . $this->sendmail_path . '] for execution.'); } // Write the headers following by two newlines: one to end the headers // section and a second to separate the headers block from the body. fputs($mail, $text_headers . $this->sep . $this->sep); fputs($mail, $body); $result = pclose($mail); if (version_compare(phpversion(), '4.2.3') == -1) { // With older php versions, we need to shift the pclose // result to get the exit code. $result = $result >> 8 & 0xFF; } if ($result != 0) { return PEAR::raiseError('sendmail returned error code ' . $result, $result); } return true; } } ?>
  13. I had a problem on a site where the products just weren't showing up by categories anymore. Afyer a lot of research, I was told to add register_long_arrays = On in php5.ini. So I did, but unbeknownst to me, the online forms were suddenly not sending any emails to recipient email addresses already set up on the site. They were working fine before this change. How can I solve this problem? I am not very experienced with the php.ini stuff any help will be appreciated. Thanks in advance
  14. Yes thanks for your reply scientist, I am aware that I have to follow the parameters that are listed in order. I guess I did not formulate my question correctly: How do I make sure that the first name and last name are being entered in the email_text parameter? Right now, I have 7 parameters to send but I can only use 6. Is there a way to have $contestant_name and $contestant_lastname entered in the email_text parameter and if so, how to I write this in?
  15. Thank you all for your replies. What I want to do is to put the name and last name in the email text.
  16. sooo... how do I solve this? I checked the url you had on there and I could not find an answer? Any ideas?
  17. ArtbyPatrick

    tep_mail()

    Hello, I am trying to figure this emailing thing for my customer, still very new at php. After a little bit of research, it is my understanding, correct me if I am wrong, that tep_mail needs to have 6 variables between parentheses?? like this? : function tep_mail($to_name, $to_email_address, $email_subject, $email_text, $from_email_name, $from_email_address) What I am trying to do is for my customer to receive 4 variables in his email: first name, last name, email address and phone number (declared as location) but I come up with seven elements in the pârentheses: tep_mail("cutomer@email.com", "customer@email.com", EMAIL_CONTESTANT_SUBJECT, $contestant_name, $contestant_lastname, $contestant_email, $contestant_location); I know this isnt right because my customer only receives the first name and email address. Although $constestant_location is defined as the phone number and $contestant_lastname is pretty much self-explanatory. What am I doing wrong?
  18. Hello everyone, I am fairly new to php and what I am trying to do is this. My customer has a contest form online that allows his customer to enter their full names, email address, and phone number. What he wants to do now is to have the users enter their first name and last name in two different input fields. I have managed to find my way in the php code in order to add those fields and modify their echo values. But I believe that adding an input fields wasn't all of it, does something need to be done to the database? Here is the code: <?php /* $Id: enter_contest.php,v 1.0 2003/07/15 Exp $ Contest for osC(2.2MS2) v1.0 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'); if (CONTEST_SHOW == 'false') { $navigation->set_snapshot(); tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'SSL')); } require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ENTER_CONTEST); if (isset($_GET['action']) && ($_GET['action'] == 'process')) { $contestant_name = tep_db_prepare_input($_POST['contestant_name']); $contestant_lastname = tep_db_prepare_input($_POST['contestant_lastname']); $contestant_email = tep_db_prepare_input($_POST['contestant_email']); $contestant_location = tep_db_prepare_input($_POST['contestant_location']); // $gb_text = tep_db_prepare_input($_POST['gb_text']); // not being used. no reason why need customer to enter comments $error = false; if (strlen($contestant_name) < ENTRANTS_NAME_MIN_LENGTH) { $error = true; $messageStack->add('contest', JS_CONTESTANTS_NAME); } if (strlen($contestant_lastname) < ENTRANTS_NAME_MIN_LENGTH) { $error = true; $messageStack->add('contest', JS_CONTESTANTS_NAME); } if (tep_validate_email($contestant_email)) { $mail_query = tep_db_query("select contestants_email, contestants_name, contestants_lastname from " . TABLE_CONTEST . " where contestants_email = '". $contestant_email ."'"); $customers_values = tep_db_fetch_array($mail_query); if($customers_values == 0) { // mail to store owner tep_mail("contest@unisondigital.com", "contest@unisondigital.com", EMAIL_CONTESTANT_SUBJECT, $contestant_name, $contestant_lastname, $contestant_email, $contestant_location); // tep_mail("info@itnexus.ca", "info@itnexus.ca", EMAIL_CONTESTANT_SUBJECT, $gb_text, $contestant_name, $contestant_email); // mail to contestant $email_text = sprintf(EMAIL_CONTESTANT_GREET, $contestant_name); $email_text .= EMAIL_CONTESTANT_MESSAGE; tep_mail($contestant_name,$contestant_lastname, $contestant_email, EMAIL_CONTESTANT_SUBJECT, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); } else { $error = true; $messageStack->add('contest', ENTRY_EMAIL_DUPLICATE_CHECK_ERROR); } } else { $error = true; $messageStack->add('contest', ENTRY_EMAIL_ADDRESS_CHECK_ERROR); } if ($error == false) { tep_db_query("insert into " . TABLE_CONTEST . " (contestants_name, contestants_lastname, contestants_email, contestants_location, date_added) values ('" . tep_db_input($contestant_name) . "', '" . tep_db_input($contestant_lastname) . "', '" . tep_db_input($contestant_email) . "', '" . tep_db_input($contestant_location) . "', now())"); $insert_id = tep_db_insert_id(); tep_db_query("insert into " . TABLE_ENTER_CONTEST_DESCRIPTION . " (entry_id, languages_id, entry_text) values ('" . (int)$insert_id . "', '" . (int)$languages_id . "', '" . tep_db_input($gb_text) . "')"); //tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT, tep_get_all_get_params(array('action')))); tep_redirect(tep_href_link(FILENAME_ENTER_CONTEST, 'action=success')); } } elseif (tep_session_is_registered('customer_id')) { $account_query_one = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'"); $account_one = tep_db_fetch_array($account_query_one); $account_query_two = tep_db_query("select a.entry_country_id, b.countries_id, b.countries_name from " . TABLE_ADDRESS_BOOK . " a, " . TABLE_COUNTRIES ." b where a.customers_id = '" . (int)$customer_id . "' and a.entry_country_id = b.countries_id"); $account_two = tep_db_fetch_array($account_query_two); $contestant_name = $account_one['customers_firstname']; $contestant_lastname = $account_one['customers_lastname']; $contestant_email = $account_one['customers_email_address']; $contestant_location = $account_two['countries_name']; } $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CONTEST, tep_get_all_get_params())); ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <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"> <script language="javascript"><!-- function checkForm() { var error = 0; var error_message = "<?php echo JS_ERROR; ?>"; var contestant_name = document.enter_contest.contestant_name.value; var contestant_lastname = document.enter_contest.contestant_lastname.value; if (contestant_name.length < <?php echo ENTRANT_NAME_MIN_LENGTH; ?>) { error_message = error_message + "<?php echo JS_CONTESTANTS_NAME; ?>"; error = 1; } if (contestant_lastname.length < <?php echo ENTRANT_NAME_MIN_LENGTH; ?>) { error_message = error_message + "<?php echo JS_CONTESTANT_NAME; ?>"; error = 1; } if (error == 1) { alert(error_message); return false; } else { return true; } } function popupWindow(url) { window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=700,height=480,screenX=150,screenY=150,top=150,left=150') } //--></script> <link rel="stylesheet" type="text/css" href="stylesheet.css"> <script type="text/javascript" src="js/jquery.min.js"></script> <script type="text/javascript" src="js/home2.8.js"></script> <link rel="STYLESHEET" type="text/css" href="slides.css"> <script language="javaScript"> <!-- Begin function movepic(img_name,img_src) { document[img_name].src=img_src; } // End --> </script> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> <!-- header //--> <?php if ($languages_id=="1") { require(DIR_WS_INCLUDES . 'header.php'); } else { require(DIR_WS_INCLUDES . 'header-fr.php'); } ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" cellspacing="3" cellpadding="3"> <tr> <td width="<?php echo 1; ?>" valign="top"><table border="0" width="<?php echo 1; ?>" cellspacing="0" cellpadding="2"> <!-- left_navigation //--> <!-- left_navigation_eof //--> </table></td> <!-- body_text //--> <td width="100%" valign="top"><?php echo tep_draw_form('enter_contest', tep_href_link(FILENAME_ENTER_CONTEST, 'action=process'), 'post', 'onSubmit="return checkForm();"'); ?><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading" valign="top"><?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('contest') > 0) { ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><?php echo $messageStack->output('contest'); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } ?> <!-- begin prize display information --> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CONTEST); $time_now = date('Y-m-d'); if ($prize_product = tep_random_select("select p.products_id, pd.products_name, p.products_model, p.products_price, p.products_tax_class_id, p.products_image, hhs.prizes_value, hhs.status, hhs.prizes_date_added, hhs.expires_date from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRIZES . " hhs where p.products_status = '1' and p.products_id = hhs.products_id and pd.products_id = hhs.products_id and pd.language_id = '" . (int)$languages_id . "' and hhs.status = '1' and hhs.expires_date >= '" . $time_now . "' order by hhs.prizes_date_added desc limit 1")) { ?> <!-- prize //--> <tr> <td> <?php $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => BOX_HEADING_CONTEST); new infoBoxHeading($info_box_contents, false, false); $info_box_contents = array(); $info_box_contents[] = array('align' => 'center', 'text' => TEXT_CONTEST_ENDS . '<br>' . tep_date_long($prize_product['expires_date']) . '<br><br>' . TEXT_SIGN_UP_TODAY . '<br> <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $prize_product['products_id']) . '"><br><br>' . $prize_product['products_name'] . '<br>' . tep_image(DIR_WS_IMAGES . $prize_product['products_image'], 'Model : ' . $prize_product['products_model'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><br>Value: ' . '<span class="productSpecialPrice">' . $currencies->display_price($prize_product['prizes_value'], tep_get_tax_rate($prize_product['products_tax_class_id'])) . '</span>'); new infoBox($info_box_contents); ?> </td> </tr> <?php } ?> <!-- end prize display information --> <?php if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'success')) { ?> <tr> <td class="main" align="center"><?php echo TEXT_SUCCESS_THANKS; ?></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="main"> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td colspan="3" class="main" align="left"><?php echo TEXT_CONTEST_DETAILS; ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="smallText" align="left"></td> <td class="main" align="right"><?php echo '<a href="javascript:popupWindow('' . tep_href_link(FILENAME_POPUP_CONTEST) . '')">' . TEXT_CONTEST_HELP_LINK . '</a>'; ?> <img src="images/icons/button_more_info.gif" alt="Contest Details" valign="bottom"></td> <td class="main" align="right"></td> </tr> </table></td> </tr> </table></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="2" cellpadding="2"> <tr> <td class="main" width="30%"><?php echo ENTRY_NAME; ?></td> <td class="main"><?php echo tep_draw_input_field('contestant_name', '', 'size="28"') . ' <span class="inputRequirement">* ' . TEXT_REQUIRED . '</span>'; ?></td> </tr> <tr> <td class="main" width="30%"><?php echo ENTRY_LNAME; ?></td> <td class="main"><?php echo tep_draw_input_field('contestant_lastname', '', 'size="28"') . ' <span class="inputRequirement">* ' . TEXT_REQUIRED . '</span>'; ?></td> </tr> <tr> <td class="main"><?php echo ENTRY_EMAIL; ?></td> <td class="main"><?php echo tep_draw_input_field('contestant_email', '', 'size="28"') . ' <span class="inputRequirement">* ' . TEXT_REQUIRED . '</span>'; ?></td> </tr> <tr> <td class="main"><?php echo ENTRY_LOCATION; ?></td> <td class="main"><?php echo tep_draw_input_field('contestant_location', '', 'size="28"') . ' <span class="inputRequirement">* ' . TEXT_REQUIRED . '</span>'; ?></td> </tr> <!--<tr> <td class="main"><?php echo ENTRY_ENQUIRY; ?></td> </tr> <tr> <td colspan="2"><?php echo tep_draw_textarea_field('gb_text', 'soft', 60, 15); ?></td> </tr> <tr> <td colspan="2" class="smallText" align="right"><?php echo TEXT_NO_HTML; ?></td> </tr>--> </tr> </table></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></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 background="images/backgrounds/fineline.gif" border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td align="left"> <a href="javascript:history.back(-1);"><?php echo tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td> <td class="main" align="right"><?php echo tep_image_submit('button_submit.gif', IMAGE_BUTTON_SUBMIT); ?></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 1; ?>" valign="top"><table border="0" width="<?php echo 1; ?>" cellspacing="0" cellpadding="2"> <!-- right_navigation //--> <!-- 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'); ?>
  19. I got it working, it was a path issue, thanks for your help
  20. According to the link, I have to chenge the php5.ini, I changed it but it doesnt seem to work: here is what I get as a message now: Warning: require(includes/configure.php) [function.require]: failed to open stream: No such file or directory in /home/content/U/n/i/UnisonDigital/html/includes/application_top.php on line 29Fatal error: require() [function.require]: Failed opening required 'includes/configure.php' (include_path='.;C:phppear') in /home/content/U/n/i/UnisonDigital/html/includes/application_top.php on line 29 had to remove it because the whole site was down now what am I doing wrong?
×
×
  • Create New...