[Plugin: PHP Code Widget] Generated [pdf] short code not working ..
-
Hi All,
My website is http://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=”http://floodreliefpakistan.com/pdfdocs/CosmicTechSol.pdf”%5DCosmicTechSol [/pdf]
[pdf href=”http://floodreliefpakistan.com/pdfdocs/Cosmic-Tech-Sol.pdf”%5DCosmic Tech Sol [/pdf]When I place this generated code in the
Text Widgetit 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="http://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
http://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.