The server hosting the script to display buttons is behaving a bit strangely, so I’ve had to update the Widget script to default to javascript if the standard readfile
command returns a null result.
3 thoughts on “Updated Widget”
Leave a Reply
You must be logged in to post a comment.
Martin, I might be wrong but I think that new code is lacking an “else” statement. From the look of it, it returns the JavaScript if the result is empty but doesn’t display the readfile code if it isn’t as there’s no “echo $result;”.
My intention was that the
readfile
command should display the code as soon as it was called, although admittedly, I’ve not used it with an=
sign before it before so it may no longer work.Only if
readfile
failed or returned a zero result for some other reason would the javascript be displayed.But I’ll go and play with it and see if it works properly.
Ah, I see – the contents of the readfile command display even though it’s set equal to a variable. I’ve done a quick test and that certainly seems to be the case. You learn some useful new PHP every day 🙂