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
nadavvin
Forum Commoner
Posts: 68 Joined: Wed Sep 06, 2006 6:05 am
Post
by nadavvin » Mon Sep 18, 2006 11:42 am
Hello
I want to get html content from other URL to variable.
I know that with XML I can use in domxml but It's not xml and I want to get it as string.
How do I do this?
Luke
The Ninja Space Mod
Posts: 6424 Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA
Post
by Luke » Mon Sep 18, 2006 11:52 am
fopen() or maybe file_get_contents() (php5)
akimm
Forum Contributor
Posts: 460 Joined: Thu Apr 27, 2006 10:50 am
Location: Ypsilanti Michigan, formally Clipsburgh
Post
by akimm » Mon Sep 18, 2006 1:42 pm
Why exactly do you ask, I am confused as to what you exactly want to do.
Luke
The Ninja Space Mod
Posts: 6424 Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA
Post
by Luke » Mon Sep 18, 2006 1:46 pm
he wants to get the content from another url into a variable...
Code: Select all
// Loads contents of site into a variable
$contents_of_devnet = file_get_contents('http://www.forums.devnetwork.net');
akimm
Forum Contributor
Posts: 460 Joined: Thu Apr 27, 2006 10:50 am
Location: Ypsilanti Michigan, formally Clipsburgh
Post
by akimm » Mon Sep 18, 2006 1:56 pm
Thats neat lol. Altho it scares me if it works, because of how easily content can be stolen
nadavvin
Forum Commoner
Posts: 68 Joined: Wed Sep 06, 2006 6:05 am
Post
by nadavvin » Mon Sep 18, 2006 1:56 pm
yes, It's what I want.
There is a forum which I like but there isn't any RSS with it.
I want to get the forum page and make it RSS.
Thanks for your help.
nadav
Last edited by
nadavvin on Mon Sep 18, 2006 1:58 pm, edited 1 time in total.
Luke
The Ninja Space Mod
Posts: 6424 Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA
Post
by Luke » Mon Sep 18, 2006 1:57 pm
It's no different than clicking "view source" except it is being done by php instead of your mouse... nothing really to worry about.
John Cartwright
Site Admin
Posts: 11470 Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:
Post
by John Cartwright » Mon Sep 18, 2006 2:15 pm
The Ninja Space Goat wrote: file_get_contents() (php5)
fyi, file_get_contents() is php4, file_put_contents() is php5
Luke
The Ninja Space Mod
Posts: 6424 Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA
Post
by Luke » Mon Sep 18, 2006 2:16 pm
oh wow... didn't know that.. thanks jcart!
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Mon Sep 18, 2006 3:01 pm
nadavvin wrote: yes, It's what I want.
There is a forum which I like but there isn't any RSS with it.
I want to get the forum page and make it RSS.
Thanks for your help.
nadav
Have you asked them about adding an RSS feed from it?
nadavvin
Forum Commoner
Posts: 68 Joined: Wed Sep 06, 2006 6:05 am
Post
by nadavvin » Mon Sep 18, 2006 3:11 pm
I think that I send them request to add RSS and they didn't return any answer.