compuphase / sphider-pdo

A simple search engine and spider in PHP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Didn't execute command line

devopslinux opened this issue · comments

commented

I Can't execute spidering by command line
php spider.php -u http://www.domain.com/test.html -d 2
What can I do?

I believe I'm having the same problem. For me when I run the spider.php script on the command line, the only thing it does is output the admin HTML login form to stdout.

What I did was edit admin/auth.php and add a second elseif() test under the $_SESSION['admin'] checks on line 26:

// admin.php redirect code ends here

} elseif (isset($_SESSION['admin']) && isset($_SESSION['admin_pw']) &&$_SESSION['admin'] == ADMIN && $_SESSION['admin_pw'] == PASSW) {

// my addition
} elseif (isset($_SERVER['argc']) && $_SERVER['argc'] >= 2) {

} else {

// Sphider Admin Login HTML code starts here

I believe my changes are safe, as it should only allow the execution of the code when run from the command line.