0
I am having these Warning while running this code on my localhost someone could give me some solution?
Thank you ^^
<?php
$target = "http://localhost:8080/game/c_images/album1584/";
$weeds = array('.', '..');
$sucess = "";
$directories = array_diff(scandir($target), $weeds);
if (is_dir($target)) {
foreach($directories as $value)
{
$gifkill = str_replace('.gif', '', $value);
$gif2kill = str_replace('.GIF', '', $gifkill);
$uppercasewords = ucwords($gif2kill);
if(is_file($target.$value))
{
echo "INSERT INTO `holly`.`badge_definitions` (`code`, `required_right`) VALUES ('".$uppercasewords."', '');<br />";
$sucess = true;
}
if($sucess == false){
echo "Não foi possível executar";
}else{
echo "Show!!";
}
}
}else{
echo "nao deu";
}?>
Warning: scandir(http://localhost:8080/game/c_images/album1584/): failed to open dir: not implemented in C:\xampp\htdocs\game\c_images\album1584\badgedef.php on line 13
Warning: scandir(): (errno 2): No such file or directory in C:\xampp\htdocs\game\c_images\album1584\badgedef.php on line 13
Warning: array_diff(): Expected parameter 1 to be an array, bool given in C:\xampp\htdocs\game\c_images\album1584\badgedef.php on line 13
You are trying to access a directory from a URL?
– Woss
even putting "C: xampp htdocs game c_images album1584" does not solve
– Caio Franciscatto