<?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: How do you set up LOGIN script for PHP on dreamweaver?</title>
	<atom:link href="http://www.codebrothers.org/how-do-you-set-up-login-script-for-php-on-dreamweaver/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.codebrothers.org/how-do-you-set-up-login-script-for-php-on-dreamweaver/</link>
	<description></description>
	<lastBuildDate>Mon, 02 Jan 2012 00:02:34 +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: Ron</title>
		<link>http://www.codebrothers.org/how-do-you-set-up-login-script-for-php-on-dreamweaver/comment-page-1/#comment-2093</link>
		<dc:creator>Ron</dc:creator>
		<pubDate>Wed, 10 Mar 2010 00:01:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.codebrothers.org/how-do-you-set-up-login-script-for-php-on-dreamweaver/#comment-2093</guid>
		<description>Easiest way to me is to insert the code while in Code View.

Login Codes:

Website Access Manager - http://www.coffeecup.com/website-access-manager/

Depending on what you run:

How to: Create an ASP.NET Login Page - http://msdn.microsoft.com/en-us/library/ms178331.aspx
 Creating Login Page  - http://www.adesdesign.net/php/tutorials/dreamweaver/secure_login.php
Create login page - http://www.interaktonline.com/Documentation/MXCalendar/4243_createlogin.htm

Bravenet Password Protect - http://www.bravenet.com/webtools/passwd/

HTHs,

Ron</description>
		<content:encoded><![CDATA[<p>Easiest way to me is to insert the code while in Code View.</p>
<p>Login Codes:</p>
<p>Website Access Manager &#8211; http://www.coffeecup.com/website-access-manager/</p>
<p>Depending on what you run:</p>
<p>How to: Create an ASP.NET Login Page &#8211; http://msdn.microsoft.com/en-us/library/ms178331.aspx<br />
 Creating Login Page  &#8211; http://www.adesdesign.net/php/tutorials/dreamweaver/secure_login.php<br />
Create login page &#8211; http://www.interaktonline.com/Documentation/MXCalendar/4243_createlogin.htm</p>
<p>Bravenet Password Protect &#8211; http://www.bravenet.com/webtools/passwd/</p>
<p>HTHs,</p>
<p>Ron</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DzSoundNirvana</title>
		<link>http://www.codebrothers.org/how-do-you-set-up-login-script-for-php-on-dreamweaver/comment-page-1/#comment-2094</link>
		<dc:creator>DzSoundNirvana</dc:creator>
		<pubDate>Wed, 10 Mar 2010 00:01:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.codebrothers.org/how-do-you-set-up-login-script-for-php-on-dreamweaver/#comment-2094</guid>
		<description>&lt;?
/***************************
    login.class.php
***************************/
class user{
//To track the switch/errors through out
var $login_error;

//constructor
function user($UserInput){
if($_SERVER[&#039;REQUEST_METHOD&#039;] == &quot;POST&quot;)
{
$this-&gt;validate_user($UserInput);
}
else
{
$this-&gt;login_form();
}
}//End function


//Just a simple login form
function login_form(){
echo &quot;&lt;div align=\&quot;center\&quot;&gt;&lt;form name=\&quot;LoginForm\&quot; action=\&quot;$_SERVER[PHP_SELF]\&quot; method=\&quot;POST\&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;tr&gt;&lt;td&gt;User Name:&lt;/td&gt;&lt;td&gt;&lt;input type=\&quot;text\&quot; name=\&quot;FLU\&quot;&gt;&lt;/td&gt;&lt;td&gt;Password:&lt;/td&gt;&lt;td&gt;&lt;input type=\&quot;password\&quot; name=\&quot;FLP\&quot;&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=\&quot;2\&quot;&gt;&lt;input type=\&quot;submit\&quot; value=\&quot;Submit\&quot;&gt; &lt;input type=\&quot;reset\&quot; value=\&quot;Reset\&quot;&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&quot;;

}//End Function

function validate_user($UserInput){

//my chosen user name and password pattern
$this-&gt;user_name_pattern = (&quot;^[a-zA-Z0-9]{5,15}$&quot;);
$this-&gt;password_pattern = (&quot;^[a-zA-Z0-9\!\@\#\$\%\^\&amp;&#092;*\`\~\_]{5,15}$&quot;);
//JavaScript History -1
$this-&gt;go_back = &quot;&lt;a href=javascript:history.go(-1)&gt;&lt;font color=red size=-2&gt;(Go Back)&lt;/font&gt;&lt;/a&gt;&quot;;
//Change the redirect location to whare you want to go http://yoursite.com/members/
$this-&gt;success_login_redirect = &quot;http://dzsoundnirvana.com/&quot;;

switch($UserInput){
case ($UserInput[&#039;FLU&#039;] == &quot;&quot; &#124;&#124; !ereg($this-&gt;user_name_pattern,$UserInput[&#039;FLU&#039;])):
$this-&gt;login_form();
echo &quot;&lt;div align=\&quot;center\&quot;&gt;&lt;font color=\&quot;red\&quot;&gt;Invalid user name. Try again or $this-&gt;go_back!&lt;/font&gt;&lt;/div&gt;&quot;;
$this-&gt;login_error == false;      
break;
         
case ($UserInput[&#039;FLP&#039;] == &quot;&quot; &#124;&#124; !ereg($this-&gt;password_pattern,$UserInput[&#039;FLP&#039;])):
$this-&gt;login_form();
echo &quot;&lt;div align=\&quot;center\&quot;&gt;&lt;font color=\&quot;red\&quot;&gt;Invalid password. Try again or $this-&gt;go_back!&lt;/font&gt;&lt;/div&gt;&quot;;
$this-&gt;login_error == false;
break;
}
if($this-&gt;login_error === false){
//Or you can redirect to a &quot;Forgot password/user name&quot; page or leave it alone. This will kill the script. No output after though!
exit;
}
else{
//Now we go to the Database and validate the user
$this-&gt;db();
$this-&gt;query_string = &quot;SELECT * FROM users WHERE user_name=&#039;$UserInput[FLU]&#039; &amp;&amp; password=&#039;&quot; . md5($UserInput[&#039;password&#039;]) . &quot;&#039;&quot;;
$this-&gt;query = mysql_query($this-&gt;query_string);
//Error check the query
if(!$this-&gt;query){
echo &quot;System error! Contact the system administrator!&lt;br&gt;or&lt;br&gt;$this-&gt;go_back&quot;;
//use this for debugging (below), Delete the // at the beginning
//echo mysql_error();
}
else{
//Need to check if more than 1 user exists if so....throw HACKING error (not supported here)..another class
$this-&gt;num_rows = mysql_num_rows($this-&gt;query);
if($this-&gt;num_rows &gt; 1){
echo &quot;Hacking warning&quot;;
exit;
}
else{
//Get the user information and set into the $_SESSION and then redirect to the directed page
$this-&gt;user_information = mysql_fetch_assoc($this-&gt;query);
//Put all user data into $_SESSION
foreach($this-&gt;user_information as $key =&gt; $value){
$_SESSION[$key] = $value;
//Now we redirect to the page specified
echo &quot;&lt;script type=\&quot;text/javascript\&quot;&gt;window.location=\&quot;$this-&gt;success_login_redirect\&quot;&lt;/script&gt;&quot;;
echo &quot;If you are not redirected &lt;a href=\&quot;this-&gt;success_login_redirect\&quot; target=\&quot;_parent\&quot;&gt;Click here to continue&lt;/a&gt;&quot;;
}
}

}//else

}//if($this-&gt;login_error === false)/else{


}//End function

function db(){
//Put your database host, database user name, and database password
$this-&gt;db_link = mysql_connect(&quot;data_base_host&quot;,&quot;data_base_user&quot;,&quot;data_base_password&quot;);
//Select the DB
//Put your database name
$this-&gt;db_select = mysql_select_db(&quot;data_base_name&quot;);

}


}//End Class
?&gt;</description>
		<content:encoded><![CDATA[<p>&lt;?<br />
/***************************<br />
    login.class.php<br />
***************************/<br />
class user{<br />
//To track the switch/errors through out<br />
var $login_error;</p>
<p>//constructor<br />
function user($UserInput){<br />
if($_SERVER['REQUEST_METHOD'] == &quot;POST&quot;)<br />
{<br />
$this-&gt;validate_user($UserInput);<br />
}<br />
else<br />
{<br />
$this-&gt;login_form();<br />
}<br />
}//End function</p>
<p>//Just a simple login form<br />
function login_form(){<br />
echo &quot;&lt;div align=\&quot;center\&quot;&gt;&lt;form name=\&quot;LoginForm\&quot; action=\&quot;$_SERVER[PHP_SELF]\&quot; method=\&quot;POST\&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;tr&gt;&lt;td&gt;User Name:&lt;/td&gt;&lt;td&gt;&lt;input type=\&quot;text\&quot; name=\&quot;FLU\&quot;&gt;&lt;/td&gt;&lt;td&gt;Password:&lt;/td&gt;&lt;td&gt;&lt;input type=\&quot;password\&quot; name=\&quot;FLP\&quot;&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=\&quot;2\&quot;&gt;&lt;input type=\&quot;submit\&quot; value=\&quot;Submit\&quot;&gt; &lt;input type=\&quot;reset\&quot; value=\&quot;Reset\&quot;&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&quot;;</p>
<p>}//End Function</p>
<p>function validate_user($UserInput){</p>
<p>//my chosen user name and password pattern<br />
$this-&gt;user_name_pattern = (&quot;^[a-zA-Z0-9]{5,15}$&quot;);<br />
$this-&gt;password_pattern = (&quot;^[a-zA-Z0-9\!\@\#\$\%\^\&amp;&#92;*\`\~\_]{5,15}$&quot;);<br />
//JavaScript History -1<br />
$this-&gt;go_back = &quot;&lt;a href=javascript:history.go(-1)&gt;&lt;font color=red size=-2&gt;(Go Back)&lt;/font&gt;&lt;/a&gt;&quot;;<br />
//Change the redirect location to whare you want to go http://yoursite.com/members/<br />
$this-&gt;success_login_redirect = &quot;http://dzsoundnirvana.com/&quot;;</p>
<p>switch($UserInput){<br />
case ($UserInput['FLU'] == &quot;&quot; || !ereg($this-&gt;user_name_pattern,$UserInput['FLU'])):<br />
$this-&gt;login_form();<br />
echo &quot;&lt;div align=\&quot;center\&quot;&gt;&lt;font color=\&quot;red\&quot;&gt;Invalid user name. Try again or $this-&gt;go_back!&lt;/font&gt;&lt;/div&gt;&quot;;<br />
$this-&gt;login_error == false;<br />
break;</p>
<p>case ($UserInput['FLP'] == &quot;&quot; || !ereg($this-&gt;password_pattern,$UserInput['FLP'])):<br />
$this-&gt;login_form();<br />
echo &quot;&lt;div align=\&quot;center\&quot;&gt;&lt;font color=\&quot;red\&quot;&gt;Invalid password. Try again or $this-&gt;go_back!&lt;/font&gt;&lt;/div&gt;&quot;;<br />
$this-&gt;login_error == false;<br />
break;<br />
}<br />
if($this-&gt;login_error === false){<br />
//Or you can redirect to a &quot;Forgot password/user name&quot; page or leave it alone. This will kill the script. No output after though!<br />
exit;<br />
}<br />
else{<br />
//Now we go to the Database and validate the user<br />
$this-&gt;db();<br />
$this-&gt;query_string = &quot;SELECT * FROM users WHERE user_name=&#8217;$UserInput[FLU]&#8216; &amp;&amp; password=&#8217;&quot; . md5($UserInput['password']) . &quot;&#8217;&quot;;<br />
$this-&gt;query = mysql_query($this-&gt;query_string);<br />
//Error check the query<br />
if(!$this-&gt;query){<br />
echo &quot;System error! Contact the system administrator!&lt;br&gt;or&lt;br&gt;$this-&gt;go_back&quot;;<br />
//use this for debugging (below), Delete the // at the beginning<br />
//echo mysql_error();<br />
}<br />
else{<br />
//Need to check if more than 1 user exists if so&#8230;.throw HACKING error (not supported here)..another class<br />
$this-&gt;num_rows = mysql_num_rows($this-&gt;query);<br />
if($this-&gt;num_rows &gt; 1){<br />
echo &quot;Hacking warning&quot;;<br />
exit;<br />
}<br />
else{<br />
//Get the user information and set into the $_SESSION and then redirect to the directed page<br />
$this-&gt;user_information = mysql_fetch_assoc($this-&gt;query);<br />
//Put all user data into $_SESSION<br />
foreach($this-&gt;user_information as $key =&gt; $value){<br />
$_SESSION[$key] = $value;<br />
//Now we redirect to the page specified<br />
echo &quot;&lt;script type=\&quot;text/javascript\&quot;&gt;window.location=\&quot;$this-&gt;success_login_redirect\&quot;&lt;/script&gt;&quot;;<br />
echo &quot;If you are not redirected &lt;a href=\&quot;this-&gt;success_login_redirect\&quot; target=\&quot;_parent\&quot;&gt;Click here to continue&lt;/a&gt;&quot;;<br />
}<br />
}</p>
<p>}//else</p>
<p>}//if($this-&gt;login_error === false)/else{</p>
<p>}//End function</p>
<p>function db(){<br />
//Put your database host, database user name, and database password<br />
$this-&gt;db_link = mysql_connect(&quot;data_base_host&quot;,&quot;data_base_user&quot;,&quot;data_base_password&quot;);<br />
//Select the DB<br />
//Put your database name<br />
$this-&gt;db_select = mysql_select_db(&quot;data_base_name&quot;);</p>
<p>}</p>
<p>}//End Class<br />
?&gt;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
