I have a website that is hosted on the IIS. Users who logs into my page, searches for information about an order using an order ID . I would like to display the order IDs that particular user has searched in the past as history on the same page. Hence i decide to write those order IDS that the user has searched into text file under the user name and store it somewhere in the IIS (if possible,i do not know if its possible) and retrieve the same to display as order history. Can someone tell me how to go about this one? Any help is appreciated. Thank you all for your help!
Share
Personally, I would not approach your objective in the way you have described.
Because your application obviously already has a database in which orders are stored, I’d see no reason not to put prior search history information there as well. If you had reason not to do so, I’d at least persist the information in a cookie that could be updated by your server code fairly simply. The downside of using a cookie, however, is that the user’s information will not persist to other machines or different browsers on the same machine.
You could construct a fairly simple table called “last_searches” having fields for user_id and search string. You’d then just programmatically update that with each search that was attempted.