MySQL_Narb Posted September 13, 2012 Share Posted September 13, 2012 I have a function within my class that will throw a custom error; however, I'm not sure how I can get the appropriate path to load that CSS file that styles the error message. For example: /css/error.css is the location. But what if I'm on /new/index.php? Or /new/account/account.php? How do I get my script to load the appropriate path to the file? I was assuming using the magic constant __FILE__ and dirname, but it seems like there's an easier way. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/268315-finding-correct-path-for-a-css-file/ Share on other sites More sharing options...
trq Posted September 13, 2012 Share Posted September 13, 2012 /css/error.css is an absolute path that will be valid from anywhere. Quote Link to comment https://forums.phpfreaks.com/topic/268315-finding-correct-path-for-a-css-file/#findComment-1377483 Share on other sites More sharing options...
MySQL_Narb Posted September 13, 2012 Author Share Posted September 13, 2012 /css/error.css is an absolute path that will be valid from anywhere. Thank you kind sir! Quote Link to comment https://forums.phpfreaks.com/topic/268315-finding-correct-path-for-a-css-file/#findComment-1377484 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.