Advertisement
Guest User

Untitled

a guest
Jul 10th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.35 KB | None | 0 0
  1. #!/usr/local/ruby-1.9.2/bin/ruby
  2.  
  3. require "cgi"
  4.  
  5. cgi = CGI.new()
  6. username = cgi["username"]
  7. password = cgi["password"]
  8.  
  9. users = File.open('../htdocs/files/login.txt','r')
  10.  
  11. while(line = users.gets) do
  12.     if line.split('//')[0] == username
  13.     puts "username match found"
  14.     else
  15.     puts "no match"
  16. end
  17. end
  18.       # Close the file
  19.       users.close
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement