Welcome to WebmasterWorld Guest from 54.146.230.254

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Problem with file get contents

     
9:56 pm on Jul 14, 2007 (gmt 0)

New User

10+ Year Member

joined:June 1, 2004
posts:33
votes: 0


Hi guys,

I'm experiencing a strange problem working with the file_get_contents function :

If I enter directly the URL, it's working fine :

$data = file_get_contents("http://www.domain.com/image.ashx?1234");

But, if I put the URL into a variable, it's not working anymore :

$url = "http://www.domain.com/image.ashx?1234";
$data = file_get_contents($url);

Any ideas?
Thanks in advance for your help.

4:52 am on July 15, 2007 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Nov 15, 2004
posts:1867
votes: 0


It works just the way it is.

Do you get an error?

4:07 am on July 18, 2007 (gmt 0)

New User

5+ Year Member

joined:July 18, 2007
posts:24
votes: 0


Hello,

Have you tried:

$data = file_get_contents(urlencode($url));

Perhaps the "?" is causing the problem.

Hope this helps,

SK

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members