XYZ Code Snippet causes 500 internal server error when using readdir
-
The following ZYZ PHP snippet:
$global $SOUNDBITEDIRECTORY_;
$dh = opendir($SOUNDBITEDIRECTORY_);while (false !== ($entry = readdir($dh))) {
echo “$entry\n”;
}… causes a “500 Internal Server Error” when trying to save the Page on Word Press. Removing the while loop, and the WP page saves okay.
If I save the WP page without the while loop (it saves okay – so the shortcode has been saved). If I then put the while loop back into the snippet, the WP page will not save but, as the snippet short code is there, the page will function as expected and all the files in the directory will display.
I have also tried scandir with similar results. Other pages that I have developed (which do not use scandir or readdir) function as expected.
I even tried deleting and reinstalling the plugin.
Does anybody know if I am doing something wrong or whether scandir/readdir are part of the problem?
The topic ‘XYZ Code Snippet causes 500 internal server error when using readdir’ is closed to new replies.