GerryWoolf Posted July 1, 2012 Share Posted July 1, 2012 Hi everyone I am trying to get the following url. As you see its a FTL extension and having problems getting PHP to get Page contents. Any Suggestions please as to best method. http://www.national-lottery.co.uk/player/lotto/results/downloadResultsCSV.ftl thanks in advance Gerry Quote Link to comment https://forums.phpfreaks.com/topic/265069-accessing-ftl-extension/ Share on other sites More sharing options...
requinix Posted July 1, 2012 Share Posted July 1, 2012 $variable = file_get_contents("link"); Quote Link to comment https://forums.phpfreaks.com/topic/265069-accessing-ftl-extension/#findComment-1358334 Share on other sites More sharing options...
GerryWoolf Posted July 1, 2012 Author Share Posted July 1, 2012 Thanks but that fails [function.file-get-contents]: failed to open stream: No such file or directory I thihk because its a Ftl extension anyone got any other suggestions - tried curl and that seems not to work either. Quote Link to comment https://forums.phpfreaks.com/topic/265069-accessing-ftl-extension/#findComment-1358339 Share on other sites More sharing options...
boompa Posted July 1, 2012 Share Posted July 1, 2012 It's got nothing to do with the extension. Show the code you're attempting to use. Example code: ?php $fp = fopen("http://www.national-lottery.co.uk/player/lotto/results/downloadResultsCSV.ftl", "r"); if (!$fp) { die("Failed to open URL"); } else { while(($data = fgetcsv($fp)) !== false) print_r($data); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/265069-accessing-ftl-extension/#findComment-1358341 Share on other sites More sharing options...
silkfire Posted July 1, 2012 Share Posted July 1, 2012 Maybe your PHP is set to safe mode which means you need to use cURL to get the contents of the FTL file. And that's good, cURL is actually recommended for this. Google on a tutorial if you don't know how to do. Quote Link to comment https://forums.phpfreaks.com/topic/265069-accessing-ftl-extension/#findComment-1358396 Share on other sites More sharing options...
GerryWoolf Posted July 1, 2012 Author Share Posted July 1, 2012 Thanks for answer. Works fine of course. That was my original code and did not work and simply presumed something to do with extension. Cleare was my silly error in code. Thanks once again Gerry Quote Link to comment https://forums.phpfreaks.com/topic/265069-accessing-ftl-extension/#findComment-1358416 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.