hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : I am NOT a PHP guy...
Reply

Programming Discussion Discussions related to web programming languages and other related issues. Topics may include configuration, optimization, practical usage and database connectivity.
Forum Jump

I am NOT a PHP guy...

Reply Post New Thread In Programming Discussion Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 07-26-2005, 05:17 PM
Mike Bell Mike Bell is offline
WHT Addict
 
Join Date: Aug 2004
Location: Tulsa, Oklahoma
Posts: 168

I am NOT a PHP guy...


$simple = implode('',file($url));

I have a URL. Why oh why would $simple be empty? I'm a .NET guy 100%... and I'm bout to cut my wrists with this. I'm supposed to be scraping a page here and saving it to a localized page.... but nothing happens (and if yo ucan't tell this wasn't my script.. I'm just trying to troubleshoot why it's not working on my site). :-)

Thanks in advance....

Mike

__________________
Mike Bell
Image Hosting


Reply With Quote


Sponsored Links
  #2  
Old 07-26-2005, 05:34 PM
Mike Bell Mike Bell is offline
WHT Addict
 
Join Date: Aug 2004
Location: Tulsa, Oklahoma
Posts: 168
BTW, as a very simple test I tried:

$simple = implode('',file('http://www.myonlineimages.com/test.php'));
echo $simple;

Nothing!&#%#*^*#

__________________
Mike Bell
Image Hosting


Reply With Quote
  #3  
Old 07-26-2005, 06:33 PM
zoldar zoldar is offline
Junior Guru Wannabe
 
Join Date: Jul 2005
Posts: 79
It doesn't work, because the server's php configuration you are working on doesn't allow it.

Php's default setting (php.ini):
allow_url_fopen = Off

It should be On to make this work.

Reply With Quote
Sponsored Links
  #4  
Old 07-26-2005, 07:10 PM
arkin arkin is offline
Web Hosting Guru
 
Join Date: Feb 2003
Location: L.A. C.A.
Posts: 334
Hey, another easier method would be.

$simple=file_get_contents("http://www.myonlineimages.com/test.php");
echo $simple;

Reply With Quote
  #5  
Old 07-26-2005, 07:18 PM
zoldar zoldar is offline
Junior Guru Wannabe
 
Join Date: Jul 2005
Posts: 79
In php.ini:

Code:
; Whether to allow the treatment of URLs (like http:// or ftp://) as files.
allow_url_fopen = Off
None of the file related functions will work unless it's set to off - no matter if it's file, file_get_contents, fopen etc.

Reply With Quote
  #6  
Old 07-27-2005, 03:27 AM
Burhan Burhan is offline
Community Guide
 
Join Date: Jul 2003
Location: Kuwait
Posts: 5,100
If that doesn't work for you, you can always use Snoopy.

__________________
In order to understand recursion, one must first understand recursion.
If you feel like it, you can read my blog
Signal > Noise

Reply With Quote
  #7  
Old 07-27-2005, 08:12 AM
Mike Bell Mike Bell is offline
WHT Addict
 
Join Date: Aug 2004
Location: Tulsa, Oklahoma
Posts: 168
Thnx guys. Switching hosts now... lol after 4 hours of fighting with it NOW I learn about the php.ini option being off... LOL

__________________
Mike Bell
Image Hosting


Reply With Quote
  #8  
Old 07-27-2005, 11:04 PM
KyleDesjardins KyleDesjardins is offline
Temporarily Suspended
 
Join Date: Jul 2005
Posts: 9
I would look for a way around using allow_url_fopen because it can present a security problem. But if you aren't worried about that go ahead.

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?