celia_ccs Posted September 22, 2005 Posted September 22, 2005 Hi, I'm developping a new contribution for updating the homepage. But I have a very simple problem. In the admin interface the contrib has quite the same srtucture as the categories.php file. Once done an update or inserted a new element you can preview the results and then go back and edit it again if you want, or save it. But I struggle to display again the data in the editing page after doing back from the preview. If it's a new element, nothing appears when I go back. If it's an updated element, only the older data from the database are displayed. if someone could explain what in the code of categories.php enable that the data appears again when u go from action=new_product_preview back to to new_product. I mean the updated data or the new data if it's a new product. I don't know if it's clear ? :huh: any help would be useful. Thanks. Celia ----------------------------------------- OSCommerce version : MS2 Contributions installed : AdminMS2, Dynamic Mopics V3, WYSIWYG HTML Area MS2, Easypopulate
Guest Posted September 22, 2005 Posted September 22, 2005 make sure the arguments you need in both pages are re-posted. See how he does with the $back_url and $back_url_params appending the values/args.
celia_ccs Posted September 22, 2005 Author Posted September 22, 2005 ok, I thought so, but I was not sure how to do that. is this part of the code that is used to re-post the information to the previous page? /* Re-Post all POST'ed variables */ reset($HTTP_POST_VARS); while (list($key, $value) = each($HTTP_POST_VARS)) { if (!is_array($HTTP_POST_VARS[$key])) { echo tep_draw_hidden_field($key, htmlspecialchars(stripslashes($value))); } } $languages = tep_get_languages(); for ($i=0, $n=sizeof($languages); $i<$n; $i++) { echo tep_draw_hidden_field('products_name[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_name[$languages[$i]['id']]))); echo tep_draw_hidden_field('products_description[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_description[$languages[$i]['id']]))); echo tep_draw_hidden_field('products_url[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_url[$languages[$i]['id']]))); } echo tep_draw_hidden_field('products_image', stripslashes($products_image_name)); echo tep_image_submit('button_back.gif', IMAGE_BACK, 'name="edit"') . ' '; if (isset($HTTP_GET_VARS['pID'])) { echo tep_image_submit('button_update.gif', IMAGE_UPDATE); } else { echo tep_image_submit('button_insert.gif', IMAGE_INSERT); } echo ' <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($HTTP_GET_VARS['pID']) ? '&pID=' . $HTTP_GET_VARS['pID'] : '')) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?> ----------------------------------------- OSCommerce version : MS2 Contributions installed : AdminMS2, Dynamic Mopics V3, WYSIWYG HTML Area MS2, Easypopulate
Guest Posted September 22, 2005 Posted September 22, 2005 yes thats the one. now look the tep_draw_form above that code. That should have the action specified.
celia_ccs Posted September 23, 2005 Author Posted September 23, 2005 Unfortunately it still doesn't work. :( Now it doesn't even go to the editing page after the preview. I've posted the code of my page on the contribution forum. Would be nice if someone could give me a hand there. thanks, http://www.oscommerce.com/forums/index.php?act=ST&f=41&t=172075 ----------------------------------------- OSCommerce version : MS2 Contributions installed : AdminMS2, Dynamic Mopics V3, WYSIWYG HTML Area MS2, Easypopulate
Guest Posted September 23, 2005 Posted September 23, 2005 what are the arguments on the address bar after clicking the back button? Are the sid and action fields set? I cannot get to the link you provided. I get an error here.
celia_ccs Posted September 24, 2005 Author Posted September 24, 2005 sorry, I had to upload the contribution package for this thread to be available. You can check it again if you wish. thanks :blush: ----------------------------------------- OSCommerce version : MS2 Contributions installed : AdminMS2, Dynamic Mopics V3, WYSIWYG HTML Area MS2, Easypopulate
Recommended Posts
Archived
This topic is now archived and is closed to further replies.