marnitz Posted September 23, 2006 Posted September 23, 2006 I am writing my own mod at the moment but is still a beginner with php and mysql. The mod is a script used for logging all favorite searches for a customer in the db so that the customer can do a quick search of all his favorite searches and get all the search results with one click after logging in. I have modified the advanced_search.php and advanced_search_results.php file, updated the filenames.php file and everything else (I think) necessary to make this work. The new my_favorite_searches.php (modified advanced_search.php) file calls a script (with include..) I wrote that does all the form checking, writing to db etc (lets call this myscript.php). (This script works 100% on it's own) I check if a customer is logged in as customer_id is one of the fields in the favorite_searches table to make this script work. It is checked with: if (!tep_session_is_registered('customer_id')) { $navigation->set_snapshot(); tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); } as usual, but the problem is that as soon as you have entered your favorite searhces and do a search or save them to the db you are redirected to the login page AGAIN. I have checked if the customer_id variable is pulled from the db after logging in, and it is, but it gets lost after submitting the form again. What seems to be the problem? 1) When you write a new mod like this must ALL variables used in your new script be registered with tep_session_register(), and if it must, in which php file must I register them, myscript.php or my_favorite_searches.php or any other file?? 2) Must the myscript.php be part of the my_favorite_searches.php, in other words, must I rather place the script contents inside my_favorite_searches.php so that it is not called using include? 3) Can it be anyting else? Hope someone can help...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.