為了改善您的使用體驗,本網站正在進行維護,部分功能暫時無法使用。若本站的文件無法解決您的問題,想要向社群發問的話,請到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 發問,我們的社群成員將很快會回覆您的疑問。

搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

The nsIPromptService promptUsernameAndPassword is not working

more options

I have run the username/password code in php, and it doesn't run the code! Am I missing something here?

I've tried put the code into the php file, or imported it... please help :(

I have run the username/password code in php, and it doesn't run the code! Am I missing something here? I've tried put the code into the php file, or imported it... please help :(

所有回覆 (5)

more options

Are you creating an add-on?? That method is for use in add-ons, not websites.

https://developer.mozilla.org/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIPromptService (note the reference to privileged code)

more options

Is there a way I can put a Username/Password box in website (without a server)?

more options

How do you display your website without a server, is it a set of files on your own computer?

more options

I don't know how to secure local files from being opened using file:/// URLs. You can add a form to any page, but I don't think it will be operable. You could search around on the web for a solution, or try one of these sites: Where to go for developer support.