Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old March 5th, 2009, 05:30 AM
Authorized User
Points: 169, Level: 3
Points: 169, Level: 3 Points: 169, Level: 3 Points: 169, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2008
Location: Northampton, , United Kingdom.
Posts: 35
Thanks: 1
Thanked 0 Times in 0 Posts
Default Reading from another website?

On my website, I want to include selected content from another website. The other website is well structured, so I can pinpoint accurately, the selection(s) of HTML code that I will want to use.

Is this possible with PHP?

Some basic example would be greatly appreciated. Doesn't need to be massively in depth, beyond capturing the URL content, as I can sort the string manipulation from there.
__________________
Regards,

Sean
Reply With Quote
  #2 (permalink)  
Old March 5th, 2009, 11:05 PM
Authorized User
 
Join Date: Feb 2009
Posts: 16
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hello,

Fist of all ..
It is not ethical...

But it is possible to get the whole content of other site

PHP Code:
$url         'http://p2p.wrox.com/beginning-php/73096-reading-another-website.html';

$handle = @fopen($url"r");
if (
$handle) {
    
$buffer "";
    while (!
feof($handle)) {
        
$buffer.= fgets($handle4096);
    
    }
    
fclose($handle);
}
echo 
$buffer
try this code

Regards
Anees
Reply With Quote
  #3 (permalink)  
Old March 6th, 2009, 02:27 AM
Authorized User
Points: 169, Level: 3
Points: 169, Level: 3 Points: 169, Level: 3 Points: 169, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2008
Location: Northampton, , United Kingdom.
Posts: 35
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Thank you Anees, will give that a go.

Whether or not it's ethical, I would say depends on what you use, how you use it and what credit you give to the originator. For my purpose, I am using quite precise pieces of data which will be clearly marked with where it comes from and could (if my site works as well as I hope) generate traffic and business for the originator, so can't see anyone grumbling with that.
__________________
Regards,

Sean
Reply With Quote
Reply


Thread Tools
Display Modes

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
all about website benny HTML Code Clinic 2 February 11th, 2008 03:49 AM
Dynamic website to Static website Aboal3ood ASP.NET 1.x and 2.0 Application Design 4 December 7th, 2006 10:46 AM
WebSite Programming xiaoxinge2008 ADO.NET 3 November 16th, 2004 02:59 AM
Reading html file from website vijaya_murali Java GUI 1 July 26th, 2004 09:33 AM
Multilingual website happygv Classic ASP Basics 5 April 12th, 2004 03:44 AM



All times are GMT -4. The time now is 09:23 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
2013 John Wiley & Sons, Inc.