I have this weird problem with my variables.
this is a snippet of my code:
$chkfile = $_POST['chkfile'];
print $chkfile; // it prints "file.ext"
if(preg_match ("/(\w+).(\w+)/i",$chkfile, $matches))
print "there is a match";
else
print "no match";
the output for this program is "no match"
this is a weird problem because it can be fixed like this:
$chkfile = "file.ext"
if(preg_match ("/(\w+).(\w+)/i",$chkfile, $matches))
print "there is a match";
else
print "no match";
the output for this program is "there is a match"
it seems like my $_POST is working fine since in the first prgram
when I print the variable $chkfile it prints 'file.ext', but if I tend to use that variable ($chkfile) in a function whether it is preg_match or whatever it loses its content