<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[PunBB Forums - Create a external form for login]]></title>
		<link>http://punbb.informer.com/forums/topic/21660/create-a-external-form-for-login/</link>
		<description><![CDATA[The most recent posts in Create a external form for login.]]></description>
		<lastBuildDate>Mon, 05 Oct 2009 07:17:04 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Create a external form for login]]></title>
			<link>http://punbb.informer.com/forums/post/131464/#p131464</link>
			<description><![CDATA[<p>Are you sure the file &quot;&lt;FORUM_ROOT&gt;/include/common.php&quot; is included in your code?</p>]]></description>
			<author><![CDATA[dummy@example.com (Slavok)]]></author>
			<pubDate>Mon, 05 Oct 2009 07:17:04 +0000</pubDate>
			<guid>http://punbb.informer.com/forums/post/131464/#p131464</guid>
		</item>
		<item>
			<title><![CDATA[Re: Create a external form for login]]></title>
			<link>http://punbb.informer.com/forums/post/129530/#p129530</link>
			<description><![CDATA[<p>does anyone know how this error was fixed?<br /></p><div class="codebox"><pre><code>Call to a member function escape() on a non-object in /include/functions.php on line 1350</code></pre></div><p>im still getting it and have no idea how to fix it..</p>]]></description>
			<author><![CDATA[dummy@example.com (rahahm33)]]></author>
			<pubDate>Mon, 10 Aug 2009 04:56:18 +0000</pubDate>
			<guid>http://punbb.informer.com/forums/post/129530/#p129530</guid>
		</item>
		<item>
			<title><![CDATA[Re: Create a external form for login]]></title>
			<link>http://punbb.informer.com/forums/post/128374/#p128374</link>
			<description><![CDATA[<div class="quotebox"><cite>Parpalak wrote:</cite><blockquote><p>I think this code is placed into a Wordpress plugin and then is eval&#039;ed. And there is no defined FORUM_ROOT constant in Wordpress.</p></blockquote></div><p>Ah, I thought he was doing it the opposite way around. My apologies. <img src="http://punbb.informer.com/forums/img/smilies/big_smile.png" width="15" height="15" alt="big_smile" /></p>]]></description>
			<author><![CDATA[dummy@example.com (MattF)]]></author>
			<pubDate>Mon, 08 Jun 2009 14:48:13 +0000</pubDate>
			<guid>http://punbb.informer.com/forums/post/128374/#p128374</guid>
		</item>
		<item>
			<title><![CDATA[Re: Create a external form for login]]></title>
			<link>http://punbb.informer.com/forums/post/128371/#p128371</link>
			<description><![CDATA[<p>I think this code is placed into a Wordpress plugin and then is eval&#039;ed. And there is no defined FORUM_ROOT constant in Wordpress.</p>]]></description>
			<author><![CDATA[dummy@example.com (Parpalak)]]></author>
			<pubDate>Mon, 08 Jun 2009 13:23:10 +0000</pubDate>
			<guid>http://punbb.informer.com/forums/post/128371/#p128371</guid>
		</item>
		<item>
			<title><![CDATA[Re: Create a external form for login]]></title>
			<link>http://punbb.informer.com/forums/post/128368/#p128368</link>
			<description><![CDATA[<p>Just for future reference, precede requires/includes with FORUM_ROOT, not hard coded paths. </p><p>This line:</p><div class="codebox"><pre><code>include &#039;../sitetools/pages/login.php&#039;;</code></pre></div><p>should be:</p><div class="codebox"><pre><code>include FORUM_ROOT.&#039;sitetools/pages/login.php&#039;;</code></pre></div><p>That constant is defined in every script so will always point to the correct location.</p>]]></description>
			<author><![CDATA[dummy@example.com (MattF)]]></author>
			<pubDate>Mon, 08 Jun 2009 13:13:08 +0000</pubDate>
			<guid>http://punbb.informer.com/forums/post/128368/#p128368</guid>
		</item>
		<item>
			<title><![CDATA[Re: Create a external form for login]]></title>
			<link>http://punbb.informer.com/forums/post/128346/#p128346</link>
			<description><![CDATA[<p>mmm ok thanks alot for your help.</p>]]></description>
			<author><![CDATA[dummy@example.com (SuperMAG)]]></author>
			<pubDate>Sun, 07 Jun 2009 14:53:52 +0000</pubDate>
			<guid>http://punbb.informer.com/forums/post/128346/#p128346</guid>
		</item>
		<item>
			<title><![CDATA[Re: Create a external form for login]]></title>
			<link>http://punbb.informer.com/forums/post/128345/#p128345</link>
			<description><![CDATA[<p>This means that PunBB and Wordpress both have functions validate_username(). So integration is not as easy. Maybe it&#039;s worth to copy the generate_form_token() function from PunBB core into a separate file. I&#039;ll return to this question after some days.</p>]]></description>
			<author><![CDATA[dummy@example.com (Parpalak)]]></author>
			<pubDate>Sun, 07 Jun 2009 13:49:07 +0000</pubDate>
			<guid>http://punbb.informer.com/forums/post/128345/#p128345</guid>
		</item>
		<item>
			<title><![CDATA[Re: Create a external form for login]]></title>
			<link>http://punbb.informer.com/forums/post/128326/#p128326</link>
			<description><![CDATA[<p>LoL i got 2 new kinds of error </p><p>This one in the Widget place:<br /></p><div class="quotebox"><blockquote><p>Fatal error: Cannot redeclare validate_username() (previously declared in /home/supermag/public_html/wp-includes/registration.php:49) in /home/supermag/public_html/community/include/functions.php on line 864</p></blockquote></div><p>And This one at the pages:<br /></p><div class="quotebox"><blockquote><p>Fatal error: Call to a member function escape() on a non-object in /home/supermag/public_html/community/include/functions.php on line 1350</p></blockquote></div><p>LoL again.</p>]]></description>
			<author><![CDATA[dummy@example.com (SuperMAG)]]></author>
			<pubDate>Fri, 05 Jun 2009 19:40:18 +0000</pubDate>
			<guid>http://punbb.informer.com/forums/post/128326/#p128326</guid>
		</item>
		<item>
			<title><![CDATA[Re: Create a external form for login]]></title>
			<link>http://punbb.informer.com/forums/post/128316/#p128316</link>
			<description><![CDATA[<div class="quotebox"><cite>SuperMAG wrote:</cite><blockquote><p>Warning: include(../../sitetools/pages/login.php) [function.include]: failed to open stream: No such file or directory in /home/supermag/public_html/wp-content/plugins/php-code-widget/execphp.php(37) : eval()&#039;d code on line 2</p></blockquote></div><div class="quotebox"><cite>SuperMAG wrote:</cite><blockquote><p>And i didnt messed with the plugin file. just edited that login and a widget.</p></blockquote></div><p>Ok, I&#039;ve got it.</p>]]></description>
			<author><![CDATA[dummy@example.com (Parpalak)]]></author>
			<pubDate>Fri, 05 Jun 2009 13:04:47 +0000</pubDate>
			<guid>http://punbb.informer.com/forums/post/128316/#p128316</guid>
		</item>
		<item>
			<title><![CDATA[Re: Create a external form for login]]></title>
			<link>http://punbb.informer.com/forums/post/128315/#p128315</link>
			<description><![CDATA[<div class="quotebox"><cite>SuperMAG wrote:</cite><blockquote><p>But i still dont know if this is correct Include</p></blockquote></div><p>Actually depends on where you place it.</p><p>It&#039;s quite a good code, and it works if you have really got the error described here: <a href="http://punbb.informer.com/forums/post/128228/#p128228">http://punbb.informer.com/forums/post/128228/#p128228</a></p><p>But it&#039;s better to write</p><div class="codebox"><pre><code>&lt;?php
include $_SERVER[&#039;DOCUMENT_ROOT&#039;].&#039;/sitetools/pages/login.php&#039;;
?&gt;</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (Parpalak)]]></author>
			<pubDate>Fri, 05 Jun 2009 13:01:13 +0000</pubDate>
			<guid>http://punbb.informer.com/forums/post/128315/#p128315</guid>
		</item>
		<item>
			<title><![CDATA[Re: Create a external form for login]]></title>
			<link>http://punbb.informer.com/forums/post/128314/#p128314</link>
			<description><![CDATA[<p>what u r talking about, here is my Current Login.php</p><div class="codebox"><pre><code>&lt;?php

// Define the path to the forum root
define(&#039;FORUM_ROOT&#039;, &#039;../../community/&#039;);
require FORUM_ROOT.&#039;include/common.php&#039;;

function my_login_form() {

    global $forum_url;

    // Where will we go after login?
    $forum_page[&#039;redirect_url&#039;] = &#039;http://sports2all.com/community/&#039;;

    $forum_page[&#039;form_action&#039;] = forum_link($forum_url[&#039;login&#039;]);

    $forum_page[&#039;hidden_fields&#039;] = array(
        &#039;form_sent&#039;        =&gt; &#039;&lt;input type=&quot;hidden&quot; name=&quot;form_sent&quot; value=&quot;1&quot; /&gt;&#039;,
        &#039;redirect_url&#039;    =&gt; &#039;&lt;input type=&quot;hidden&quot; name=&quot;redirect_url&quot; value=&quot;&#039;.forum_htmlencode($forum_page[&#039;redirect_url&#039;]).&#039;&quot; /&gt;&#039;,
        &#039;csrf_token&#039;    =&gt; &#039;&lt;input type=&quot;hidden&quot; name=&quot;csrf_token&quot; value=&quot;&#039;.generate_form_token($forum_page[&#039;form_action&#039;]).&#039;&quot; /&gt;&#039;
    );

?&gt;
&lt;form method=&quot;post&quot; action=&quot;&lt;?php echo $forum_page[&#039;form_action&#039;] ?&gt;&quot;&gt;
    &lt;?php echo implode(&quot;\n\t\t&quot;, $forum_page[&#039;hidden_fields&#039;]).&quot;\n&quot; ?&gt;

    Username:
    &lt;input type=&quot;text&quot; id=&quot;fld1&quot; name=&quot;req_username&quot; value=&quot;&quot; /&gt;
    &lt;br /&gt;

    Password:
    &lt;input type=&quot;password&quot; id=&quot;fld2&quot; name=&quot;req_password&quot; value=&quot;&quot; /&gt;
    &lt;br /&gt;

    &lt;input type=&quot;checkbox&quot; id=&quot;fld3&quot; name=&quot;save_pass&quot; value=&quot;1&quot; /&gt;
    &lt;label for=&quot;fld3&quot;&gt;Log me in automatically each time I visit.&lt;/label&gt;
    &lt;br /&gt;

    &lt;input type=&quot;submit&quot; name=&quot;login&quot; value=&quot;Login&quot; /&gt;
&lt;/form&gt;

&lt;?

}

my_login_form();</code></pre></div><p>even after i modified the </p><div class="codebox"><pre><code>define(&#039;FORUM_ROOT&#039;, $_SERVER[&#039;DOCUMENT_ROOT&#039;].&#039;/community/&#039;);</code></pre></div><p>but still get this error:</p><div class="quotebox"><blockquote><p>Warning: include(../../sitetools/pages/login.php) [function.include]: failed to open stream: No such file or directory in /home/supermag/public_html/wp-content/plugins/php-code-widget/execphp.php(37) : eval()&#039;d code on line 2</p></blockquote></div><br /><p>But i still dont know if this is correct Include:</p><div class="codebox"><pre><code>&lt;?php
include &#039;../sitetools/pages/login.php&#039;;
?&gt;</code></pre></div><p>And i didnt messed with the plugin file. just edited that login and a widget.<br /><a href="http://sports2all.com//wp-content/plugins/php-code-widget/execphp.php">http://sports2all.com//wp-content/plugi &#133; xecphp.php</a></p>]]></description>
			<author><![CDATA[dummy@example.com (SuperMAG)]]></author>
			<pubDate>Fri, 05 Jun 2009 12:49:21 +0000</pubDate>
			<guid>http://punbb.informer.com/forums/post/128314/#p128314</guid>
		</item>
		<item>
			<title><![CDATA[Re: Create a external form for login]]></title>
			<link>http://punbb.informer.com/forums/post/128313/#p128313</link>
			<description><![CDATA[<p>BTW, there can be an issue with relative paths when one tries to include a file A into a file B, and then the file B into a file C (just like you do). It&#039;s better to write something like this:</p><div class="codebox"><pre><code>define(&#039;FORUM_ROOT&#039;, $_SERVER[&#039;DOCUMENT_ROOT&#039;].&#039;/community/&#039;);</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (Parpalak)]]></author>
			<pubDate>Fri, 05 Jun 2009 12:00:48 +0000</pubDate>
			<guid>http://punbb.informer.com/forums/post/128313/#p128313</guid>
		</item>
		<item>
			<title><![CDATA[Re: Create a external form for login]]></title>
			<link>http://punbb.informer.com/forums/post/128312/#p128312</link>
			<description><![CDATA[<p>SuperMAG! You had written that the error is in your /home/supermag/public_html/sitetools/pages/login.php file:</p><div class="quotebox"><cite>SuperMAG wrote:</cite><blockquote><p>Warning: require() [function.require]: URL file-access is disabled in the server configuration in /home/supermag/public_html/sitetools/pages/login.php on line 5</p></blockquote></div><p>I had told you to change the define(&#039;FORUM_ROOT&#039;, ...) in that file (/home/supermag/public_html/sitetools/pages/login.php) on line 4 because there is the error on line 5.</p><p>But you have obviously changed another file, /home/supermag/public_html/wp-content/plugins/php-code-widget/execphp.php. And now the include command in your /home/supermag/public_html/wp-content/plugins/php-code-widget/execphp.php file can&#039;t find the /home/supermag/public_html/sitetools/pages/login.php file.</p><p>Gosh!</p><p>Now, rollback the changes in /home/supermag/public_html/wp-content/plugins/php-code-widget/execphp.php and modify the define(&#039;FORUM_ROOT&#039;, ...) on line 4 in /home/supermag/public_html/sitetools/pages/login.php.</p>]]></description>
			<author><![CDATA[dummy@example.com (Parpalak)]]></author>
			<pubDate>Fri, 05 Jun 2009 11:44:30 +0000</pubDate>
			<guid>http://punbb.informer.com/forums/post/128312/#p128312</guid>
		</item>
		<item>
			<title><![CDATA[Re: Create a external form for login]]></title>
			<link>http://punbb.informer.com/forums/post/128311/#p128311</link>
			<description><![CDATA[<p>lol i though double .. means the first directory</p><p>but i still get this error:</p><div class="quotebox"><blockquote><p>Warning: include(../../sitetools/pages/login.php) [function.include]: failed to open stream: No such file or directory in /home/supermag/public_html/wp-content/plugins/php-code-widget/execphp.php(37) : eval()&#039;d code on line 2</p></blockquote></div><p>Ok </p><p>If the file is here: <a href="http://sports2all.com/sitetools/pages/login.php">http://sports2all.com/sitetools/pages/login.php</a><br />Forums are here: <a href="http://sports2all.com/community/">http://sports2all.com/community/</a><br />And the Wordpress plugin that executes php in widgets is here: <a href="http://sports2all.com//wp-content/plugins/php-code-widget/execphp.php">http://sports2all.com//wp-content/plugi &#133; xecphp.php</a></p><p>how should i do the include code, i tried both ../sitetools/pages/login.php and ../../sitetools/pages/login.php but its still showing the above error.</p><p>mmm <img src="http://punbb.informer.com/forums/img/smilies/hmm.png" width="15" height="15" alt="hmm" /> <img src="http://punbb.informer.com/forums/img/smilies/lol.png" width="15" height="15" alt="lol" /></p>]]></description>
			<author><![CDATA[dummy@example.com (SuperMAG)]]></author>
			<pubDate>Fri, 05 Jun 2009 11:25:32 +0000</pubDate>
			<guid>http://punbb.informer.com/forums/post/128311/#p128311</guid>
		</item>
		<item>
			<title><![CDATA[Re: Create a external form for login]]></title>
			<link>http://punbb.informer.com/forums/post/128310/#p128310</link>
			<description><![CDATA[<p>If the file is <a href="http://sports2all.com/sitetools/pages/login.php">http://sports2all.com/sitetools/pages/login.php</a> and the forum is <a href="http://sports2all.com/community/">http://sports2all.com/community/</a> then you should write</p><div class="codebox"><pre><code>define(&#039;FORUM_ROOT&#039;, &#039;../../community/&#039;);</code></pre></div><p>Doesn&#039;t require any PHP knowledge, does it?</p>]]></description>
			<author><![CDATA[dummy@example.com (Parpalak)]]></author>
			<pubDate>Fri, 05 Jun 2009 09:44:08 +0000</pubDate>
			<guid>http://punbb.informer.com/forums/post/128310/#p128310</guid>
		</item>
	</channel>
</rss>
