You are here: Re: Defecting to PHP « All PHP « IT news, forums, messages
Re: Defecting to PHP

Posted by Norman Peelman on 04/27/06 02:58

"McHenry" <mchenry@mchenry.com> wrote in message
news:444e2b83$0$30729$5a62ac22@per-qv1-newsreader-01.iinet.net.au...
>
> "Gernot Frisch" <Me@Privacy.net> wrote in message
> news:4b6mcuF10cvr7U1@individual.net...
> >
> >> Can PHP not manipulate the objects that Excel exposes ?
> >
> > php = cross-platform. Excel = Microsoft. No easy way to access COM
objects
> > with php.
> >
>
> Thanks Gernot,
>
> What is the php type solution for scraping a web page and extracting data
?
>
> Thanks once again...
>
>

> >> So php can't control Excel objects like VBA can ?
> >>
> >
> > Yes, it can... along with alot of other software suppporting COM
objects.
> > I've done it myself (just goofing around) but am no expert. You would
> > need
> > to do some googling to find the answers you need. But, it would be alot
> > easier using PHP alone as PHP can:
> >
> > 1) read an entire web site (text/html) into a variable
> > a) $webpage = fopen('http://your.url.here','r');
>
> What is the datatype of this variable ?
>
> In my Excel solution when I process each page I need to locate two
specific
> hyperlinks on the page as a starting point for the info I require, this I
> can achieve by looping through the collection of hyperlinks which exludes
> other information. If the $webpage variable is text only then locating my
> starting point may be a problem as the display text of the hyperlink is
not
> unique.
>
> >
> > 2) parse that variable and store it directly into MySQL
> > a) use 'regex' to extract the data
> > b) write/update MySQL
> >
> > 3) without going through Excel or ADO
> >
> >
> > Either way you decide to do it, you've got some investigating to do... a
> > quick fix for you right now may be to simply write a small PHP script to
> > copy the data from your original db to MySQL (after your original
process)
> > until you get things straightened out.
> >
> >
> > Norm
>
> Thanks Norm, I will eventually remove the Excel component totally from the
> process however initially and also as part of a PHP learning exercise I
> would like to replace only the vba code with PHP.
>
> I'm migrating the process from vba & SQL Server to PHP & MySQL and so as
not
> to change too many variables in each step I'll take it one component at a
> time.
>
> The end goal would be a total rewrite of the process, as I'm sure there is
a
> more efficient way to do it, but I'll address this once I'm more familiar
> with the whole environment.
>
>

McHenry,

Check this link... http://www.phpclasses.org/browse/file/274.html , you
will need to sign up to download the classes but it could be what you are
looking for. How about a small example, the variable is the plain text/html
as a browser would receive it... maybe I can help and save you quite a bit
of trouble.

Norm

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация