I just want my question answered... thanks!

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
prue_
Forum Commoner
Posts: 64
Joined: Thu May 07, 2009 10:34 pm

I just want my question answered... thanks!

Post by prue_ »

is it possible to pull some contents of web page into another using php or javascript?? for example I have a http://www.domain.com/report.php that displays a list of report: eg
report1 title
report1 description
report1 link to complete report1

report2 title
report2 description
report2 link to complete report2

I have a left widget and I want to randomly display the above info in this widget.
can I pull the data from /report.php and insert in this widget??

thanks.
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Re: I just want my question answered... thanks!

Post by jayshields »

Yes, you can.
spider.nick
Forum Commoner
Posts: 72
Joined: Wed Jul 15, 2009 12:22 pm
Location: Overland Park, KS

Re: I just want my question answered... thanks!

Post by spider.nick »

jayshields wrote:Yes, you can.
:rofl: :bow: :rofl:

Nick
prue_
Forum Commoner
Posts: 64
Joined: Thu May 07, 2009 10:34 pm

Re: I just want my question answered... thanks!

Post by prue_ »

ok, so my 2nd question now is how?? can you show me some code on how to do this? thanks!
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: I just want my question answered... thanks!

Post by alex.barylski »

No, it usually goes against the web sites ToS, stealing their content.

Use an RSS feed or similar API for ther web site in question and use that it's easy.
prue_
Forum Commoner
Posts: 64
Joined: Thu May 07, 2009 10:34 pm

Re: I just want my question answered... thanks!

Post by prue_ »

but the web page I'm talking about is included in my website as well.. would that be still against the website Tos??
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: I just want my question answered... thanks!

Post by jackpf »

I thought you just wanted your question answered.
prue_
Forum Commoner
Posts: 64
Joined: Thu May 07, 2009 10:34 pm

Re: I just want my question answered... thanks!

Post by prue_ »

yes, but the answer is yes that's why I need to make a follow up question.. :lol:
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: I just want my question answered... thanks!

Post by jackpf »

Well...your subject is incorrect then :P
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Re: I just want my question answered... thanks!

Post by jayshields »

Look at file_get_contents() and cURL.
prue_
Forum Commoner
Posts: 64
Joined: Thu May 07, 2009 10:34 pm

Re: I just want my question answered... thanks!

Post by prue_ »

I have another question...
Can I just call the page (e.g. http://www.otherdomain.com/News.php?ksfkshf), which is an external link and strip of its header and footer, and display only the main content??

would this be possible? thanks
prue_
Forum Commoner
Posts: 64
Joined: Thu May 07, 2009 10:34 pm

Re: I just want my question answered... thanks!

Post by prue_ »

no it's not hacking... the external site I'm referring to is my website as well... I just don't want to grab all the data there since it is just a workaround.
Post Reply