Вопрос

SO, I have some php that I'm inserting into a widget that generates a list of pdfs within a directory on the root level of my wordpress install (see "Meeting Summaries" to the right here: http://mt-spacehosting.com/fisheries/plans/northeast-multispecies/ ). The list is populating as it should, but when one of the options is clicked, the url adds the current page structure of the current url.

To see the code below working correctly, you can visit: http://mt-spacehosting.com/fisheries/past-events.php a simple php page I uploaded to the root directory of the install.

Here's my code:

    <select name="s1" onchange="MM_jumpMenu('pdfwin',this,0)">
          <option value="Select Date" selected="selected">Select Date</option>

    <?php 
    $sub = ($_GET['dir']); 
    $path = 'groundfish-meetings/';
    $path = $path . "$sub"; 
    $dh = opendir($path); 
    $i=1; 

    while (($file = readdir($dh)) !==   false) { 
        if($file != "." && $file != "..") { 
            if (substr($file, -4, -3) =="."){
             echo "$i. <option value='$path/$file'>$file</option>";
             } $i++; 
            } 
         } closedir($dh); 
    ?>
    </select>

I tried $path = "'.bloginfo('url').'/groundfish-meetings"; to set a base url, but it broke the list and none of the files showed.

Any help / thoughts would be appreciated!

Thanks, Matt

Нет правильного решения

Лицензировано под: CC-BY-SA с атрибуция
Не связан с wordpress.stackexchange
scroll top