Assign some content of a page to a variable

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
byenary
Forum Newbie
Posts: 10
Joined: Mon Apr 03, 2006 6:15 am

Assign some content of a page to a variable

Post by byenary »

What i want to do...
I want to store the content of webpage into a variable (to store in database)
For example, I want to store the result of this page (which gives some text) in variable
http://api.hostip.info/get_html.php?ip= ... ition=true

Sombody knows a way to this ?

Thx
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

file_get_contents can do that.
see http://de2.php.net/ref.filesystem
byenary
Forum Newbie
Posts: 10
Joined: Mon Apr 03, 2006 6:15 am

what when fopen disabled

Post by byenary »

And what when fopen and file_get_contens is disabled for security reasons, probably have to go call a c program to do the job ?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Post Reply