Skip to main content
July 23, 2006
Question

Give script access to restricted pages

  • July 23, 2006
  • 5 replies
  • 554 views
I need to provide a search function within the Members section of a large, dynamically-generated site. I am trying to use Sphider for this purpose, but the product is not set up for password protected pages.

I took a look at the Sphider code and it seemed like it would be an easy fix. I went into the main authorization file and set the standard DW session variables (MM_Username and MM_UserGroup) to an appropriate username and access level. I also made sure that all the sub-files had "session_start". I know the session variables are correct because I added echo statements in Sphider to test them.

Every time I run the indexing script the password protected pages kick the script out as not logged in.

Any suggestions welcome!

This topic has been closed for replies.

5 replies

Inspiring
August 28, 2006
glwm wrote:
> I need to provide a search function within the Members section of a large,
> dynamically-generated site. I am trying to use Sphider for this purpose, but
> the product is not set up for password protected pages.

You would probably get better help from Sphider support or a Sphider
user group.

> Every time I run the indexing script the password protected pages kick the
> script out as not logged in.

I have never even heard of Sphider and haven't studied your code in
detail, but the following line in the Sphider authorization file is
what's causing your problem:

> if (isset($_POST['user']) && isset($_POST['pass'])) {

The $_POST array is not persistent. It passes values to a script when a
form is submitted, but unless you preserve those values in some way,
such as by creating session variables, they are thrown away. Since
$_POST['user'] and $_POST['pass'] are unset, the Sphider authentication
block is ignored.

--
David Powers
Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
http://foundationphp.com/
August 28, 2006
Hi David,

Thanks for trying to help me out!

quote:

You would probably get better help from Sphider support or a Sphider
user group.


Yup. That's the first place I went but no luck. The developer intoned that this feature was not available and that was the end of that thread...

quote:

I have never even heard of Sphider and haven't studied your code in
detail, but the following line in the Sphider authorization file is
what's causing your problem:

> if (isset($_POST['user']) && isset($_POST['pass'])) {

The $_POST array is not persistent. It passes values to a script when a
form is submitted, but unless you preserve those values in some way,
such as by creating session variables, they are thrown away. Since
$_POST['user'] and $_POST['pass'] are unset, the Sphider authentication
block is ignored.


I can see why it looks like the problem, but it is not. The POST line above refers to the Sphider login. The user id and password that relate to my Members Only pages are session variables (see a few lines down in the code).

Ah well. Back to the drawing board.

Again, thanks for trying to help!


August 27, 2006
I'm still struggling with this one.

Could anyone help a non-programmer understand what it means to "enable that on the server"?

Thanks!
July 24, 2006
Thanks so much for replying!

Unfortunately I haven't the foggiest idea what that means.

Could you give more specifics?
Inspiring
July 24, 2006
You need to enable that on the server.

"glwm" <webforumsuser@macromedia.com> wrote in message
news:ea35a5$ihc$1@forums.macromedia.com...
> Still hoping some of you PHP experts can point me in the right direction!
> : )


July 24, 2006
Still hoping some of you PHP experts can point me in the right direction! : )