This is a discussion on Need help with Snoopy class function within the PHP Language forums, part of the PHP Programming Forums category; Dear all, I am brand new to php, but learning quickly. I need to be able to go to website, ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Dear all,
I am brand new to php, but learning quickly. I need to be able to go to website, obtain the form elements, cycle through the form elements, fetch the links for each page that results from the submission of the form elements, and then fetch all the content of the pages refered in the links (its approx 115,000 links). If i understand it right, Snoopy is the way to go with this. But the problem is, is that we cannot get snoopy to work (expect for the submit function). I have gone through all the text files that come with snoopy, and even when we just cut and paste the example code from the text files, it does not work. for example, when we pasted the fetchtext function example code we got the following error: ............. Notice: Undefined variable: postdata in c:\inetpub\wwwroot\gasearch\dev\test files\Snoopy.class.inc on line 1153 Warning: fsockopen(): php_network_getaddresses: gethostbyname failed in c:\inetpub\wwwroot\gasearch\dev\test files\Snoopy.class.inc on line 1092 Warning: fsockopen(): unable to connect to lnk.ispi.net:80 in c:\inetpub\wwwroot\gasearch\dev\test files\Snoopy.class.inc on line 1092 Notice: Uninitialized string offset: 0 in c:\inetpub\wwwroot\gasearch\dev\test files\snoopyfetch.php on line 23 Notice: Uninitialized string offset: 1 in c:\inetpub\wwwroot\gasearch\dev\test files\snoopyfetch.php on line 24 Notice: Uninitialized string offset: 2 in c:\inetpub\wwwroot\gasearch\dev\test files\snoopyfetch.php on line 25 ............. we made absolutely no changes to the code, just a simple cut and paste. Given the way that snoopy is discussed on various groups, we get the feeling that this is a really easy class function to use, which leads us to believe that we are missing some very simple step. please if anybody can help us out we would be greatful, or better yet, if anybody has done a task simular to ours at hand, if you could just post some code as to how you did it....thank you for your time. toby |
|
|||
|
toby2tongues@hotmail.com (toby casey) wrote in message news:<ba949ce6.0407171636.39932c86@posting.google. com>...
> Dear all, > > I am brand new to php, but learning quickly. I need to be able to go > to website, obtain the form elements, cycle through the form elements, > fetch the links for each page that results from the submission of the > form elements, and then fetch all the content of the pages refered in > the links (its approx 115,000 links). If i understand it right, > Snoopy is the way to go with this. But the problem is, is that we > cannot get snoopy to work (expect for the submit function). I have > gone through all the text files that come with snoopy, and even when > we just cut and paste the example code from the text files, it does > not work. for example, when we pasted the fetchtext function example > code we got the following error: > ............ > > Notice: Undefined variable: postdata in > c:\inetpub\wwwroot\gasearch\dev\test files\Snoopy.class.inc on line > 1153 > > Warning: fsockopen(): php_network_getaddresses: gethostbyname failed > in c:\inetpub\wwwroot\gasearch\dev\test files\Snoopy.class.inc on line > 1092 > > Warning: fsockopen(): unable to connect to lnk.ispi.net:80 in > c:\inetpub\wwwroot\gasearch\dev\test files\Snoopy.class.inc on line > 1092 > > > Notice: Uninitialized string offset: 0 in > c:\inetpub\wwwroot\gasearch\dev\test files\snoopyfetch.php on line 23 > > Notice: Uninitialized string offset: 1 in > c:\inetpub\wwwroot\gasearch\dev\test files\snoopyfetch.php on line 24 > > Notice: Uninitialized string offset: 2 in > c:\inetpub\wwwroot\gasearch\dev\test files\snoopyfetch.php on line 25 > > ............ > we made absolutely no changes to the code, just a simple cut and > paste. Given the way that snoopy is discussed on various groups, we > get the feeling that this is a really easy class function to use, > which leads us to believe that we are missing some very simple step. > please if anybody can help us out we would be greatful, or better yet, > if anybody has done a task simular to ours at hand, if you could just > post some code as to how you did it....thank you for your time. We are running php 4.3.7, windows xp, and the Windows IIS > > toby |
|
|||
|
toby2tongues@hotmail.com (toby casey) wrote in message news:<ba949ce6.0407172201.f6cc2d4@posting.google.c om>...
> toby2tongues@hotmail.com (toby casey) wrote in message news:<ba949ce6.0407171636.39932c86@posting.google. com>... > > Dear all, > > > > I am brand new to php, but learning quickly. I need to be able to go > > to website, obtain the form elements, cycle through the form elements, > > fetch the links for each page that results from the submission of the > > form elements, and then fetch all the content of the pages refered in > > the links (its approx 115,000 links). If i understand it right, > > Snoopy is the way to go with this. But the problem is, is that we > > cannot get snoopy to work (expect for the submit function). I have > > gone through all the text files that come with snoopy, and even when > > we just cut and paste the example code from the text files, it does > > not work. for example, when we pasted the fetchtext function example > > code we got the following error: > > ............ > > > > Notice: Undefined variable: postdata in > > c:\inetpub\wwwroot\gasearch\dev\test files\Snoopy.class.inc on line > > 1153 > > > > Warning: fsockopen(): php_network_getaddresses: gethostbyname failed > > in c:\inetpub\wwwroot\gasearch\dev\test files\Snoopy.class.inc on line > > 1092 > > > > Warning: fsockopen(): unable to connect to lnk.ispi.net:80 in > > c:\inetpub\wwwroot\gasearch\dev\test files\Snoopy.class.inc on line > > 1092 > > > > > > Notice: Uninitialized string offset: 0 in > > c:\inetpub\wwwroot\gasearch\dev\test files\snoopyfetch.php on line 23 > > > > Notice: Uninitialized string offset: 1 in > > c:\inetpub\wwwroot\gasearch\dev\test files\snoopyfetch.php on line 24 > > > > Notice: Uninitialized string offset: 2 in > > c:\inetpub\wwwroot\gasearch\dev\test files\snoopyfetch.php on line 25 > > > > ............ > > we made absolutely no changes to the code, just a simple cut and > > paste. Given the way that snoopy is discussed on various groups, we > > get the feeling that this is a really easy class function to use, > > which leads us to believe that we are missing some very simple step. > > please if anybody can help us out we would be greatful, or better yet, > > if anybody has done a task simular to ours at hand, if you could just > > post some code as to how you did it....thank you for your time. > > We are running php 4.3.7, windows xp, and the Windows IIS > > > > toby Does Snoopy have some kind of configuration file that needs to be set? It almost seems like the variables are not coming through, which makes me wonder if Snoopy assumes that the posted variables are automatically becoming global variables. If so, check to see if register_globals is set in the php.ini file. |
|
|||
|
i have been reading everything that i can get my hands on, and have
fixed alot of problems, but i am still getting this error msg: PHP Notice: Undefined index: query in c:\inetpub\wwwroot\gasearch\dev\test files\snoopy stuff\Snoopy.class.inc on line 147 along with a few others. but primarily this one and the same error for line 132 (same file) Any time snoopy.class.inc uses the "scheme" it gives an undefined index error....i am really going crazy....I am assuming that this must be a problem on my computer, because after reading all the group postings that i can find that discuss snoopy, lots of ppl use it. are there any changes that "must" be made in the varible settings and/or php.ini....if somebody can, please help. toby |
|
|||
|
toby2tongues@hotmail.com (toby casey) wrote in message news:<ba949ce6.0407222355.2ce3a80a@posting.google. com>...
> i have been reading everything that i can get my hands on, and have > fixed alot of problems, but i am still getting this error msg: > > PHP Notice: Undefined index: query in > c:\inetpub\wwwroot\gasearch\dev\test files\snoopy > stuff\Snoopy.class.inc on line 147 > > along with a few others. but primarily this one and the same error > for line 132 (same file) Any time snoopy.class.inc uses the "scheme" > it gives an undefined index error....i am really going crazy....I am > assuming that this must be a problem on my computer, because after > reading all the group postings that i can find that discuss snoopy, > lots of ppl use it. are there any changes that "must" be made in the > varible settings and/or php.ini....if somebody can, please help. An undefined index error normally means you're doing something like this: $howManyUsers = $userInfo["userCount"]; when no value has ever been placed into the "userCount" index of the array $userInfo. See anything like that? |
|
|||
|
>
> An undefined index error normally means you're doing something like > this: > > $howManyUsers = $userInfo["userCount"]; > > when no value has ever been placed into the "userCount" index of the > array $userInfo. > > See anything like that? that is exactly what is see, but it is in the code of the class function, and everybody else in the world seems to be using snoopy successfully....i am thinking that maybe there is a setting in my php.ini file that i have incorrectly set...if anybody out there is willing, i would love to take a look at somebody php.ini file that has ran snoopy successfully. i know its asking alot, and is probably not the most security minded thing to do, but i have nobody that i can go to for immediate help, and would just like to know for certain that my ini is setup right. toby toby2tongues@hotmail.com |
|
|||
|
toby2tongues@hotmail.com (toby casey) wrote in message news:<ba949ce6.0408021653.4d86a71e@posting.google. com>...
> > > > An undefined index error normally means you're doing something like > > this: > > > > $howManyUsers = $userInfo["userCount"]; > > > > when no value has ever been placed into the "userCount" index of the > > array $userInfo. > > > > See anything like that? > > > that is exactly what is see, but it is in the code of the class > function, and everybody else in the world seems to be using snoopy > successfully....i am thinking that maybe there is a setting in my > php.ini file that i have incorrectly set...if anybody out there is > willing, i would love to take a look at somebody php.ini file that has > ran snoopy successfully. i know its asking alot, and is probably not > the most security minded thing to do, but i have nobody that i can go > to for immediate help, and would just like to know for certain that my > ini is setup right. > toby > toby2tongues@hotmail.com My guess is that most PHP coders don't code with error_reporting set to all. They should, but they don't. I don't code with error_reporting on max either, instead I set it there when I'm debugging. Change your error reporting level to make the error messages disappear. Or, better, edit Snoopy so that the line that generates the error is wrapped in an if (isset($dog["color"])) block. |