<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Autologin a WordPress user in your PHP script</title>
	<atom:link href="http://cleverwp.com/autologin-wordpress-php-script/feed/" rel="self" type="application/rss+xml" />
	<link>http://cleverwp.com/autologin-wordpress-php-script/#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=autologin-wordpress-php-script</link>
	<description>Clever WordPress SEO, Tutorials, Plugins and more</description>
	<lastBuildDate>Mon, 26 Sep 2011 06:02:52 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Lars</title>
		<link>http://cleverwp.com/autologin-wordpress-php-script/#comment-2028</link>
		<dc:creator>Lars</dc:creator>
		<pubDate>Sat, 23 Jul 2011 07:16:11 +0000</pubDate>
		<guid isPermaLink="false">http://mywordpress.com/?p=414#comment-2028</guid>
		<description>Thanks,
Now I have a start point. I need to extract the logged in user as input to a php for add the filter to a database where the user-id tell that user can edit his own row but only view other members.

Take care / Lars</description>
		<content:encoded><![CDATA[<p>Thanks,<br />
Now I have a start point. I need to extract the logged in user as input to a php for add the filter to a database where the user-id tell that user can edit his own row but only view other members.</p>
<p>Take care / Lars</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bristweb</title>
		<link>http://cleverwp.com/autologin-wordpress-php-script/#comment-1928</link>
		<dc:creator>bristweb</dc:creator>
		<pubDate>Wed, 22 Jun 2011 15:47:56 +0000</pubDate>
		<guid isPermaLink="false">http://mywordpress.com/?p=414#comment-1928</guid>
		<description>thanks for this, it definitely got me in the right direction.  however, wp_login is depracated now.  wp_signon is what should be used:

http://codex.wordpress.org/Function_Reference/wp_signon</description>
		<content:encoded><![CDATA[<p>thanks for this, it definitely got me in the right direction.  however, wp_login is depracated now.  wp_signon is what should be used:</p>
<p>http://codex.WordPress.org/Function_Reference/wp_signon</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ivan Novak</title>
		<link>http://cleverwp.com/autologin-wordpress-php-script/#comment-1712</link>
		<dc:creator>Ivan Novak</dc:creator>
		<pubDate>Wed, 11 May 2011 21:55:45 +0000</pubDate>
		<guid isPermaLink="false">http://mywordpress.com/?p=414#comment-1712</guid>
		<description>Lars, thanks for sharing this work.  I&#039;m using it as part of link that allows users of in-network sites to be automatically logged in from site to site.

Thanks and keep it up :)</description>
		<content:encoded><![CDATA[<p>Lars, thanks for sharing this work.  I&#8217;m using it as part of link that allows users of in-network sites to be automatically logged in from site to site.</p>
<p>Thanks and keep it up <img src='http://cleverwp.com.s3.amazonaws.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Samuel</title>
		<link>http://cleverwp.com/autologin-wordpress-php-script/#comment-1485</link>
		<dc:creator>Samuel</dc:creator>
		<pubDate>Wed, 16 Feb 2011 08:15:14 +0000</pubDate>
		<guid isPermaLink="false">http://mywordpress.com/?p=414#comment-1485</guid>
		<description>I think there are two approaches to doing this, either should work:
1. include a URL variable on the link coming from the domain you want to autologin from, e.g. www.yourdomain.com/?auto=1
OR
2. Which is less reliable since not all browsers will provide it, try getting the URL from whence a visitor is coming, in PHP, use: 
if($_SERVER[&#039;HTTP_REFERER&#039;] == &#039;domain.com&#039; ) {
    ...
}

Then proceed to input the autologin script above</description>
		<content:encoded><![CDATA[<p>I think there are two approaches to doing this, either should work:<br />
1. include a URL variable on the link coming from the domain you want to autologin from, e.g. www.yourdomain.com/?auto=1<br />
OR<br />
2. Which is less reliable since not all browsers will provide it, try getting the URL from whence a visitor is coming, in PHP, use:<br />
if($_SERVER['HTTP_REFERER'] == &#8216;domain.com&#8217; ) {<br />
    &#8230;<br />
}</p>
<p>Then proceed to input the autologin script above</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ola Karlsson</title>
		<link>http://cleverwp.com/autologin-wordpress-php-script/#comment-1340</link>
		<dc:creator>Ola Karlsson</dc:creator>
		<pubDate>Tue, 25 Jan 2011 20:17:52 +0000</pubDate>
		<guid isPermaLink="false">http://mywordpress.com/?p=414#comment-1340</guid>
		<description>Hi,
I want to autologin in everybody that click on links (that lead to my site) on a certain URL. So, If a link to my page is published on http://www.domain.com the person clicking it should be loged in autoamtically with a certain user.

If the same link is somewhere else tha one who clicks it shall not be logged in.

Any suggestions on how to do this? Possible?
many thanks.
/Ola</description>
		<content:encoded><![CDATA[<p>Hi,<br />
I want to autologin in everybody that click on links (that lead to my site) on a certain URL. So, If a link to my page is published on http://www.domain.com the person clicking it should be loged in autoamtically with a certain user.</p>
<p>If the same link is somewhere else tha one who clicks it shall not be logged in.</p>
<p>Any suggestions on how to do this? Possible?<br />
many thanks.<br />
/Ola</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stesvis</title>
		<link>http://cleverwp.com/autologin-wordpress-php-script/#comment-1222</link>
		<dc:creator>stesvis</dc:creator>
		<pubDate>Mon, 10 Jan 2011 05:34:19 +0000</pubDate>
		<guid isPermaLink="false">http://mywordpress.com/?p=414#comment-1222</guid>
		<description>Hi!
I hoped this would solve my problem, and it partially did, but when i execute this piece of code i get the following errors:
-----------------------------------------------
Warning: Cannot modify header information - headers already sent by (output started at /home/..../wp-content/themes/idream/header.php:7) in /home/..../wp-includes/pluggable.php on line 690

Warning: Cannot modify header information - headers already sent by (output started at /home/..../wp-content/themes/idream/header.php:7) in /home/..../wp-includes/pluggable.php on line 691

Warning: Cannot modify header information - headers already sent by (output started at /home/..../wp-content/themes/idream/header.php:7) in /home/..../wp-includes/pluggable.php on line 692
-----------------------------------------------

does it depend on the theme? i tried 3 or 4 themes and it happened with all of them..

am i doing something wrong? thanks!</description>
		<content:encoded><![CDATA[<p>Hi!<br />
I hoped this would solve my problem, and it partially did, but when i execute this piece of code i get the following errors:<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
Warning: Cannot modify header information &#8211; headers already sent by (output started at /home/&#8230;./wp-content/themes/idream/header.php:7) in /home/&#8230;./wp-includes/pluggable.php on line 690</p>
<p>Warning: Cannot modify header information &#8211; headers already sent by (output started at /home/&#8230;./wp-content/themes/idream/header.php:7) in /home/&#8230;./wp-includes/pluggable.php on line 691</p>
<p>Warning: Cannot modify header information &#8211; headers already sent by (output started at /home/&#8230;./wp-content/themes/idream/header.php:7) in /home/&#8230;./wp-includes/pluggable.php on line 692<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>does it depend on the theme? i tried 3 or 4 themes and it happened with all of them..</p>
<p>am i doing something wrong? thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan O'Prey</title>
		<link>http://cleverwp.com/autologin-wordpress-php-script/#comment-923</link>
		<dc:creator>Dan O'Prey</dc:creator>
		<pubDate>Thu, 14 Oct 2010 19:42:31 +0000</pubDate>
		<guid isPermaLink="false">http://mywordpress.com/?p=414#comment-923</guid>
		<description>Thank you so much for this, Lars, it was exactly what I needed. I too was trying to sync WordPress accounts with accounts on another server, so I needed this on a custom registration form.

Just stopping by to say thanks, keep up the great work!</description>
		<content:encoded><![CDATA[<p>Thank you so much for this, Lars, it was exactly what I needed. I too was trying to sync WordPress accounts with accounts on another server, so I needed this on a custom registration form.</p>
<p>Just stopping by to say thanks, keep up the great work!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Teniz</title>
		<link>http://cleverwp.com/autologin-wordpress-php-script/#comment-781</link>
		<dc:creator>Peter Teniz</dc:creator>
		<pubDate>Tue, 07 Sep 2010 18:57:32 +0000</pubDate>
		<guid isPermaLink="false">http://mywordpress.com/?p=414#comment-781</guid>
		<description>Hi Lars
meanwhile I found, that  $current_site and $current_blog are only the half of the truth!
Both should be objects like:

class site {
  public $id = 1;
  public $domain = “domain.net”;
  public $path = “/”;
  public $blog_id = 1 ;
  public $cookie_domain = “domain.net” ;
}

$current_site = new site() ;

that does the trick of autologin in truth and also works for user creation scripts an similar for particular blogs.
Sorry for dealing with part of the truth

cheers
Peter</description>
		<content:encoded><![CDATA[<p>Hi Lars<br />
meanwhile I found, that  $current_site and $current_blog are only the half of the truth!<br />
Both should be objects like:</p>
<p>class site {<br />
  public $id = 1;<br />
  public $domain = “domain.net”;<br />
  public $path = “/”;<br />
  public $blog_id = 1 ;<br />
  public $cookie_domain = “domain.net” ;<br />
}</p>
<p>$current_site = new site() ;</p>
<p>that does the trick of autologin in truth and also works for user creation scripts an similar for particular blogs.<br />
Sorry for dealing with part of the truth</p>
<p>cheers<br />
Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lars Koudal</title>
		<link>http://cleverwp.com/autologin-wordpress-php-script/#comment-771</link>
		<dc:creator>Lars Koudal</dc:creator>
		<pubDate>Sun, 05 Sep 2010 18:00:29 +0000</pubDate>
		<guid isPermaLink="false">http://mywordpress.com/?p=414#comment-771</guid>
		<description>Hi Peter

Thank you for dropping by and leaving updated code for WordPress 3. Much appreciated! :-)</description>
		<content:encoded><![CDATA[<p>Hi Peter</p>
<p>Thank you for dropping by and leaving updated code for WordPress 3. Much appreciated! <img src='http://cleverwp.com.s3.amazonaws.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Teniz</title>
		<link>http://cleverwp.com/autologin-wordpress-php-script/#comment-770</link>
		<dc:creator>Peter Teniz</dc:creator>
		<pubDate>Sat, 04 Sep 2010 21:59:41 +0000</pubDate>
		<guid isPermaLink="false">http://mywordpress.com/?p=414#comment-770</guid>
		<description>thanks for your great autologin example!
for login in multisite-wordpress 3.0.1 you need additional information
such as $current_site and $current_blog to auto login

cheers
Peter



$current_site = array(
    &quot;id&quot;            =&gt; 1 ,
    &quot;domain&quot;        =&gt; &quot;domain.net&quot; ,
    &quot;path&quot;          =&gt; &quot;/&quot; ,
    &quot;blog_id&quot;       =&gt; 1 ,
    &quot;cookie_domain&quot; =&gt; &quot;domain.net&quot; ,
) ;
$current_blog = array(
    &quot;blog_id&quot;       =&gt;  &quot;1&quot; ,
    &quot;site_id&quot;       =&gt;  &quot;1&quot; ,
    &quot;domain&quot;        =&gt;  &quot;blog.domain.net&quot; ,
    &quot;path&quot;          =&gt;  &quot;/&quot; ,
    &quot;registered&quot;    =&gt;  &quot;2010-09-04 23:44:04&quot; ,
    &quot;last_updated&quot;  =&gt;  &quot;2010-09-04 23:46:09&quot; ,
    &quot;public&quot;        =&gt;  &quot;1&quot; ,
    &quot;archived&quot;      =&gt;  &quot;0&quot; ,
    &quot;mature&quot;        =&gt;  &quot;0&quot; ,
    &quot;spam&quot;          =&gt;  &quot;0&quot; ,
    &quot;deleted&quot;       =&gt;  &quot;0&quot; ,
    &quot;lang_id&quot;       =&gt;  &quot;0&quot; ,
) ;
require(&#039;wp-blog-header.php&#039;);
$user_login = &#039;admin&#039;;
$user = get_userdatabylogin($user_login);
$user_id = $user-&gt;ID;
wp_set_current_user($user_id, $user_login);
wp_set_auth_cookie($user_id);
do_action(&#039;wp_login&#039;, $user_login);</description>
		<content:encoded><![CDATA[<p>thanks for your great autologin example!<br />
for login in multisite-WordPress 3.0.1 you need additional information<br />
such as $current_site and $current_blog to auto login</p>
<p>cheers<br />
Peter</p>
<p>$current_site = array(<br />
    &#8220;id&#8221;            =&gt; 1 ,<br />
    &#8220;domain&#8221;        =&gt; &#8220;domain.net&#8221; ,<br />
    &#8220;path&#8221;          =&gt; &#8220;/&#8221; ,<br />
    &#8220;blog_id&#8221;       =&gt; 1 ,<br />
    &#8220;cookie_domain&#8221; =&gt; &#8220;domain.net&#8221; ,<br />
) ;<br />
$current_blog = array(<br />
    &#8220;blog_id&#8221;       =&gt;  &#8220;1&#8243; ,<br />
    &#8220;site_id&#8221;       =&gt;  &#8220;1&#8243; ,<br />
    &#8220;domain&#8221;        =&gt;  &#8220;blog.domain.net&#8221; ,<br />
    &#8220;path&#8221;          =&gt;  &#8220;/&#8221; ,<br />
    &#8220;registered&#8221;    =&gt;  &#8220;2010-09-04 23:44:04&#8243; ,<br />
    &#8220;last_updated&#8221;  =&gt;  &#8220;2010-09-04 23:46:09&#8243; ,<br />
    &#8220;public&#8221;        =&gt;  &#8220;1&#8243; ,<br />
    &#8220;archived&#8221;      =&gt;  &#8220;0&#8243; ,<br />
    &#8220;mature&#8221;        =&gt;  &#8220;0&#8243; ,<br />
    &#8220;spam&#8221;          =&gt;  &#8220;0&#8243; ,<br />
    &#8220;deleted&#8221;       =&gt;  &#8220;0&#8243; ,<br />
    &#8220;lang_id&#8221;       =&gt;  &#8220;0&#8243; ,<br />
) ;<br />
require(&#8216;wp-blog-header.php&#8217;);<br />
$user_login = &#8216;admin&#8217;;<br />
$user = get_userdatabylogin($user_login);<br />
$user_id = $user-&gt;ID;<br />
wp_set_current_user($user_id, $user_login);<br />
wp_set_auth_cookie($user_id);<br />
do_action(&#8216;wp_login&#8217;, $user_login);</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Served from: cleverwp.com @ 2012-02-05 06:04:24 by W3 Total Cache -->
