Frameset is not opening correctly in web

I have set myframeset is designated frameset for web. When un-registered users opens this db in web, left frame shows the link for registration form and right frame shows the text message “Please register”. If user try to open this db home page, this setting is working perfectly. Registered users can send doclinks in mail to others. when un-registered users click this link, documnent is opening. Left frame is showing link to registration but in right frame document is opening instead of the "please register " message.

I want any un-reg user try open my db or any document in db , it should ask for registration.

     I,ve designed right frame type is "URL". and my formula is

key:=@If(forceR=“Yes” & res=“no”;“HomePageConfigUnreg”;“HomePageConfig”);

“http://” + @GetHTTPHeader(“Host”) + “/” + @Text(@WebDbName) + “/HomePageSetup/” +@Text(key) + “?OpenDocument”

Please help me how to solve this problem

Thanks,

G Pradeep Kumar