XRS Posted June 6, 2010 Share Posted June 6, 2010 Hello. I've almost finished my script and I want to protect it a simple way. I don't want users pay it for or something else. Let's give an example. I have an application that makes a login to a website (with username and password) I want that the script, when user insert user and pass, read a serverside file (logins.txt) and check if inputed user is there. If so, the app continues, if not, shows a MSGBox and exit. The txt file with usernames should be this way: user1 user2 user3 Can someone help me how to get this? This seems to be the easiest mode to protect my app. Link to comment Share on other sites More sharing options...
sahsanu Posted June 6, 2010 Share Posted June 6, 2010 I have an application that makes a login to a website (with username and password) I want that the script, when user insert user and pass, read a serverside file (logins.txt) and check if inputed user is there. If so, the app continues, if not, shows a MSGBox and exit. The txt file with usernames should be this way: user1 user2 user3 Can someone help me how to get this? This seems to be the easiest mode to protect my app. Maybe below code could help you to accomplish your goal: $sUser="userX" ;Or whatever method you are using to get the user name $sLoginText="http://yourdomain.tld/logins.txt" $sInetRead=BinaryToString(InetRead($sLoginText,1)) $iChecking=StringRegExp($sInetRead,"\Q" & $sUser & "\E") If $iChecking=0 Then MsgBox(16,"Sorry but...","The user " & $sUser & " is not authorized to use this application") Exit EndIf ;If user matches then continue... Cheers, sahsanu Link to comment Share on other sites More sharing options...
Juvigy Posted June 7, 2010 Share Posted June 7, 2010 Checkout the hash and encryption functions available : SHA1_MD5_RC4_BASE64_CRC32 Link to comment Share on other sites More sharing options...
XRS Posted June 7, 2010 Author Share Posted June 7, 2010 (edited) Thanks for help me. I'll try it now = ) Edit : It works like a charm! Thanks Edited June 7, 2010 by XRS Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now