demon2lima Posted August 23, 2005 Posted August 23, 2005 I have an error on line 35 and can't figure out how to fix it. Could someone please look at my code and give me a hand? I know what you are all thinking.....@#$$#@ newbs :rolleyes: here is the code to about line 45. Thanks! <?php /* $Id: categories.php,v 1.146 2003/07/11 14:40:27 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_CLASSES . 'currencies.php'); $currencies = new currencies(); $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : ''); if (tep_not_null($action)) { switch ($action) { case 'setflag': if ( ($HTTP_GET_VARS['flag'] == '0') || ($HTTP_GET_VARS['flag'] == '1') ) { if (isset($HTTP_GET_VARS['pID'])) { tep_set_product_status($HTTP_GET_VARS['pID'], $HTTP_GET_VARS['flag']); /* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */ if (USE_CACHE == 'true') { tep_reset_cache_block('categories'); tep_reset_cache_block('also_purchased'); /* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */ /* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */ tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $HTTP_GET_VARS['cPath'] . '&pID=' . $HTTP_GET_VARS['pID'/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */ break; case 'insert_category': case 'update_category': if (isset($HTTP_POST_VARS['categories_id'])) $categories_id = tep_db_prepare_input($HTTP_POST_VARS['categories_id']); $sort_order = tep_db_prepare_input($HTTP_POST_VARS['sort_order']); $sql_data_array = array('sort_order' => $sort_order); if ($action == 'insert_category') { $insert_sql_data = array('parent_id' => $current_category_id, 'date_added' => 'now()');
Guest Posted August 23, 2005 Posted August 23, 2005 this line tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $HTTP_GET_VARS['cPath'] . '&pID=' . $HTTP_GET_VARS['pID'/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */ seems messed up. comments within the array elements better go back to the contribution readme file and check what's going on. should be something like this: tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $HTTP_GET_VARS['cPath'] . '&pID=' . $HTTP_GET_VARS['pID']));
demon2lima Posted August 23, 2005 Author Posted August 23, 2005 this line tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $HTTP_GET_VARS['cPath'] . '&pID=' . $HTTP_GET_VARS['pID'/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */ seems messed up. comments within the array elements better go back to the contribution readme file and check what's going on. should be something like this: ? ? ? ?tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $HTTP_GET_VARS['cPath'] . '&pID=' . $HTTP_GET_VARS['pID'])); <{POST_SNAPBACK}> That was an error I missed but after I fixed it it now gives me an error in line 37. I think the problem is with the break entry but I'm not sure. The help file in the package is of no help at all and I just don't know PHP that well at all yet. Thanks for your help. tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $HTTP_GET_VARS['cPath'] . '&pID=' . $HTTP_GET_VARS['pID'/* End Header_Tags_Controller-2.5.4-2 - installed by contrib_installer */ break; case 'insert_category': case 'update_category': if (isset($HTTP_POST_VARS['categories_id'])) $categories_id = tep_db_prepare_input($HTTP_POST_VARS['categories_id']); $sort_order = tep_db_prepare_input($HTTP_POST_VARS['sort_order']); $sql_data_array = array('sort_order' => $sort_order);
Guest Posted August 23, 2005 Posted August 23, 2005 well the rest of the code is in good shape either. brackets missing you will get lots of errors. When you added the header tags looks like lots of things broke. Just the first part of your code should look like this: ? ?switch ($action) { ? ? ?case 'setflag': ? ? ? ?if ( ($HTTP_GET_VARS['flag'] == '0') || ($HTTP_GET_VARS['flag'] == '1') ) { ? ? ? ? ?if (isset($HTTP_GET_VARS['pID'])) { ? ? ? ? ? ?tep_set_product_status($HTTP_GET_VARS['pID'], $HTTP_GET_VARS['flag']); ? ? ? ? ?} ? ? ? ? ?if (USE_CACHE == 'true') { ? ? ? ? ? ?tep_reset_cache_block('categories'); ? ? ? ? ? ?tep_reset_cache_block('also_purchased'); ? ? ? ? ?} ? ? ? ?} ? ? ? ?tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $HTTP_GET_VARS['cPath'] . '&pID=' . $HTTP_GET_VARS['pID'])); ? ? ? ?break;
demon2lima Posted August 23, 2005 Author Posted August 23, 2005 Thanks for your help on this but its going to take some time for me to get through this...... I wish it wasn't PHP...I'd be so much better off. I'm not sure I can fix this one. :sweating:
Recommended Posts
Archived
This topic is now archived and is closed to further replies.