You are here: Re: Creating an auto-login page « All PHP « IT news, forums, messages
Re: Creating an auto-login page

Posted by laredotornado@zipmail.com on 08/01/07 20:39

On Jul 31, 6:03 pm, NC <n...@iname.com> wrote:
> On Jul 31, 1:55 pm, "laredotorn...@zipmail.com"
>
> <laredotorn...@zipmail.com> wrote:
>
> > I just downloaded the latest version of WordPress, which
> > I'm running on Fedora Linux (apache 2 web server, php
> > 4.4.4). My question is, how can I programatically auto-
> > login to the admin site? I understand there is a
> > "Remember Me" box, but looking for something to where I
> > click a link from my site's normal content admin and go
> > straight into WordPress, without having to enter the WP
> > admin username and password.
>
> OK, here's what your script could do:
>
> 1. POST the following name-value pairs to
> [WordPress_root]/wp-login.php:
>
> log=[your_login_name]&pwd=[your_password]&submit=Login+
> %C2%BB&redirect_to=wp-admin%2F
>
> 2. Obtain the following cookies from
> [WordPress_root]/wp-login.php:
>
> wordpressuser_[hash]=[your_login_name]; path=[WordPress_root]
> wordpresspass_[hash]=[pwd_hash]; path=[WordPress_root]
>
> where
> [hash] is a sequence of 32 hex digits, and
> [pwd_hash] is another sequence of 32 hex digits, and
>
> 3. Send these cookies to the client and then redirect the client
> to [WordPress_root]/wp-admin/
>
> Also, you might consider the possibility of going about your task
> in reverse: instead of building WordPress into your site's "normal
> content admin", build your "normal content admin" into WordPress
> as one or more plugins.
>
> Cheers,
> NC

Thanks for your well thought out reply. I do have a follow up. When
you say

> 2. Obtain the following cookies from
> [WordPress_root]/wp-login.php:

what do you mean by "obtain". Am I supposed to be parsing this file
using "fread"?

Thanks, - Dave

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация