Question
Write a PHP function checkPass that takes two arguments: $user and $password and returns the UserID if the password matches the MD5 encoding of the
Write a PHP function "checkPass" that takes two arguments: $user and $password and returns the UserID if the password matches the MD5 encoding of the appropriate password in the interview_user_info table below and -1 otherwise.
The $user variable contains the NetID of the individual; the $password variable contains a clear-text version of the password as submitted.
+---------------------------------------------------------------------------------+ | interview_user_info | +-----------+-------------+-----------+--------+----------------------------------+ | UserID | LastName | FirstName | NetID | Passwd | +-----------+-------------+-----------+--------+----------------------------------+ | 469562029 | Gonzalez | Shauntee | sgonz | 530b4a0ae65148d112537bc0eafba9c9 | | 702930431 | Bates | Austin | abates | 9cdfb439c7876e703e307864c9167a15 | +-----------+-------------+-----------+--------+----------------------------------+
The connection and database selection are taken care of. Write the query to pull data from the table "interview_user_info", and return the result. The connection will be closed for you.
Hint: You will likely need to make use of the following functions and possibly others: md5, mysql_query, mysql_fetch_assoc
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started