andre07mn Posted April 10, 2008 Share Posted April 10, 2008 Hi I'm brazilian and I'm new in this forum.... I entered in this forum behind some help.... I have a problem with the submit button from my form..... when I click to send my information to the next page, my browser show me a erro saying: The page was not found..... I have 3 pages with the same problem in the submit button..... In the server where my site is, the button works perfectly, but in my local server, doesn't works.... I'll post the code from one of the pages, to see if someone can help me to solve this problem..... <?php /* $Id: account_edit.php,v 1.65 2003/06/09 23:03:52 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url] Copyright © 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); if (!tep_session_is_registered('customer_id')) { $navigation->set_snapshot(); tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); } // needs to be included earlier to set the success message in the messageStack require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT_EDIT); $error = false; if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process')) { if (ACCOUNT_GENDER == 'true') $gender = tep_db_prepare_input($HTTP_POST_VARS['gender']); $firstname = tep_db_prepare_input($HTTP_POST_VARS['firstname']); if( isset($HTTP_POST_VARS['cpf']) ) { $cpf = tep_db_prepare_input($HTTP_POST_VARS['cpf']); if (strlen($cpf) < 11) { $error = true; $messageStack->add('account_edit', 'CPF deve conter 11 caracteres.'); } }else{ $cnpj = tep_db_prepare_input($HTTP_POST_VARS['cnpj']); $ie = tep_db_prepare_input($HTTP_POST_VARS['ie']); $razao = tep_db_prepare_input($HTTP_POST_VARS['razao']); $isento = $HTTP_POST_VARS['isento']; //print_r($HTTP_POST_VARS); //die(">>".$isento); if (!$razao) { $error = true; $messageStack->add('account_edit', 'Preencha a sua razão social.'); } if (strlen($cnpj)!=14) { $error = true; $messageStack->add('account_edit', 'CNPJ deve conter 14 caracteres.'); } if (!$ie && !$isento) { $error = true; $messageStack->add('account_edit', 'Preencha sua inscrição estadual, ou marque isento.'); } } if (ACCOUNT_DOB == 'true') $dob = tep_db_prepare_input($HTTP_POST_VARS['dob']); $email_address = tep_db_prepare_input($HTTP_POST_VARS['email_address']); $telephone = tep_db_prepare_input($HTTP_POST_VARS['telephone']); $fax = tep_db_prepare_input($HTTP_POST_VARS['fax']); if (ACCOUNT_GENDER == 'true') { if ( ($gender != 'm') && ($gender != 'f') ) { $error = true; $messageStack->add('account_edit', ENTRY_GENDER_ERROR); } } if (strlen($firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) { $error = true; $messageStack->add('account_edit', ENTRY_FIRST_NAME_ERROR); } if (ACCOUNT_DOB == 'true') { if (!$_POST['dob'] || !checkdate(substr(tep_date_raw($dob), 4, 2), substr(tep_date_raw($dob), 6, 2), substr(tep_date_raw($dob), 0, 4))) { $error = true; $messageStack->add('account_edit', ENTRY_DATE_OF_BIRTH_ERROR); } } if (strlen($email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) { $error = true; $messageStack->add('account_edit', ENTRY_EMAIL_ADDRESS_ERROR); } if (!tep_validate_email($email_address)) { $error = true; $messageStack->add('account_edit', ENTRY_EMAIL_ADDRESS_CHECK_ERROR); } $check_email_query = tep_db_query("select count(*) as total from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "' and customers_id != '" . (int)$customer_id . "'"); $check_email = tep_db_fetch_array($check_email_query); $check_news_email_query = tep_db_query("select customers_email_address as email from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'"); $check_news_email = tep_db_fetch_array($check_news_email_query); $check_news_query = tep_db_query("select count(*) as total from news_subscribers where email = '" . tep_db_input($check_news_email['email']) . "'"); $check_news = tep_db_fetch_array($check_news_query); if ($check_news['total'] > 0) { tep_db_query("UPDATE news_subscribers SET email = '" . tep_db_input($email_address) . "' WHERE email ='" . $check_news_email['email'] ."'"); } if ($check_email['total'] > 0) { $error = true; $messageStack->add('account_edit', ENTRY_EMAIL_ADDRESS_ERROR_EXISTS); } if (strlen($telephone) < ENTRY_TELEPHONE_MIN_LENGTH) { $error = true; $messageStack->add('account_edit', ENTRY_TELEPHONE_NUMBER_ERROR); } if ($error == false) { $sql_data_array = array('customers_firstname' => $firstname, 'customers_email_address' => $email_address, 'customers_telephone' => $telephone, 'cpf' => $cpf, 'cnpj' => $cnpj, 'ie' => $ie, 'razao' => $razao, 'isento' => $isento ? '1' : '0', 'customers_fax' => $fax); if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $gender; if (ACCOUNT_DOB == 'true') $sql_data_array['customers_dob'] = tep_date_raw($dob); tep_db_perform(TABLE_CUSTOMERS, $sql_data_array, 'update', "customers_id = '" . (int)$customer_id . "'"); //die("update " . TABLE_CUSTOMERS_INFO . " set customers_info_date_account_last_modified = now() where customers_info_id = '" . (int)$customer_id . "'"); $sql_up = 'update customers set isento = ' . ($isento ? '1' : '0') . ' where customers_id = ' . $customer_id; tep_db_query($sql_up); tep_db_query("update " . TABLE_CUSTOMERS_INFO . " set customers_info_date_account_last_modified = now() where customers_info_id = '" . (int)$customer_id . "'"); $sql_data_array = array('entry_firstname' => $firstname); tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array, 'update', "customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$customer_default_address_id . "'"); // reset the session variables $customer_first_name = $firstname; $messageStack->add_session('account', SUCCESS_ACCOUNT_UPDATED, 'success'); tep_redirect(tep_href_link(FILENAME_ACCOUNT, '', 'SSL')); } } $account_query = tep_db_query("select customers_gender, cpf, cnpj, razao, isento, ie, customers_firstname, customers_dob, customers_email_address, customers_telephone, customers_fax from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'"); $account = tep_db_fetch_array($account_query); $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL')); $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL')); ?> <!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; */ ?>"> --> <base href="localhost/"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> <?php require('includes/form_check.js.php'); ?> </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="0" cellpadding="0"> <tr> <!-- body_text //--> <td width="100%" valign="top"><?php echo tep_draw_form('account_edit', tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL'), 'post', 'onSubmit="return check_form(account_edit);"') . tep_draw_hidden_field('action', 'process'); ?><table border="0" width="100%" cellspacing="0" cellpadding="0"> <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('account_edit') > 0) { ?> <tr> <td><?php echo $messageStack->output('account_edit'); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } ?> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="main"><b><?php echo MY_ACCOUNT_TITLE; ?></b></td> <td class="inputRequirement" align="right"><?php echo FORM_REQUIRED_INFORMATION; ?></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" cellspacing="2" cellpadding="2"> <?php if($account['cpf']){ ?> <tr> <td class="main">CPF</td> <td class="main"><?php echo tep_draw_input_field('cpf','','class="campocontato" style="width:334px" value="' . $account['cpf'] . '"') . ' ' ?></td> </tr> <? }else{ ?> <tr> <td class="main">CNPJ</td> <td class="main"><?php echo tep_draw_input_field('cnpj','','class="campocontato" style="width:334px" value="' . $account['cnpj'] . '"') . ' '?></td> </tr> <tr> <td class="main">Razão Social</td> <td class="main"><?php echo tep_draw_input_field('razao','','class="campocontato" style="width:334px" value="' . $account['razao'] . '"') . ' '; ?></td> </tr> <tr> <td class="main">IE</td> <td class="main"> <?php echo tep_draw_input_field('ie','','class="campocontato" style="width:334px" value="' . $account['ie'] . '"') . ' '; ?><input type="checkbox" name="isento" class="campocontato" <?php echo $account['isento'] == 1 ? " checked" : "" ?>> Isento</td> </tr> <? } ?> <?php if (ACCOUNT_GENDER == 'true') { if (isset($gender)) { $male = ($gender == 'm') ? true : false; } else { $male = ($account['customers_gender'] == 'm') ? true : false; } $female = !$male; ?> <tr> <td class="main"><?php echo ENTRY_GENDER; ?></td> <td class="main"><?php echo tep_draw_radio_field('gender', 'm', $male) . ' ' . MALE . ' ' . tep_draw_radio_field('gender', 'f', $female) . ' ' . FEMALE . ' ' . (tep_not_null(ENTRY_GENDER_TEXT) ? '<span class="inputRequirement">' . ENTRY_GENDER_TEXT . '</span>': ''); ?></td> </tr> <?php } ?> <tr> <td class="main"><?php echo ENTRY_FIRST_NAME; ?></td> <td class="main"><?php echo tep_draw_input_field('firstname','','class="campocontato" style="width:334px" value="' . $account['customers_firstname'] . '"') . ' ' . (tep_not_null(ENTRY_FIRST_NAME_TEXT) ? '<span class="inputRequirement">' . ENTRY_FIRST_NAME_TEXT . '</span>': ''); ?></td> </tr> <?php if (ACCOUNT_DOB == 'true') { ?> <tr> <td class="main"><?php echo ENTRY_DATE_OF_BIRTH; ?></td> <td class="main"><?php echo tep_draw_input_field('dob','','class="campocontato" value="' . preg_replace('/(\d{4})-(\d{2})-(\d{2}).*/','\3/\2/\1',$account['customers_dob']) . '"', tep_date_short($account['customers_dob'])) . ' ' . (tep_not_null(ENTRY_DATE_OF_BIRTH_TEXT) ? '<span class="inputRequirement">' . ENTRY_DATE_OF_BIRTH_TEXT . '</span>': ''); ?></td> </tr> <?php } ?> <tr> <td class="main"><?php echo ENTRY_EMAIL_ADDRESS; ?></td> <td class="main"><?php echo tep_draw_input_field('email_address','','class="campocontato" style="width:334px" value="' . $account['customers_email_address'] . '"') . ' ' . (tep_not_null(ENTRY_EMAIL_ADDRESS_TEXT) ? '<span class="inputRequirement">' . ENTRY_EMAIL_ADDRESS_TEXT . '</span>': ''); ?></td> </tr> <tr> <td class="main"><?php echo ENTRY_TELEPHONE_NUMBER; ?></td> <td class="main"><?php echo tep_draw_input_field('telephone','','class="campocontato" style="width:334px" value="' . $account['customers_telephone'] . '"') . ' ' . (tep_not_null(ENTRY_TELEPHONE_NUMBER_TEXT) ? '<span class="inputRequirement">' . ENTRY_TELEPHONE_NUMBER_TEXT . '</span>': ''); ?></td> </tr> <tr> <td class="main"><?php echo $account['cpf'] ? 'Celular' : ENTRY_FAX_NUMBER; ?></td> <td class="main"><?php echo tep_draw_input_field('fax','','class="campocontato" style="width:334px" value="' . $account['customers_fax'] . '"') . ' ' . (tep_not_null(ENTRY_FAX_NUMBER_TEXT) ? '<span class="inputRequirement">' . ENTRY_FAX_NUMBER_TEXT . '</span>': ''); ?></td> </tr> </table></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 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><?php echo '<a href="account.php">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; /* echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; */ ?></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> </table></form></td> <!-- body_text_eof //--> </tr> </table> <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.