<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>WLScripting.com &#187; Validation</title>
	<atom:link href="http://www.wlscripting.com/tutorial/category/validation/feed" rel="self" type="application/rss+xml" />
	<link>http://www.wlscripting.com</link>
	<description>PHP coding tutorials</description>
	<lastBuildDate>Wed, 10 Mar 2010 23:02:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9-beta-1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>cPanel, WHM, Webmail login script</title>
		<link>http://www.wlscripting.com/tutorial/33</link>
		<comments>http://www.wlscripting.com/tutorial/33#comments</comments>
		<pubDate>Wed, 27 Sep 2006 23:33:41 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Validation]]></category>

		<guid isPermaLink="false">http://www.wlscripting.com/tutorial/33</guid>
		<description><![CDATA[Create a very easy cPanel, WHM, Webmail login form all using PHP!]]></description>
			<content:encoded><![CDATA[<p>The following code will allow you to login to several different ports that are used for cPanel.</p>
<div class="hl-surround" style="height:280px;"><div class="hl-main"><pre><span class="hl-default">&lt;form action=&quot;cpanelLogin.php&quot; method=&quot;POST&quot;&gt;
</span><span class="hl-inlinetags">&lt;?php
</span><span class="hl-comment">// Show an error if the login failed
</span><span class="hl-reserved">if</span><span class="hl-brackets">((</span><span class="hl-var">$_GET</span><span class="hl-brackets">[</span><span class="hl-quotes">'</span><span class="hl-string">failed</span><span class="hl-quotes">'</span><span class="hl-brackets">]</span><span class="hl-code"> == </span><span class="hl-quotes">&quot;</span><span class="hl-string">1</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">) </span><span class="hl-reserved">or </span><span class="hl-brackets">(</span><span class="hl-var">$error</span><span class="hl-code"> == </span><span class="hl-number">1</span><span class="hl-brackets">)){
</span><span class="hl-reserved">echo </span><span class="hl-quotes">'</span><span class="hl-string">&lt;font color=&quot;#FF0000&quot;&gt;Your login attempt failed!&lt;/font&gt;&lt;br /&gt;</span><span class="hl-quotes">'</span><span class="hl-code">;
</span><span class="hl-brackets">}
</span><span class="hl-inlinetags">?&gt;</span><span class="hl-default">
Domain: &lt;input type=&quot;text&quot; name=&quot;domain&quot; value=&quot;&quot; size=&quot;20&quot; /&gt;&lt;br /&gt;
Username: &lt;input type=&quot;text&quot; name=&quot;username&quot; value=&quot;&quot; size=&quot;20&quot; /&gt;&lt;br /&gt;
Password: &lt;input type=&quot;password&quot; name=&quot;pass&quot; value=&quot;&quot; size=&quot;20&quot; /&gt;&lt;br /&gt;
</span><span class="hl-inlinetags">&lt;?php
</span><span class="hl-comment">// This failurl allows cPanel to redirect back to this site
</span><span class="hl-reserved">echo </span><span class="hl-quotes">'</span><span class="hl-string">&lt;input type=&quot;hidden&quot; name=&quot;failurl&quot; value=&quot;http://</span><span class="hl-quotes">'</span><span class="hl-code">.</span><span class="hl-var">$_SERVER</span><span class="hl-brackets">[</span><span class="hl-quotes">'</span><span class="hl-string">HTTP_HOST</span><span class="hl-quotes">'</span><span class="hl-brackets">]</span><span class="hl-code">.</span><span class="hl-var">$_SERVER</span><span class="hl-brackets">[</span><span class="hl-quotes">'</span><span class="hl-string">PHP_SELF</span><span class="hl-quotes">'</span><span class="hl-brackets">]</span><span class="hl-code">.</span><span class="hl-quotes">'</span><span class="hl-string">?failed=1&quot;&gt;</span><span class="hl-quotes">'</span><span class="hl-code">;
</span><span class="hl-inlinetags">?&gt;</span><span class="hl-default">
Options: &lt;select name=&quot;port&quot;&gt;
  &lt;option value=&quot;2082&quot;&gt;cPanel &lt;/option&gt;
  &lt;option value=&quot;2083&quot;&gt;Secure cPanel &lt;/option&gt;
  &lt;option value=&quot;2086&quot;&gt;WHM&lt;/option&gt;
  &lt;option value=&quot;2087&quot;&gt;Secure WHM&lt;/option&gt;
  &lt;option value=&quot;2095&quot;&gt;Webmail&lt;/option&gt;
  &lt;option value=&quot;2096&quot;&gt;Secure Webmail&lt;/option&gt;
&lt;/select&gt;&lt;br /&gt;
&lt;input type=&quot;submit&quot; value=&quot;Login&quot; /&gt;
&lt;/form&gt;</span></pre></div></div>
<p>Above we created a very basic form to allow the users to login with. You can spice this up to match your site, you just have to make sure that the field names &#8211; the name=&#8221; some text &#8221; &#8211; remains the same.</p>
<p>If you only want to allow cPanel logins you can change the &lt;select name=&#8221;port&#8221;&gt; to &lt;input type=&#8221;hidden&#8221; name=&#8221;port&#8221; value=&#8221;2082&#8243;&gt;. This allows you to only show the domain, username and password fields.</p>
<p>One thing you will have to make sure you change is the action on the &lt;form&gt; so that it points to the file you will be saving on the next page of this article.</p>
<p>On the next page is the processing of the code.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wlscripting.com/tutorial/33/feed</wfw:commentRss>
		<slash:comments>37</slash:comments>
		</item>
	</channel>
</rss>
