Hi Adrian,
The issue is with the use of virtual folders I think...
The PHP script knows that './' is the current directory. Generally, webservers tend to have a linear relationship with published URI directories and the filesystem directories so that:
http://some.website/script.php resides in the document root of the website and files in the same directory are in './'
http://some.website/subdir/thing.gif uses the URI of /subdir/thing.gif and should be found in ./subdir/thing.gif
Using a virtual directory may make this a non-linear structure that PHP is unable to navigate.
You do need to exclude any mention of the absolute filesystem path (like X:/wdisplay/webfiles/ ) as it is completely unusable on the web (Invalid URI addressing). Also eschew the full URL addressing (http://...) as it can't be used natively by PHP (which only understands file paths in the filesystem of the webserver).
I'm afraid you'll need to drop the virtual mapping for use with the templates unless you map the entire wdwebfiles to your document root, or move your template set into the same directory.
You will need to use './' or './directory/' as the addressing, but the ./directory/ has to be just below ./ in the filesystem in order for it to work.
You can get WD to upload the files to the same directory as the template files, and that would work also.. but not the virtual directory mapping, I fear.
Best regards,
Ken