homepage Welcome to WebmasterWorld Guest from 54.196.196.62
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Problem with file get contents
Cirilo007




msg:3394801
 9:56 pm on Jul 14, 2007 (gmt 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.

 

Habtom




msg:3394926
 4:52 am on Jul 15, 2007 (gmt 0)

It works just the way it is.

Do you get an error?

StudioKraft




msg:3397724
 4:07 am on Jul 18, 2007 (gmt 0)

Hello,

Have you tried:

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

Perhaps the "?" is causing the problem.

Hope this helps,

SK

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved