Login success with members.php! 🆒
Bjom;10945331 wrote:Sanitize the userinput. If the code above is what your are doing, then you have "sql-inject me" written all over it. Logins warrant some security condsiderations...
(the above link shows some old-school measures matching your old-school mysql approach. have a look at mysqli and prepared statements for new-school 😉)
Ammendment 4: Never use @ to suppress errors.
Ammendment 5: see signature
"mysql_real_escape_string" has now been added to POST. Hopefully that takes care of injection problems. Can mysqli be taken advantage of on 4.1.22?
In regards to using @, it is a commonly used method for hiding crucial information that you wouldn't normally want any visitor to see, no?
The error returned when using die() seemed real straightforward to the end user. With E_USER_ERROR it is now "Fatal error: You must provide a username and password. in /home/icexb/public_html/login.php on line 10" That seems like more information than needed, and not in a particularly elegant way. 😕