Support » Plugins and Hacks » Cannot load images with php script using exec-php…

  • I have some code that I know works – as I have tested it with MAMP to make sure…

    <?php
    $dir = "./flash/portfolio/branding/images/";
    $jpgs = glob($dir . "*.jpg");
    
    foreach ($jpgs as $jpg) {
        echo "<img src='{$jpg}' /><br />";
    }
    ?>

    but when I use this in one of my pages in wordpress all it shows is 5 broken image links… it’s odd it has the correct number of files… but it is as if wordpress (or exec-php) will not render the jpgs..

    any ideas here?

Viewing 1 replies (of 1 total)
  • I figured it out for anyone that need to know how to do this if they are accessing a directory in the root of their server:

    <?php
    $dir = "./flash/portfolio/branding/images/";
    $jpgs = glob($dir . "*.jpg");
    
    foreach ($jpgs as $jpg) {
        $jpg = substr($jpg, 1);
        echo "<img src='http://www.mydomain.com{$jpg}' /><br />";
    }
    ?>

Viewing 1 replies (of 1 total)
  • The topic ‘Cannot load images with php script using exec-php…’ is closed to new replies.