Jump to content

Function

Members
  • Posts

    19
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Function's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Added date_default_timezone_set('America/Toronto'); Still getting the error. Is there more code that needed to added to php.ini?
  2. I'm getting this Time Zone error. Perhaps it's a compatibility issue with PHP 5.3. Looked all over for an answer without finding one. Here is the error message Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EST/-5.0/no DST' instead in /blocked.php on line 41 12/02/12 Here is the code. Line 41 is near the bottom, the one with the d,m,y. Perhaps the echo date (d/m/y") needs to be changed. Appreciate any help! <table border="3" width="16%" align="center" cellspacing="0" bgcolor="#FF6600" bordercolor="red" bordercolordark="red" bordercolorlight="red"> <tr> <td width="176"> <p align="center"><?php // shows IP Number on Page echo $ip; ?> </p> </td> </tr> </table> <p align="center"><?php // Show the user agent echo 'Your user agent is: <b>'.$_SERVER['HTTP_USER_AGENT'].'</b><br />';?></p> [b]<h1 align="center"><?php echo date("d/m/y");?></h1>[/b] </td> </tr> </table [,code]
  3. Could you be more specific as to what I need to add of change. Thanks a lot! tep_redirect(tep_href_link(FILENAME_BACKUP)); break; case 'restorenow': case 'restorelocalnow': tep_set_time_limit(0); if ($action == 'restorenow') { $read_from = $HTTP_GET_VARS['file'];
  4. OK, here is the whole thing. It's a bit long. <?php /* $Id: backup.php,v 1.60 2003/06/29 22:50:51 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'); $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : ''); if (tep_not_null($action)) { switch ($action) { case 'forget': tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'DB_LAST_RESTORE'"); $messageStack->add_session(SUCCESS_LAST_RESTORE_CLEARED, 'success'); tep_redirect(tep_href_link(FILENAME_BACKUP)); break; case 'backupnow': tep_set_time_limit(0); $backup_file = 'db_' . DB_DATABASE . '-' . date('YmdHis') . '.sql'; $fp = fopen(DIR_FS_BACKUP . $backup_file, 'w'); $schema = '# osCommerce, Open Source E-Commerce Solutions' . "\n" . '# http://www.oscommerce.com' . "\n" . '#' . "\n" . '# Database Backup For ' . STORE_NAME . "\n" . '# Copyright (c) ' . date('Y') . ' ' . STORE_OWNER . "\n" . '#' . "\n" . '# Database: ' . DB_DATABASE . "\n" . '# Database Server: ' . DB_SERVER . "\n" . '#' . "\n" . '# Backup Date: ' . date(PHP_DATE_TIME_FORMAT) . "\n\n"; fputs($fp, $schema); $tables_query = tep_db_query('show tables'); while ($tables = tep_db_fetch_array($tables_query)) { list(,$table) = each($tables); $schema = 'drop table if exists ' . $table . ';' . "\n" . 'create table ' . $table . ' (' . "\n"; $table_list = array(); $fields_query = tep_db_query("show fields from " . $table); while ($fields = tep_db_fetch_array($fields_query)) { $table_list[] = $fields['Field']; $schema .= ' ' . $fields['Field'] . ' ' . $fields['Type']; if (strlen($fields['Default']) > 0) $schema .= ' default \'' . $fields['Default'] . '\''; if ($fields['Null'] != 'YES') $schema .= ' not null'; if (isset($fields['Extra'])) $schema .= ' ' . $fields['Extra']; $schema .= ',' . "\n"; } $schema = preg_replace("/,\n$/", '', $schema); // add the keys $index = array(); $keys_query = tep_db_query("show keys from " . $table); while ($keys = tep_db_fetch_array($keys_query)) { $kname = $keys['Key_name']; if (!isset($index[$kname])) { $index[$kname] = array('unique' => !$keys['Non_unique'], 'columns' => array()); } $index[$kname]['columns'][] = $keys['Column_name']; } while (list($kname, $info) = each($index)) { $schema .= ',' . "\n"; $columns = implode($info['columns'], ', '); if ($kname == 'PRIMARY') { $schema .= ' PRIMARY KEY (' . $columns . ')'; } elseif ($info['unique']) { $schema .= ' UNIQUE ' . $kname . ' (' . $columns . ')'; } else { $schema .= ' KEY ' . $kname . ' (' . $columns . ')'; } } $schema .= "\n" . ');' . "\n\n"; fputs($fp, $schema); // dump the data $rows_query = tep_db_query("select " . implode(',', $table_list) . " from " . $table); while ($rows = tep_db_fetch_array($rows_query)) { $schema = 'insert into ' . $table . ' (' . implode(', ', $table_list) . ') values ('; reset($table_list); while (list(,$i) = each($table_list)) { if (!isset($rows[$i])) { $schema .= 'NULL, '; } elseif (tep_not_null($rows[$i])) { $row = addslashes($rows[$i]); $row = preg_replace("/\n#/", "\n".'\#', $row); $schema .= '\'' . $row . '\', '; } else { $schema .= '\'\', '; } } $schema = preg_replace('/, $/', '', $schema) . ');' . "\n"; fputs($fp, $schema); } } fclose($fp); if (isset($HTTP_POST_VARS['download']) && ($HTTP_POST_VARS['download'] == 'yes')) { switch ($HTTP_POST_VARS['compress']) { case 'gzip': exec(LOCAL_EXE_GZIP . ' ' . DIR_FS_BACKUP . $backup_file); $backup_file .= '.gz'; break; case 'zip': exec(LOCAL_EXE_ZIP . ' -j ' . DIR_FS_BACKUP . $backup_file . '.zip ' . DIR_FS_BACKUP . $backup_file); unlink(DIR_FS_BACKUP . $backup_file); $backup_file .= '.zip'; } header('Content-type: application/x-octet-stream'); header('Content-disposition: attachment; filename=' . $backup_file); readfile(DIR_FS_BACKUP . $backup_file); unlink(DIR_FS_BACKUP . $backup_file); exit; } else { switch ($HTTP_POST_VARS['compress']) { case 'gzip': exec(LOCAL_EXE_GZIP . ' ' . DIR_FS_BACKUP . $backup_file); break; case 'zip': exec(LOCAL_EXE_ZIP . ' -j ' . DIR_FS_BACKUP . $backup_file . '.zip ' . DIR_FS_BACKUP . $backup_file); unlink(DIR_FS_BACKUP . $backup_file); } $messageStack->add_session(SUCCESS_DATABASE_SAVED, 'success'); } tep_redirect(tep_href_link(FILENAME_BACKUP)); break; case 'restorenow': case 'restorelocalnow': tep_set_time_limit(0); if ($action == 'restorenow') { $read_from = $HTTP_GET_VARS['file']; if (file_exists(DIR_FS_BACKUP . $HTTP_GET_VARS['file'])) { $restore_file = DIR_FS_BACKUP . $HTTP_GET_VARS['file']; $extension = substr($HTTP_GET_VARS['file'], -3); if ( ($extension == 'sql') || ($extension == '.gz') || ($extension == 'zip') ) { switch ($extension) { case 'sql': $restore_from = $restore_file; $remove_raw = false; break; case '.gz': $restore_from = substr($restore_file, 0, -3); exec(LOCAL_EXE_GUNZIP . ' ' . $restore_file . ' -c > ' . $restore_from); $remove_raw = true; break; case 'zip': $restore_from = substr($restore_file, 0, -4); exec(LOCAL_EXE_UNZIP . ' ' . $restore_file . ' -d ' . DIR_FS_BACKUP); $remove_raw = true; } if (isset($restore_from) && file_exists($restore_from) && (filesize($restore_from) > 15000)) { $fd = fopen($restore_from, 'rb'); $restore_query = fread($fd, filesize($restore_from)); fclose($fd); } } } } elseif ($action == 'restorelocalnow') { $sql_file = new upload('sql_file'); if ($sql_file->parse() == true) { $restore_query = fread(fopen($sql_file->tmp_filename, 'r'), filesize($sql_file->tmp_filename)); $read_from = $sql_file->filename; } } if (isset($restore_query)) { $sql_array = array(); $sql_length = strlen($restore_query); $pos = strpos($restore_query, ';'); for ($i=$pos; $i<$sql_length; $i++) { if ($restore_query[0] == '#') { $restore_query = ltrim(substr($restore_query, strpos($restore_query, "\n"))); $sql_length = strlen($restore_query); $i = strpos($restore_query, ';')-1; continue; } if ($restore_query[($i+1)] == "\n") { for ($j=($i+2); $j<$sql_length; $j++) { if (trim($restore_query[$j]) != '') { $next = substr($restore_query, $j, 6); if ($next[0] == '#') { // find out where the break position is so we can remove this line (#comment line) for ($k=$j; $k<$sql_length; $k++) { if ($restore_query[$k] == "\n") break; } $query = substr($restore_query, 0, $i+1); $restore_query = substr($restore_query, $k); // join the query before the comment appeared, with the rest of the dump $restore_query = $query . $restore_query; $sql_length = strlen($restore_query); $i = strpos($restore_query, ';')-1; continue 2; } break; } } if ($next == '') { // get the last insert query $next = 'insert'; } if ( (preg_match('/create/i', $next)) || (preg_match('/insert/i', $next)) || (preg_match('/drop t/i', $next)) ) { $query = substr($restore_query, 0, $i); $next = ''; $sql_array[] = substr($restore_query, 0, $i); $restore_query = ltrim(substr($restore_query, $i+1)); $sql_length = strlen($restore_query); $i = strpos($restore_query, ';')-1; if (preg_match('/^create*/i', $query)) { $table_name = trim(substr($query, stripos($query, 'table ')+6)); $table_name = substr($table_name, 0, strpos($table_name, ' ')); } } } tep_db_query("drop table if exists address_book, address_format, banners, banners_history, categories, categories_description, configuration, configuration_group, counter, counter_history, countries, currencies, customers, customers_basket, customers_basket_attributes, customers_info, languages, manufacturers, manufacturers_info, orders, orders_products, orders_status, orders_status_history, orders_products_attributes, orders_products_download, products, products_attributes, products_attributes_download, prodcts_description, products_options, products_options_values, products_options_values_to_products_options, products_to_categories, reviews, reviews_description, sessions, specials, tax_class, tax_rates, geo_zones, whos_online, zones, zones_to_geo_zones"); for ($i=0, $n=sizeof($sql_array); $i<$n; $i++) { tep_db_query($sql_array[$i]); } tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'DB_LAST_RESTORE'"); tep_db_query("insert into " . TABLE_CONFIGURATION . " values ('', 'Last Database Restore', 'DB_LAST_RESTORE', '" . $read_from . "', 'Last database restore file', '6', '', '', now(), '', '')"); if (isset($remove_raw) && ($remove_raw == true)) { unlink($restore_from); } $messageStack->add_session(SUCCESS_DATABASE_RESTORED, 'success'); } tep_redirect(tep_href_link(FILENAME_BACKUP)); break; case 'download': $extension = substr($HTTP_GET_VARS['file'], -3); if ( ($extension == 'zip') || ($extension == '.gz') || ($extension == 'sql') ) { if ($fp === fopen(DIR_FS_BACKUP . $HTTP_GET_VARS['file'], 'rb')) { $buffer = fread($fp, filesize(DIR_FS_BACKUP . $HTTP_GET_VARS['file'])); fclose($fp); header('Content-type: application/x-octet-stream'); header('Content-disposition: attachment; filename=' . $HTTP_GET_VARS['file']); echo $buffer; exit; } } else { $messageStack->add(ERROR_DOWNLOAD_LINK_NOT_ACCEPTABLE, 'error'); } break; case 'deleteconfirm': if (strstr($HTTP_GET_VARS['file'], '..')) tep_redirect(tep_href_link(FILENAME_BACKUP)); tep_remove(DIR_FS_BACKUP . '/' . $HTTP_GET_VARS['file']); if (!$tep_remove_error) { $messageStack->add_session(SUCCESS_BACKUP_DELETED, 'success'); tep_redirect(tep_href_link(FILENAME_BACKUP)); } break; } } // check if the backup directory exists $dir_ok = false; if (is_dir(DIR_FS_BACKUP)) { if (is_writeable(DIR_FS_BACKUP)) { $dir_ok = true; } else { $messageStack->add(ERROR_BACKUP_DIRECTORY_NOT_WRITEABLE, 'error'); } } else { $messageStack->add(ERROR_BACKUP_DIRECTORY_DOES_NOT_EXIST, 'error'); } ?> <!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> <link rel="stylesheet" type="text/css" href="includes/stylesheet.css"> <script language="javascript" src="includes/general.js"></script> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" cellspacing="2" cellpadding="2"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft"> <!-- 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="2"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"><?php echo HEADING_TITLE; ?></td> <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td> </tr> </table></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_TITLE; ?></td> <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_FILE_DATE; ?></td> <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_FILE_SIZE; ?></td> <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td> </tr> <?php if ($dir_ok == true) { $dir = dir(DIR_FS_BACKUP); $contents = array(); while ($file = $dir->read()) { if (!is_dir(DIR_FS_BACKUP . $file)) { $contents[] = $file; } } sort($contents); for ($i=0, $n=sizeof($contents); $i<$n; $i++) { $entry = $contents[$i]; $check = 0; if ((!isset($HTTP_GET_VARS['file']) || (isset($HTTP_GET_VARS['file']) && ($HTTP_GET_VARS['file'] == $entry))) && !isset($buInfo) && ($action != 'backup') && ($action != 'restorelocal')) { $file_array['file'] = $entry; $file_array['date'] = date(PHP_DATE_TIME_FORMAT, filemtime(DIR_FS_BACKUP . $entry)); $file_array['size'] = number_format(filesize(DIR_FS_BACKUP . $entry)) . ' bytes'; switch (substr($entry, -3)) { case 'zip': $file_array['compression'] = 'ZIP'; break; case '.gz': $file_array['compression'] = 'GZIP'; break; default: $file_array['compression'] = TEXT_NO_EXTENSION; break; } $buInfo = new objectInfo($file_array); } if (isset($buInfo) && is_object($buInfo) && ($entry == $buInfo->file)) { echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">' . "\n"; $onclick_link = 'file=' . $buInfo->file . '&action=restore'; } else { echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">' . "\n"; $onclick_link = 'file=' . $entry; } ?> <td class="dataTableContent" onclick="document.location.href='<?php echo tep_href_link(FILENAME_BACKUP, $onclick_link); ?>'"><?php echo '<a href="' . tep_href_link(FILENAME_BACKUP, 'action=download&file=' . $entry) . '">' . tep_image(DIR_WS_ICONS . 'file_download.gif', ICON_FILE_DOWNLOAD) . '</a> ' . $entry; ?></td> <td class="dataTableContent" align="center" onclick="document.location.href='<?php echo tep_href_link(FILENAME_BACKUP, $onclick_link); ?>'"><?php echo date(PHP_DATE_TIME_FORMAT, filemtime(DIR_FS_BACKUP . $entry)); ?></td> <td class="dataTableContent" align="right" onclick="document.location.href='<?php echo tep_href_link(FILENAME_BACKUP, $onclick_link); ?>'"><?php echo number_format(filesize(DIR_FS_BACKUP . $entry)); ?> bytes</td> <td class="dataTableContent" align="right"><?php if (isset($buInfo) && is_object($buInfo) && ($entry == $buInfo->file)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_BACKUP, 'file=' . $entry) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td> </tr> <?php } $dir->close(); } ?> <tr> <td class="smallText" colspan="3"><?php echo TEXT_BACKUP_DIRECTORY . ' ' . DIR_FS_BACKUP; ?></td> <td align="right" class="smallText"><?php if ( ($action != 'backup') && (isset($dir)) ) echo '<a href="' . tep_href_link(FILENAME_BACKUP, 'action=backup') . '">' . tep_image_button('button_backup.gif', IMAGE_BACKUP) . '</a>'; if ( ($action != 'restorelocal') && isset($dir) ) echo ' <a href="' . tep_href_link(FILENAME_BACKUP, 'action=restorelocal') . '">' . tep_image_button('button_restore.gif', IMAGE_RESTORE) . '</a>'; ?></td> </tr> <?php if (defined('DB_LAST_RESTORE')) { ?> <tr> <td class="smallText" colspan="4"><?php echo TEXT_LAST_RESTORATION . ' ' . DB_LAST_RESTORE . ' <a href="' . tep_href_link(FILENAME_BACKUP, 'action=forget') . '">' . TEXT_FORGET . '</a>'; ?></td> </tr> <?php } ?> </table></td> <?php $heading = array(); $contents = array(); switch ($action) { case 'backup': $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_BACKUP . '</b>'); $contents = array('form' => tep_draw_form('backup', FILENAME_BACKUP, 'action=backupnow')); $contents[] = array('text' => TEXT_INFO_NEW_BACKUP); $contents[] = array('text' => '<br>' . tep_draw_radio_field('compress', 'no', true) . ' ' . TEXT_INFO_USE_NO_COMPRESSION); if (file_exists(LOCAL_EXE_GZIP)) $contents[] = array('text' => '<br>' . tep_draw_radio_field('compress', 'gzip') . ' ' . TEXT_INFO_USE_GZIP); if (file_exists(LOCAL_EXE_ZIP)) $contents[] = array('text' => tep_draw_radio_field('compress', 'zip') . ' ' . TEXT_INFO_USE_ZIP); if ($dir_ok == true) { $contents[] = array('text' => '<br>' . tep_draw_checkbox_field('download', 'yes') . ' ' . TEXT_INFO_DOWNLOAD_ONLY . '*<br><br>*' . TEXT_INFO_BEST_THROUGH_HTTPS); } else { $contents[] = array('text' => '<br>' . tep_draw_radio_field('download', 'yes', true) . ' ' . TEXT_INFO_DOWNLOAD_ONLY . '*<br><br>*' . TEXT_INFO_BEST_THROUGH_HTTPS); } $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_backup.gif', IMAGE_BACKUP) . ' <a href="' . tep_href_link(FILENAME_BACKUP) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'); break; case 'restore': $heading[] = array('text' => '<b>' . $buInfo->date . '</b>'); $contents[] = array('text' => tep_break_string(sprintf(TEXT_INFO_RESTORE, DIR_FS_BACKUP . (($buInfo->compression != TEXT_NO_EXTENSION) ? substr($buInfo->file, 0, strrpos($buInfo->file, '.')) : $buInfo->file), ($buInfo->compression != TEXT_NO_EXTENSION) ? TEXT_INFO_UNPACK : ''), 35, ' ')); $contents[] = array('align' => 'center', 'text' => '<br><a href="' . tep_href_link(FILENAME_BACKUP, 'file=' . $buInfo->file . '&action=restorenow') . '">' . tep_image_button('button_restore.gif', IMAGE_RESTORE) . '</a> <a href="' . tep_href_link(FILENAME_BACKUP, 'file=' . $buInfo->file) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'); break; case 'restorelocal': $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_RESTORE_LOCAL . '</b>'); $contents = array('form' => tep_draw_form('restore', FILENAME_BACKUP, 'action=restorelocalnow', 'post', 'enctype="multipart/form-data"')); $contents[] = array('text' => TEXT_INFO_RESTORE_LOCAL . '<br><br>' . TEXT_INFO_BEST_THROUGH_HTTPS); $contents[] = array('text' => '<br>' . tep_draw_file_field('sql_file')); $contents[] = array('text' => TEXT_INFO_RESTORE_LOCAL_RAW_FILE); $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_restore.gif', IMAGE_RESTORE) . ' <a href="' . tep_href_link(FILENAME_BACKUP) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'); break; case 'delete': $heading[] = array('text' => '<b>' . $buInfo->date . '</b>'); $contents = array('form' => tep_draw_form('delete', FILENAME_BACKUP, 'file=' . $buInfo->file . '&action=deleteconfirm')); $contents[] = array('text' => TEXT_DELETE_INTRO); $contents[] = array('text' => '<br><b>' . $buInfo->file . '</b>'); $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_BACKUP, 'file=' . $buInfo->file) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'); break; default: if (isset($buInfo) && is_object($buInfo)) { $heading[] = array('text' => '<b>' . $buInfo->date . '</b>'); $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_BACKUP, 'file=' . $buInfo->file . '&action=restore') . '">' . tep_image_button('button_restore.gif', IMAGE_RESTORE) . '</a> <a href="' . tep_href_link(FILENAME_BACKUP, 'file=' . $buInfo->file . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>'); $contents[] = array('text' => '<br>' . TEXT_INFO_DATE . ' ' . $buInfo->date); $contents[] = array('text' => TEXT_INFO_SIZE . ' ' . $buInfo->size); $contents[] = array('text' => '<br>' . TEXT_INFO_COMPRESSION . ' ' . $buInfo->compression); } break; } if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) { echo ' <td width="25%" valign="top">' . "\n"; $box = new box; echo $box->infoBox($heading, $contents); echo ' </td>' . "\n"; } ?> </tr> </table></td> </tr> </table></td> <!-- body_text_eof //--> </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'); ?>
  5. I'm just a beginner in PHP. Just started to use NetBeans. And when the back_up.php file is opened in NetBeans, it shows that there is a problem with the two lines: I don't know enough as to how to fix the problem with these two lines. break; case 'deleteconfirm':
  6. It might be in the code just above. Some where around : tep_redirect(tep_href_link(FILENAME_BACKUP)); for ($i=0, $n=sizeof($sql_array); $i<$n; $i++) { tep_db_query($sql_array[$i]); } tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'DB_LAST_RESTORE'"); tep_db_query("insert into " . TABLE_CONFIGURATION . " values ('', 'Last Database Restore', 'DB_LAST_RESTORE', '" . $read_from . "', 'Last database restore file', '6', '', '', now(), '', '')"); if (isset($remove_raw) && ($remove_raw == true)) { unlink($restore_from); } $messageStack->add_session(SUCCESS_DATABASE_RESTORED, 'success'); } tep_redirect(tep_href_link(FILENAME_BACKUP)); break; case 'download': $extension = substr($HTTP_GET_VARS['file'], -3); Thanks for helping!
  7. Can someone help to resolve this Parse, syntax error. Parse error: syntax error, unexpected T_CASE in /admin/backup.php on line 270 I believe the problem could be about have way down thsi code: break; case 'deleteconfirm': Appreciate any help! if ( ($extension == 'zip') || ($extension == '.gz') || ($extension == 'sql') ) { if ($fp === fopen(DIR_FS_BACKUP . $HTTP_GET_VARS['file'], 'rb')) { $buffer = fread($fp, filesize(DIR_FS_BACKUP . $HTTP_GET_VARS['file'])); fclose($fp); header('Content-type: application/x-octet-stream'); header('Content-disposition: attachment; filename=' . $HTTP_GET_VARS['file']); echo $buffer; exit; } } else { $messageStack->add(ERROR_DOWNLOAD_LINK_NOT_ACCEPTABLE, 'error'); } break; case 'deleteconfirm': if (strstr($HTTP_GET_VARS['file'], '..')) tep_redirect(tep_href_link(FILENAME_BACKUP)); tep_remove(DIR_FS_BACKUP . '/' . $HTTP_GET_VARS['file']); if (!$tep_remove_error) { $messageStack->add_session(SUCCESS_BACKUP_DELETED, 'success'); tep_redirect(tep_href_link(FILENAME_BACKUP)); } break; } }
  8. Would anyone have the answer to solve this error message? Deprecated: Function split() is deprecated in /includes/modules/shipping/table.php on line 57 Here is the code. Line 57 is in Bold. Preg_split is suppose to work. Tried preg_explode but that didn't work. Appreciate any help! $table_cost = preg_split("/[:,]/" , MODULE_SHIPPING_TABLE_COST); $size = sizeof($table_cost); for ($i=0, $n=$size; $i<$n; $i+=2) { if ($order_total <= $table_cost[$i]) { $shipping = $table_cost[$i+1]; break; } }
  9. I'm sorry! I'm fairly new to PHP and don't know what your talking about. I must seem like a dummy. This is the code I put in the only php.ini file I could find and the code file is right up near the top. register_globals = On // US TimeZones according to DateTime's official "List of Supported Timezones" $aTimeZones = array( 'America/New_York'=>'EDT', ); ?> It did not remove the error: Warning: strftime() [function.strftime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EST/-5.0/no DST' instead in /includes/modules/new_products.php on line 16 If you can help please tell me if that is right code and where am I to place it? Or what is the right code? I did read that You can set a default time zone for your server from the configuration file (php.ini) at the line: [Date] ; Defines the default timezone used by the date functions date.timezone = America/New_York I could not find a line that started with [Date]
  10. I need to put in Canada/Eastern What is the code and do I put it in the php.ini file? There's not much in this file. It only states: register_globals = On That's all that's in the code.
  11. Could you elaborate more about this fix. I'm fairly new to PHP. where would i find the php.ini code file? And just insert my area like: Canada/Eastern Thanks!
  12. Thanks! I removed the function. and now this warning appeared: Warning: mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EST/-5.0/no DST' instead in /includes/counter.php on line 27
  13. I have this error to resolve to be compatible with PHP 5.3: Parse error: syntax error, unexpected '.', expecting '(' in/includes/counter.php on line 27 Code Line 27 is: $counter_startdate_formatted = strftime(DATE_FORMAT_LONG, function.mktime(0, 0, 0, substr($counter_startdate, 4, 2), substr($counter_startdate, -2), substr($counter_startdate, 0, 4))); Appreciate any help!
  14. Should i just take out the second one? The only difference is the first one has [ ] type brackets around variable and second one has ( ) type brackets around variable. Does that matter?
  15. I've been trying to get the sessions.php script compatible to PHP 5.3 I now have this error: Fatal error: Cannot redeclare tep_session_unregister() (previously declared in /includes/functions/sessions.php:74) in /home/ecgnatur/public_html/store_us/includes/functions/sessions.php on line 86 Would anyone know what needs to be changed? Here is the code line 74 and 86 are in bold: session_set_save_handler('_sess_open', '_sess_close', '_sess_read', '_sess_write', '_sess_destroy', '_sess_gc'); } function tep_session_start() { return session_start(); } function tep_session_register($variable) { return isset($_SESSION[$variable]); } function tep_session_unregister($variable) { unset($_SESSION[$variable]); return; } function tep_session_is_registered($variable) { return ($_SESSION($variable)); } function tep_session_unregister($variable) { return ($_SESSION($variable)); } function tep_session_id($sessid = '') { if (!empty($sessid)) { return session_id($sessid); } else { return session_id(); } } Appreciate any help
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.