Knowledgebase

php page with login | wget or links | need help

Posted by jon-f, 07-21-2008, 08:31 PM
I got a client who has a script that is sort of a site generator. The script generates content for the static pages. We are working on doing this on cron. Otherwise you have to go in with browser and do the page that way. The page for executing via browser is build_all.php there is another which seems to be the cron page which is build_all_cron.php When you go to the one in the browser you have to auth through htaccess and the admin login for the script. For the cron page it seems you have to login as well but when executed it says "Login as Admin" Would anyone know or have any ideas to execute the script via cron php or browser. It would have to auth through htaccess and then through the script. I suppose we can always take out the htaccess pass protection and use ip restrictions instead but it needs to login either way in the script. We have tried a few different wget and links methods to no avail. Would appreciate some help or if someone would know the proper syntax of doing this. Would be best to do the cron.php file just need to know how to login through that. Thanks

Posted by webcertain, 07-22-2008, 03:53 AM
php blah.php through an console will call it directly, and should skip .htaccess authentication. (hint, you can run php outside the web browser)

Posted by jon-f, 07-22-2008, 04:40 PM
Yeah I know that, you didnt read. Php through console will of course skip htaccess auth but there is still the script auth. Is the issue we are having

Posted by insanelymacintosh, 07-22-2008, 05:55 PM
You can use a cron with the following statement being ran in the cron... lynx http://localsite.com/cronfile.php or like webcertain said, you can run it via "php ./confile.php" Is this what you are asking? What syntax to put into the cron to make it run?

Posted by foobic, 07-22-2008, 07:39 PM
If your problem is to get past the authentication in the script then you should check how the script is doing the authentication. GET or POST? Can you supply the username and password along with a command? etc. Worst case you may need to do it in 2 stages: Login with valid username and password and save cookie.Load cookie and do the admin task. Look for --post-data, --post-file, --load-cookies, --save-cookies and --keep-session-cookies in the wget manpage.

Posted by 01globalnet, 07-22-2008, 08:16 PM
This should work



Was this answer helpful?

Add to Favourites Add to Favourites

Print this Article Print this Article

Also Read


Language:

Client Login

Email

Password

Remember Me

Search