Hello all i have coded following Program to secure the application. But after executing , i am getting following error Check here PHP code
Output :
Deprecated: Function sql_regcase() is deprecated in /home/admin/public_html/test/protect.php on line 6 Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user 'root'@'localhost' (using password: NO) in /home/admin/public_html/test/protect.php on line 9 Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in /home/admin/public_html/test/protect.php on line 9
As well as please suggest me more secure way !
Thanks in advance
mysql_*functions to write new code. They are no longer maintained and the community has begun deprecation process. See the red box? Instead you should learn about prepared statements and use either PDO or MySQLi. If you can't decide which, this article will help you. If you pick PDO, here is good tutorial. Also see Why shouldn't I use mysql functions in PHP? - NullPoiиteя