loading a file in php /wordpress
-
Loading a flat file usually works on my dev WordPress and doesn’t work right now on my live build – not good !
Here is my code. Can anyone suggest a bullet-proof version, please?
Permissions have been set to 755 so its not that.if (is_admin()) $fl = "../wp-content/plugins/carers/data/m.csv" ; else $fl = "wp-content/plugins/carers/data/m.csv" ; $handle = fopen($fl,"r"); $fileContents = fread($handle, filesize($fl)); fclose($handle);
Tried get_site_url() to build a url for the file … and a wp function that did a fopen and if that didn’t work a curl …
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘loading a file in php /wordpress’ is closed to new replies.