[Plugin: PHP Code Widget] Generated [pdf] short code not working ..
-
Hi All,
My website is https://floodreliefpakistan.com/, am using thePHP Code Widget
– code given below – to generate the following HTML at run time using ul, il tags to format the output.[pdf href=”https://floodreliefpakistan.com/pdfdocs/CosmicTechSol.pdf”%5DCosmicTechSol [/pdf]
[pdf href=”https://floodreliefpakistan.com/pdfdocs/Cosmic-Tech-Sol.pdf”%5DCosmic Tech Sol [/pdf]When I place this generated code in the
Text Widget
it executes perfectly but am unable to get the desired results from thisPHP code Widget
. The PHP Code which is being executed from within this Widget is<?php $chArr[] = '-'; $chArr[] = '.pdf'; if ($handle = opendir('pdfdocs')) { echo '<ul>'; while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { ?> <li>[pdf href="https://floodreliefpakistan.com/pdfdocs/<?php echo $file; ?>"]<?php echo str_replace($chArr, ' ', $file); ?>[/pdf]</li> <?php } } echo '</ul>'; closedir($handle); } ?>
and the output it generates can be observed by visiting the following the URL
https://floodreliefpakistan.com/test.php
.Any help to resolve this issue is highly appreciated.
TIA
- The topic ‘[Plugin: PHP Code Widget] Generated [pdf] short code not working ..’ is closed to new replies.