PHP code help.

Brad

Well-Known Member
Jun 5, 2012
2,320
993
PHP:
if ($handle = opendir('../images/web_promo/'))
                {  
                    while (false !== ($file = readdir($handle)))
                    {
                        if ($file == '.' || $file == '..')
                        {
                            continue;
                        }  
              
                        echo '<option value="' . $file . '"';
              
                        if (isset($_POST['topstory']) && $_POST['topstory'] == $file)
                        {
                            echo ' selected';
                        }
                      
                        echo '>' . $file . '</option>';
                    }
                }

Any idea why this wont show the images in the directory
79ae7ab04c0297222b980b99737a219f.png
 

Data

Posting Freak
May 19, 2013
593
97
Just try the direct link?
PHP:
            <?php 
                if ($handle = opendir('app/tpl/skins/Habbo/images/web_promo')) // Or whatever CMS you use change to the direct URL
                    {   
                    while (false !== ($file = readdir($handle)))
                        {
                            if ($file == '.' || $file == '..')
                            {
                                continue;
                            }       
                            echo '<option value="' . $file . '"';
                            if (isset($_POST['topstory']) && $_POST['topstory'] == $file)
                                {
                                    echo ' selected';
                                }
                                echo '>' . $file . '</option>';
                    }
                }
            ?>
 

Brad

Well-Known Member
Jun 5, 2012
2,320
993
<?php
if ($handle = opendir('app/tpl/skins/Habbo/images/web_promo')) // Or whatever CMS you use change to the direct URL
{
while (
false !== ($file = readdir($handle)))
{
if (
$file == '.' || $file == '..')
{
continue;
}
echo
'<option value="' . $file . '"';
if (isset(
$_POST['topstory']) && $_POST['topstory'] == $file)
{
echo
' selected';
}
echo
'>' . $file . '</option>';
}
}
?>
already tried that and still same, I don't know why this won't work ;p
 

Zodiak

recovering crack addict
Nov 18, 2011
453
417
Code:
if ($handle = opendir('../app/tpl/skins/Habbo/images/web_promo'))

I assume it's trying to get /ase/app/tpl/skins/Habbo/images/web_promo, so just add the ../ infront and try that.
 

Users who are viewing this thread

Top