Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
this is probably a baby question, so sorry ahead of time.....
I'm having trouble opening a URL. I wish to use the file_get_contents function, but have used the fopen to simply see if the page/file is accessable. I have tried all the url's below with little success (only three work).
My setting for allow_url_fopen is 'On' under local and master ini.
it's the last one in the list that i really want to use.Code: Select all
//$filename = "http://pulsar/Kingfisher/Greenembrace/development/testfile.php"; // this works ok with fopen on my own server
//$filename = "file:///pulsar/Kingfisher/Greenembrace/development/testfile.php";
//$filename = "/Kingfisher/Greenembrace/development/testfile.php";
//$filename = "X:/Kingfisher/Greenembrace/development/testfile.php";
//$filename = "X:\Kingfisher\Greenembrace\development\\testfile.php";
//$filename = "Kingfisher/Greenembrace/development/testfile.php";
//$filename = "http://www.greenembrace.org/welcome.html";
//$filename = "http://greenembrace.org/welcome.html";
//$filename = "http://www.greenembrace.org/";
//$filename = "http://www.greenembrace.org";
//$filename = "http://greenembrace.org/";
//$filename = "ftp://www.greenembrace.org/welcome.html";
//$filename = "ftp://www.greenembrace.org/";
//$filename = "http://68.178.234.207/"; // this works ok with fopen
//$filename = "http://68.178.234.207";
//$filename = "http://68.178.234.207/welcome.html"; // this works ok with fopen
//$filename = "ftp://68.178.234.207/welcome.html";
//$filename = "http://65.206.60.120/data/current_obs/KLFK.rss";
//$filename = "http://www.nws.noaa.gov/data/current_obs/KLFK.rss";
if (fopen($filename,"r")) {
echo "The file $filename exists";
echo file_get_contents($filename);
} else {
echo "The file $filename does not exist";
}thanks
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]