kristinaishere Posted August 10, 2009 Share Posted August 10, 2009 Hi, I have a message board where each forum is password protected so certain associations can only access their specified information. Currently to access the page of the message board where they enter their password they have to look through a long list on the main part of the website- find their association name which is a hyperlink -and that takes them to the password page on the message board. I want to use a Google Custom Search engine to allow them to simply search for their association name instead of showing them the long list. The Custom Search would bring up the specified hyperlink name of their association. However, I assume due to password protection over the pages, I am unable to get the custom search to work. I read up and found that I might use a User Agent code like this: $allow_inside = ($is_logged_in) || substr_count($_SERVER['HTTP_USER_AGENT'],'Googlebot'); Not sure where I would even put this though, or if it would work... Hoping someone has a suggestion or solution to help! Thanks in advance. Quote Link to comment Share on other sites More sharing options...
phporcaffeine Posted August 10, 2009 Share Posted August 10, 2009 It appears that you would want to place that in a file that is included by the rest of your application. You would want it after the session_start(). Maybe the message board has some sort of a bool return auth function that you can put that snippet into and then return true if Apache populates HTTP_USER_AGENT with 'Googlebot'. To test, you can force $_SERVER['HTTP_USER_AGENT'] to equal whatever you want (like Googlebot) ... just be careful that Apache doesn't override it when you think it isn't. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.