|
01-13-2004, 07:15 PM | #1 |
Green Mole
Join Date: Jan 2004
Posts: 10
|
Setting HTTP_USER_AGENT for spidering..
Hi Charter,
This is related to a problem that was posted in the troubleshooting section recently. We have a website in which certain pages require authentication. This is performed using a function that is included on all protected pages. Our solution to allow the indexing of these pages was to check the HTTP_USER_AGENT from the request headers and allow the page to load using that. The problem is that when phpdig spiders the page, the user agent is always the default value of "PHP/4.2.2", no matter what we set it to be in the function phpdigTestUrl() in robotfunctions.php. Is there a way to programmatically set User-agent to something secure so that the authentication mechanism is still dependable? Thanks. |
01-14-2004, 11:11 AM | #2 |
Head Mole
Join Date: May 2003
Posts: 2,539
|
Hi. What is user_agent set to in your PHP info? Are you crawling via shell or browser interface?
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension. |
01-14-2004, 02:54 PM | #3 |
Green Mole
Join Date: Jan 2004
Posts: 10
|
Hi Charter,
We are currently using the browser interface for crawling, with the intention of using shell later when we set up the indexing as a cron job. In either case the spidering script is accessing the pages and providing a user agent of "PHP/4.2.2" (default before PHP version 4.3.0). The code in robot_functions.php allows the setting of the User-agent header, so why is this overridden? The php.ini has nothing set for user_agent. Is there some other way to set the user_agent to our liking? |
01-15-2004, 07:37 AM | #4 |
Head Mole
Join Date: May 2003
Posts: 2,539
|
Hi. What output do you get when you run the code snippet from php.net below?
PHP Code:
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem with setting the ABSOLUTE_SCRIPT_PATH | wshobe | Script Installation | 2 | 07-18-2005 05:11 PM |
Setting Up connect.php | vinyl-junkie | How-to Forum | 1 | 08-15-2004 04:39 PM |
Setting up phpdig in a subdomain | vinyl-junkie | Troubleshooting | 1 | 05-29-2004 02:27 PM |