PHP using a passed value to open a dir, not working
- by HadoukenGr
This is my code
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Gallery</title>
<script src="js/jquery-1.7.2.min.js"></script>
<script src="js/lightbox.js"></script>
<link href="css/lightbox.css" rel="stylesheet" />
</head>
<body>
<?php
$value=$_GET["value"];
$handle = opendir("content/$value/gallery/");
while($file = readdir($handle))
{
if($file !== '.' && $file !== '..')
{
do_something;
}
}
?>
</body>
</html>
Passing value "?a??????",
gives Warning: opendir(content/?a??????/gallery/): failed to open dir: No such file or directory.
But if i do this :
$handle = opendir("content/?a??????/gallery/");
it works fine.
Something to do with character encoding? How could i solve this?
Thank you.