Hello, is there a problem with php calling url's in an array if they are not in the same directory? I can call pages just fine in the same directory but I am trying to call actual web site url's. So I put them in an array instead and it still doesn't work? I looked at all the php manuals and their url instructions don't make sense for what I am trying to do. Anyone know if there is a special command that needs to go in the code to make url's elswhere work, instead of your own web pages? Url's like something.com etc. etc. Thank you very much!
I don't fully understand your problem. What exactly you mean by calling them? To include, grab or link to them?
Same here, could you please explain in more details? You can include, grab or link to them, but what do you mean by "call"? Can you give an example?
What does parse url's mean, you could be onto something, but maybe not, not getting any parse errors. Regarding getting, I have an array with web site url's in them. This is used to include each url in the array by day. $date = date('d'); include($content[$date]); but its not working. It reads the array but says it can't open the file.
give us $content array content Also if you are trying to include file from different servers - make sure you have whole path with http:// at beginning. P.s. It's bad idea to make including from other server, security bad idea
PHP on Window prior to 4.3.0 do not support accessing remote files via include() function. Also see the allow_url_fopen configuration option.
If you are including pages from the same server include("/path-to-pages/".$content[$date]); Code (markup): If you are including pages from other server include("http://www.remote-server.com/".$content[$date]); Code (markup):
Hey Harsh, hoping you had it. All it did was put the two addresses together.. Failed opening 'http://www.remote-server.com/http://www.photomatt.net Know what I did wrong? The good news is it grabbed the right url, just didn't open it. I'm thinking I need to use fopen instead of include, to open url's not url's on same server. But when I do, I get no error messages but also no url's. Gosh didn't think calling a url using php would be so hard.
I don't think you should be using include() for calls outside your local server. try file_get_contents for that...
<?php $filename = "http://www.website.com"; fopen($filename, "r") || die ("Could not open file"); ?> Nope get contents didn't work either, this is what I am using to test trying to call a basic url, hope someone knows.
I don't know exactly what do you want to accomplish, but here is my suggested code: $date = date('d'); $text = file_get_contents( "http://www.website.com/" . $content[$date]); // Now do something with $text, display it for example: echo $text; Code (markup):
You did it!!! Can't believe it. Wow, that one took awhile for me. I'll have to see if all I needed was echo on the other part. Thank you so very, very, much--your a php genius Evoleto!