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

Posted by McHenry on 04/26/06 14:08

"Norman Peelman" <npeelman@cfl.rr.com> wrote in message
news:tSH3g.1181$9o4.747@tornado.tampabay.rr.com...
> "McHenry" <mchenry@mchenry.com> wrote in message
> news:444e15ed$0$30750$5a62ac22@per-qv1-newsreader-01.iinet.net.au...
>>
>> "Gernot Frisch" <Me@Privacy.net> wrote in message
>> news:4b6i7sFuq35gU1@individual.net...
>> >
>> > "McHenry" <mchenry@mchenry.com> schrieb im Newsbeitrag
>> > news:444e06f3$0$30747$5a62ac22@per-qv1-newsreader-01.iinet.net.au...
>> >>
>> >> "Gernot Frisch" <Me@Privacy.net> wrote in message
>> >> news:4b6d08F107p0fU1@individual.net...
>> >>>
>> >>> "McHenry" <mchenry@mchenry.com> schrieb im Newsbeitrag
>> >>> news:444df6ab$0$30732$5a62ac22@per-qv1-newsreader-01.iinet.net.au...
>> >>>>I am familiar with asp and have done quite some coding using VBA etc.
>> >>>>
>> >>>> Presently I have a routine in asp that manipulates MS Excel objects
>> >>>> etc, can I control Excel objects in php too ?
>> >>>
>> >>> Can you tounge-kiss a dog?
>> >>>
>> >>> Sure you can, but why would you?
>> >>>
>> >>
>> >> I have an Excel sheet that queries 2000 web pages daily and stores the
>> >> data in a db...
>> >>
>> >> Can you suggest another way to reliably query these 1300 pages and
>> >> extract the data without using the Excel Web Query function ?
>> >
>> > querying web pages in php is possible and easy. Storing in a database
> is,
>> > too. You can propably almost copy/paste that part. php has very usefull
>> > functions for string parsing, so this part is much easier, however you
>> > have to re-write it.
>> >
>> > You can use Excel+VBA - but your server must support it. But - what is
> the
>> > use of php then?
>>
>> 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.



>
>
>
>
>
>
>> >> p.s. regarding the dog comment... how do you know it can be done ?
>> >
>> > I can't think of any physical problem with that. Yuck!
>> >
>> >
>> >
>> >
>>
>>
>
>

 

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

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