Get info from a site with PHP

This is a discussion on Get info from a site with PHP within the PHP Language forums, part of the PHP Programming Forums category; Hi, I was wondering if this is possible. Maybe someone could push me towards the right direction. Let's say ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-04-2004
Jean
 
Posts: n/a
Default Get info from a site with PHP

Hi,

I was wondering if this is possible. Maybe someone could push me towards
the right direction.
Let's say i'm making site B, that gets a few numbers from site A.
Is this possible? Site A has everything in tables.

Also an extra part: it has to log in.

I'm not asking the coplete solution, just a little push.

TIA.

J.
--
My Project Page.
http://www.npi.be
Reply With Quote
  #2 (permalink)  
Old 09-04-2004
Tim Van Wassenhove
 
Posts: n/a
Default Re: Get info from a site with PHP

In article <Dai_c.236083$ZL.12053557@phobos.telenet-ops.be>, Jean wrote:
> Hi,
>
> I was wondering if this is possible. Maybe someone could push me towards
> the right direction.
> Let's say i'm making site B, that gets a few numbers from site A.
> Is this possible? Site A has everything in tables.
>
> Also an extra part: it has to log in.


http://www.php.net/curl


--
Tim Van Wassenhove <http://home.mysth.be/~timvw>
Reply With Quote
  #3 (permalink)  
Old 09-04-2004
J.O. Aho
 
Posts: n/a
Default Re: Get info from a site with PHP

Jean wrote:
> Hi,
>
> I was wondering if this is possible. Maybe someone could push me towards
> the right direction.
> Let's say i'm making site B, that gets a few numbers from site A.
> Is this possible? Site A has everything in tables.
>
> Also an extra part: it has to log in.
>
> I'm not asking the coplete solution, just a little push.


You can use wget (with help of system()) to fetch the data from the remote
site to your site B.


//Aho
Reply With Quote
  #4 (permalink)  
Old 09-04-2004
Andy Hassall
 
Posts: n/a
Default Re: Get info from a site with PHP

On Sat, 04 Sep 2004 12:03:47 GMT, Jean
<bleh@boeitmijniet.be.blah.com.boe.bah.bleh.zie.je .eindigt.met.punt.invalid>
wrote:

>I was wondering if this is possible. Maybe someone could push me towards
>the right direction.
>Let's say i'm making site B, that gets a few numbers from site A.
>Is this possible? Site A has everything in tables.
>
>Also an extra part: it has to log in.
>
>I'm not asking the coplete solution, just a little push.


Certainly possible, since you can open URLs with PHP, e.g. with fopen.

However, it's probably easier with Perl, as WWW::Mechanize and
HTML::TableExtract are particularly good at this sort of thing.

--
Andy Hassall / <andy@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Reply With Quote
  #5 (permalink)  
Old 09-05-2004
Nikolai Chuvakhin
 
Posts: n/a
Default Re: Get info from a site with PHP

Jean <bleh@boeitmijniet.be.blah.com.boe.bah.bleh.zie.je .eindigt.met.punt.invalid>
wrote in message news:<Dai_c.236083$ZL.12053557@phobos.telenet-ops.be>...
>
> I was wondering if this is possible.


Yes.

> Maybe someone could push me towards the right direction.


Well, here's a little problem:

> Also an extra part: it has to log in.


Since you forgot to mention what authentication mechanism the target
site uses, it is difficult to suggest anything in particular.

Cheers,
NC
Reply With Quote
  #6 (permalink)  
Old 09-05-2004
Manuel Lemos
 
Posts: n/a
Default Re: Get info from a site with PHP

Hello,

On 09/04/2004 09:03 AM, Jean wrote:
> I was wondering if this is possible. Maybe someone could push me towards
> the right direction.
> Let's say i'm making site B, that gets a few numbers from site A.
> Is this possible? Site A has everything in tables.
>
> Also an extra part: it has to log in.
>
> I'm not asking the coplete solution, just a little push.


You may want to try this HTTP client class that you can use to retrieve
pages and also submit forms and collect cookies that are passed to the
next pages which is something that you most likely need to login that site:

http://www.phpclasses.org/httpclient


--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
Reply With Quote
  #7 (permalink)  
Old 09-05-2004
Chung Leong
 
Posts: n/a
Default Re: Get info from a site with PHP

"Jean"
<bleh@boeitmijniet.be.blah.com.boe.bah.bleh.zie.je .eindigt.met.punt.invalid>
wrote in message news:Dai_c.236083$ZL.12053557@phobos.telenet-ops.be...
> Hi,
>
> I was wondering if this is possible. Maybe someone could push me towards
> the right direction.
> Let's say i'm making site B, that gets a few numbers from site A.
> Is this possible? Site A has everything in tables.
>
> Also an extra part: it has to log in.
>
> I'm not asking the coplete solution, just a little push.


http://www.php.net/stream_context_create


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

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:27 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0