I have this path and it is correct however, the browser will not include the source file unless I put "file:///" in front of it. I'm still developing and this will ultimately be on a Linux machine but in the mean time, I'd like to see my work as well as be able to troubleshoot it. Is there a solution for this?
This fails:
C:\Program Files (x86)\work\site\js\rowlock.js
This does not fail:
file:///C:\Program Files (x86)\work\site\js\rowlock.js
just use front slashes everywhere if you'll be moving this to a linux box anyway. php for windows can understand it.
$file='c:/Program Files (x86)/work/site/js/rowlock.js';
Try using variable $_SERVER['DOCUMENT_ROOT'] to make your script independent. For example:
include($_SERVER['DOCUMENT_ROOT'].'/js/rowlock.js');
Works fine on any system
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With