in reply to Re^2: perl grep help!
in thread perl grep help!

How would I get it so users define the username and password as its meant to be a login type script?

You ask for user input, whether reading from the STDIN, taking command-line arguments, or reading a file with login credentials.

Replies are listed 'Best First'.
Re^4: perl grep help!
by bogglemaster89 (Novice) on Mar 09, 2010 at 17:52 UTC
    i added:
    print "please enter a username /n"; my $usernameentered = <STDIN>; print "please enter a password /n"; my $passwordentered = <STDIN>;
    to the top of the script i also changed the ? to a real username and password it failed with the following.... DBD::mysql::st execute failed: called with 2 bind variables login.pl line 16. SQL Error: called with 2 bind variables when 0 are needed im guessing this maybe becasue this is where my <STDIN> where meant to go? sorry to keep bombarding you with questions but im really stuck! bogglemaster89 UPDATE- I replaced what I typed with question marks, it runs now, but im not sure what to do to get it to match these passwords and if they dont match through an error.......to the end-user of course not me!

      Read chomp and read the DBI documentation on placeholders. Given that you had to be told not to pull back all of the rows of a table and compare the values of each row, I suggest you learn some basic SQL also. There are many good resources online. You don't seem to be taking the advice you're given in reply to your various questions.

        Thankyou so much! :-D it works now! errm it was because of chomp.....ive used these before and SQL but I have a memory problem (its medical, trust me im not talking BS) so I literally forget pretty much everything after a week or two!