$recfile = $_GET[r];
if (file_exists('CustDat/' . $recfile))
{...............
Normally works correctly but if $_GET[r] returns a null then file_exists returns True.
Seems a bit odd to me
Bob
file_exists bug?
Moderator: General Moderators
-
Bob Kellock
- Forum Newbie
- Posts: 10
- Joined: Fri Oct 30, 2009 10:57 am
- Location: Wiltshire, UK
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: file_exists bug?
If $recfile is empty then you are checking the dir 'CustDat/' which is a file and I assume does existBob Kellock wrote:$recfile = $_GET[r];
if (file_exists('CustDat/' . $recfile))
{...............
Normally works correctly but if $_GET[r] returns a null then file_exists returns True.
Seems a bit odd to me
Bob
Try is_file() or work on your program logic so that you don't do the check if the var is empty (makes more sense). Your code is sloppy.
-Shawn
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.