<?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>MohdAzam &#187; cpanel free domain</title>
	<atom:link href="http://blog.mohdazam.com/tag/cpanel-free-domain/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.mohdazam.com</link>
	<description>Knowledge talks, wisdom listens...</description>
	<lastBuildDate>Thu, 04 Mar 2010 08:47:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Give Free Domain and WebHosting on cPanel Based Hosting</title>
		<link>http://blog.mohdazam.com/giving-free-webhosting-on-cpanel-based-hosting</link>
		<comments>http://blog.mohdazam.com/giving-free-webhosting-on-cpanel-based-hosting#comments</comments>
		<pubDate>Tue, 14 Oct 2008 10:47:10 +0000</pubDate>
		<dc:creator>CrusheD_LameR</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cpanel free domain]]></category>
		<category><![CDATA[domain and hosting for free]]></category>
		<category><![CDATA[free domain]]></category>

		<guid isPermaLink="false">http://blog.mohdazam.com/?p=132</guid>
		<description><![CDATA[Well&#8230;.,Do you already have cPanel Based Hosting? Do you have a lot of unused bandwith by end of the month?or you got unlimited / unmetered bandwith?And still got a lot of web space in your hosting account?? Now, You can share your domain, by giving subdomain for free!i mean your visitor can simply register their desired subdomain under your [...]]]></description>
			<content:encoded><![CDATA[<p>Well&#8230;.,Do you already have cPanel Based Hosting? Do you have a lot of unused bandwith by end of the month?or you got unlimited / unmetered bandwith?And still got a lot of web space in your hosting account??</p>
<p>Now, You can share your domain, by giving subdomain for free!i mean your visitor can simply register their desired subdomain under your domain! without hasle for you to login to your cpanel account and register the subdomain for them! Yes correct!you can!!</p>
<p>Here is the interesting part!, There&#8217;s Script written<span id="more-132"></span> by zubrag.com&#8230;You may download it <a href="http://www.zubrag.com/downloads/cpanel_subdomains.zip" target="_blank">here</a>, or visit their <a href="http://www.zubrag.com/scripts/cpanel-subdomains-creator.php">web</a> for more and updated information..Or you can simply copy and paste the code below!</p>
<blockquote><p>&lt;?php</p>
<p>###############################################################<br />
# cPanel Subdomains Creator 1.1<br />
###############################################################<br />
# Visit <a href="http://www.zubrag.com/scripts/">http://www.zubrag.com/scripts/</a> for updates<br />
###############################################################<br />
#<br />
# Can be used in 3 ways:<br />
# 1. just open script in browser and fill the form<br />
# 2. pass all info via url and form will not appear<br />
# Sample: cpanel_subdomains.php?cpaneluser=USER&amp;cpanelpass=PASSWORD&amp;domain=DOMAIN&amp;subdomain=SUBDOMAIN<br />
# 3. list subdomains in file. In this case you must provide all the defaults below<br />
#<br />
# Note: you can omit any parameter, except &#8220;subdomain&#8221;.<br />
# When omitted, default value specified below will be taken<br />
###############################################################</p>
<p>// cpanel user<br />
define(&#8216;CPANELUSER&#8217;,'user&#8217;);</p>
<p>// cpanel password<br />
define(&#8216;CPANELPASS&#8217;,'pass&#8217;);</p>
<p>// name of the subdomains list file.<br />
// file format may be 1 column or 2 columns divided with semicilon (;)<br />
// Example for two columns:<br />
//   rootdomain1;subdomain1<br />
//   rootdomain1;subdomain2<br />
// Example for one columns:<br />
//   subdomain1<br />
//   subdomain2<br />
define(&#8216;INPUT_FILE&#8217;,'domains.txt&#8217;);</p>
<p>// cPanel skin (mainly &#8220;x&#8221;)<br />
// Check <a href="http://www.zubrag.com/articles/determine-cpanel-skin.php">http://www.zubrag.com/articles/determine-cpanel-skin.php</a><br />
// to know it for sure<br />
define(&#8216;CPANEL_SKIN&#8217;,'x&#8217;);</p>
<p>// Default domain (subdomains will be created for this domain)<br />
// Will be used if not passed via parameter and not set in subdomains file<br />
define(&#8216;DOMAIN&#8217;,&#8221;);<br />
/////////////// END OF INITIAL SETTINGS ////////////////////////<br />
////////////////////////////////////////////////////////////////</p>
<p>function getVar($name, $def = &#8221;) {<br />
if (isset($_REQUEST[$name]) &amp;&amp; ($_REQUEST[$name] != &#8221;))<br />
return $_REQUEST[$name];<br />
else<br />
return $def;<br />
}</p>
<p>$cpaneluser=getVar(&#8216;cpaneluser&#8217;, CPANELUSER);<br />
$cpanelpass=getVar(&#8216;cpanelpass&#8217;, CPANELPASS);<br />
$cpanel_skin = getVar(&#8216;cpanelskin&#8217;, CPANEL_SKIN);</p>
<p>if (isset($_REQUEST["subdomain"])) {<br />
// get parameters passed via URL or form, emulate string from file<br />
$doms = array( getVar(&#8216;domain&#8217;, DOMAIN) . &#8220;;&#8221; . $_REQUEST["subdomain"]);<br />
if (getVar(&#8216;domain&#8217;, DOMAIN) == &#8221;) die(&#8220;You must specify domain name&#8221;);<br />
}<br />
else {<br />
// open file with domains list<br />
$doms = @file(INPUT_FILE);<br />
if (!$doms) {<br />
// file does not exist, show input form<br />
echo &#8221;<br />
Cannot find input file with subdomains information. It is ok if you are not creating subdomains from file.&lt;br&gt;<br />
Tip: leave field empty to use default value you have specified in the script&#8217;s code.&lt;br&gt;<br />
&lt;form method=&#8217;post&#8217;&gt;<br />
Subdomain:&lt;input name=&#8217;subdomain&#8217;&gt;&lt;br&gt;<br />
Domain:&lt;input name=&#8217;domain&#8217;&gt;&lt;br&gt;<br />
cPanel User:&lt;input name=&#8217;cpaneluser&#8217;&gt;&lt;br&gt;<br />
cPanel Password:&lt;input name=&#8217;cpanelpass&#8217;&gt;&lt;br&gt;<br />
cPanel Skin:&lt;input name=&#8217;cpanelskin&#8217;&gt;&lt;br&gt;<br />
&lt;input type=&#8217;submit&#8217; value=&#8217;Create Subdomain&#8217; style=&#8217;border:1px solid black&#8217;&gt;<br />
&lt;/form&gt;&#8221;;<br />
die();<br />
}<br />
}</p>
<p>// create subdomain<br />
function subd($host,$port,$ownername,$passw,$request) {</p>
<p>$sock = fsockopen(&#8216;localhost&#8217;,2082);<br />
if(!$sock) {<br />
print(&#8216;Socket error&#8217;);<br />
exit();<br />
}</p>
<p>$authstr = &#8220;$ownername:$passw&#8221;;<br />
$pass = base64_encode($authstr);<br />
$in = &#8220;GET $request\r\n&#8221;;<br />
$in .= &#8220;HTTP/1.0\r\n&#8221;;<br />
$in .= &#8220;Host:$host\r\n&#8221;;<br />
$in .= &#8220;Authorization: Basic $pass\r\n&#8221;;<br />
$in .= &#8220;\r\n&#8221;;</p>
<p>fputs($sock, $in);<br />
while (!feof($sock)) {<br />
$result .= fgets ($sock,128);<br />
}<br />
fclose( $sock );</p>
<p>return $result;<br />
}</p>
<p>foreach($doms as $dom) {<br />
$lines = explode(&#8216;;&#8217;,$dom);<br />
if (count($lines) == 2) {<br />
// domain and subdomain passed<br />
$domain = trim($lines[0]);<br />
$subd = trim($lines[1]);<br />
}<br />
else {<br />
// only subdomain passed<br />
$domain = getVar(&#8216;domain&#8217;, DOMAIN);<br />
$subd = trim($lines[0]);<br />
}<br />
// <a href="http://[domainhere]:2082/frontend/x/subdomain/doadddomain.html?domain=[subdomain">http://[domainhere]:2082/frontend/x/subdomain/doadddomain.html?domain=[subdomain</a> here]&amp;rootdomain=[domain here]<br />
$request = &#8220;/frontend/$cpanel_skin/subdomain/doadddomain.html?rootdomain=$domain&amp;domain=$subd&#8221;;<br />
$result = subd(&#8216;localhost&#8217;,2082,$cpaneluser,$cpanelpass,$request);<br />
$show = strip_tags($result);<br />
echo $show;<br />
}</p></blockquote>
<p>?&gt;</p>
<p>I already tried the code, and its does really good job!</p>
<p>But, from my point of view, some changes is needed to re-amend the code, since the visitor who want to register need to fill some information that only you know such..</p>
<p><strong>Input:<br />
</strong></p>
<ul>
<li>cPanel account username</li>
<li>cPanel account password</li>
<li>cPanel skin (see <a title="Determining your cPanel Theme/Skin" href="http://www.zubrag.com/articles/determine-cpanel-skin.php">Determining your cPanel Theme/Skin</a> for more info on how to determine cPanel skin)</li>
</ul>
<p>Of course you will not give the valuable information to the visitor (your cPanel Username &amp; Password)&#8230;.</p>
<p>Well, after you downloaded &amp; run the script, you will know what i meant&#8230;.</p>
<p>But this code is totally awsome!</p>
<p>Thanx to <a href="http://www.zubrag.com" target="_blank">http://www.zubrag.com</a>, its real nice!it has been a long wait till i could find this code..~!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mohdazam.com/giving-free-webhosting-on-cpanel-based-hosting/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
