<?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>huanix &#187; HTML formatting</title>
	<atom:link href="http://www.huanix.com/category/html-formatting/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.huanix.com</link>
	<description>chown -R huanix /</description>
	<lastBuildDate>Sat, 31 Dec 2011 14:53:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>mod_rewrite for Apache2 in Ubuntu Feisty Fawn 7.04</title>
		<link>http://www.huanix.com/2007/04/18/mod_rewrite-for-apache2-in-ubuntu-feisty-fawn-704/</link>
		<comments>http://www.huanix.com/2007/04/18/mod_rewrite-for-apache2-in-ubuntu-feisty-fawn-704/#comments</comments>
		<pubDate>Thu, 19 Apr 2007 00:29:05 +0000</pubDate>
		<dc:creator>huanix</dc:creator>
				<category><![CDATA[Apache2]]></category>
		<category><![CDATA[HTML formatting]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.huanix.com/index.php/2007/04/18/mod_rewrite-for-apache2-in-ubuntu-feisty-fawn-704/</guid>
		<description><![CDATA[mod_rewrite is a module for the Apache webserver that allows apache to dynamically change the url of a site using php (or other scripting languages). It seems like a difficult/confusing task at first, but it actually only takes 2 steps in Ubuntu. I&#8217;m using Feisty Fawn, 7.04, but this should work well for Edgy and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.penguin-soft.com/penguin/man/8/a2enmod.html">mod_rewrite</a> is a module for the <a href="http://apache.org/httpd">Apache webserver</a> that allows apache to dynamically change the url of a site using php (or other scripting languages). It seems like a difficult/confusing task at first, but it actually only takes 2 steps in <a href="http://ubuntu.com">Ubuntu</a>. I&#8217;m using Feisty Fawn, 7.04, but this should work well for Edgy and Dapper without any issues. Any code snippets should be typed into a terminal. &#8220;sudo&#8221; commands require a password, that&#8217;s a given.</p>
<ol>
<li>Enable mod_rewrite in Apache<br />
<code> sudo a2enmod rewrite </code></li>
<li>Edit the configuration file.
<ol>
<li><code>sudo gedit  /etc/apache2/sites-available/default </code></li>
<li>line 12 says &#8220;AllowOverride none&#8221; ;</li>
<li>change it to &#8220;AllowOverride all&#8221;</li>
<li>save and close</li>
</ol>
</li>
<li>Okay&#8230; one last step &#8212; you have to manually restart Apache (or restart your computer!)</li>
<p><code>sudo apache2 -k restart </code></ol>
<p>All done! now Apache and php can create URL&#8217;s on the fly &#8211; pretty neato!</p>
<h4>Incoming search terms:</h4><ul><li>a2enmod mod_rewrite</li><li>ubuntu apache2 mod_rewrite</li><li>Ubuntu php mod_rewrite</li><li>UBUNTU APACHE2 REWRITE</li><li>mod_rewrite apache2</li><li>ubuntu apache mod rewrite</li><li>php mod_rewrite ubuntu</li><li>apache2 mod_rewrite ubuntu</li><li>mod_rewrite a2enmod</li><li>enable mod_rewrite apache2 ubuntu</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.huanix.com/2007/04/18/mod_rewrite-for-apache2-in-ubuntu-feisty-fawn-704/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
		<item>
		<title>Recovering lost POST data</title>
		<link>http://www.huanix.com/2006/12/30/recovering-lost-post-data/</link>
		<comments>http://www.huanix.com/2006/12/30/recovering-lost-post-data/#comments</comments>
		<pubDate>Sun, 31 Dec 2006 04:24:27 +0000</pubDate>
		<dc:creator>huanix</dc:creator>
				<category><![CDATA[HTML formatting]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.huanix.com/?p=16</guid>
		<description><![CDATA[I just spent an hour writing a post (on another website) that was very meaningful to me, but it took me quite some time to write it. When I pressed the submit button, I was informed that my session had timed out, and as a natural consequence, my post was GONE. I am so incredibly [...]]]></description>
			<content:encoded><![CDATA[<p>I just spent an hour writing a post (on another website) that was very meaningful to me, but it took me quite some time to write it. When I pressed the submit button, I was informed that my session had timed out, and as a natural consequence, my post was GONE. I am so incredibly frustrated, but I see an opportunity to create a simple POST dump tool that one might use to recover the input before giving up.</p>
<p>My idea is that your [my] local computer retains the POST encoded url for at least one resubmit (When you see a popup that says, &#8220;This page contains post data, do you wish to resubmit&#8230;&#8221;). That opportunity could be used to implement a tool to dump the data somewhere else for future reference.. more to come!</p>
<h4>Incoming search terms:</h4><ul><li>how to recover lost post data</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.huanix.com/2006/12/30/recovering-lost-post-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wizpy?</title>
		<link>http://www.huanix.com/2006/11/24/wizpy/</link>
		<comments>http://www.huanix.com/2006/11/24/wizpy/#comments</comments>
		<pubDate>Sat, 25 Nov 2006 02:03:35 +0000</pubDate>
		<dc:creator>huanix</dc:creator>
				<category><![CDATA[HTML formatting]]></category>

		<guid isPermaLink="false">http://www.huanix.com/?p=9</guid>
		<description><![CDATA[I am becoming very frustrated with my ISP, Charter &#8211; I have lost my IP 3 times tonight &#8211; my hardware has been stable, so I can only assume they are to blame. This is post attempt 4! Tonight&#8217;s post will be several snippets: I believe I figured out the error with Xubuntu and Xarchiver [...]]]></description>
			<content:encoded><![CDATA[<p><strong>I am becoming very frustrated with my ISP, Charter &#8211; I have lost my IP 3 times tonight &#8211; my hardware has been stable, so I can only assume they are to blame. This is post attempt 4!</strong></p>
<p>Tonight&#8217;s post will be several snippets:</p>
<p>I believe I figured out the error with  Xubuntu and Xarchiver &#8211; Xarchiver complained that several archives I was trying to open were invalid, even though they were .tar.gz. After fooling around with it for awhile, I tried:</p>
<p><code> # file [downloaded_file].tar.gz</code></p>
<p>HTML text document</p>
<p>ah HAH! the return called it a text document  &#8211; the provider delivered it erroneously! After this discovery, I went looking for a valid copy of the geshi syntax highlighter for PHP in WordPress. <a href="http://www.thedevproject.com/projects/wordpress-geshi-plugin/" target="_blank">The DEV project</a> had what appeared to be the most reliable version  -we&#8217;ll see at the completion of my post!</p>
<p>On a TOTALLY unrelated note, I saw a story on <a href="http://www.digg.com" target="_blank">DIGG</a> today about the <a href="http://www.neoseeker.com/news/story/6313/" target="_blank">Wizpy</a>.. I don&#8217;t know much about it, but I have to have one.</p>
<p>(I forgot to enable geshi from the backend.. so I still don&#8217;t know if it works!)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.huanix.com/2006/11/24/wizpy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTTP_REFERER and HTML formatting (NOT HTTP_REFERRER )</title>
		<link>http://www.huanix.com/2006/11/21/http_referrer-and-html-formatting/</link>
		<comments>http://www.huanix.com/2006/11/21/http_referrer-and-html-formatting/#comments</comments>
		<pubDate>Wed, 22 Nov 2006 04:25:36 +0000</pubDate>
		<dc:creator>huanix</dc:creator>
				<category><![CDATA[HTML formatting]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.huanix.com/?p=6</guid>
		<description><![CDATA[I am sort of beginning to realize that I can get better site information from using PHP $_SERVER calls than by using the AWstats page. I discovered this because I built a &#8220;fake&#8221; login page at my direct IP address so I could distract people who portscan onto my server &#8211; the page looks like [...]]]></description>
			<content:encoded><![CDATA[<p>I am sort of beginning to realize that I can get better site information from using PHP $_SERVER calls than by using the AWstats page. I discovered this because I built a &#8220;fake&#8221; login page at my direct IP address so I could distract people who portscan onto my server  &#8211; the page looks like a login, but it&#8217;s really just a fake form that continually says the credentials are invalid. To make it more interesting, I wrote some PHP/MySQL to collect some data about my stumblers. As expected, most of them are coming from an IP similar to mine (port scanning), and none of them have actually supplied input to the login &#8211; though nearly all of them press &#8220;login&#8221; to check for a blank login ability. I will probably share a link to the fake login when i get around to writing a quick front-end for it. I always like to dial-back to ip&#8217;s that port scan me, and a simple php front end would make that easy.</p>
<p>Anyway &#8211; writing that gave me the idea to write a Apache2 include for tracking visitors &#8211; i LOVE the <a target="_blank" href="http://us2.php.net/reserved.variables">$_SERVER['HTTP_REFERER']</a> element, and I will have fun just toying with it. Here&#8217;s a short explanation how I did it:</p>
<p>First, set up  a database and table, then add a user on MySql:</p>
<blockquote><p># mysql -u root<br />
# create database  login;<br />
# create user login identified by &#8216;password&#8217;;<br />
# grant insert on login.* to login;</p></blockquote>
<p>This user will only be able to add data to the database, and because he hasn&#8217;t been granted &#8220;select&#8221; privileges, he won&#8217;t [easily] be able to see what he inserted.</p>
<p>Now set up the table using MySQL. You can do this from the root account if you choose:</p>
<blockquote><p>CREATE TABLE `login` (<br />
`count` int(11) NOT NULL auto_increment,<br />
`username` varchar(64) default NULL,<br />
`password` varchar(64) default NULL,<br />
`IP` varchar(20) default NULL,<br />
`refer` varchar(256) default NULL,<br />
PRIMARY KEY  (`count`));</p></blockquote>
<p>The fields are &#8220;count&#8221; it&#8217;s just a simple primary key, &#8220;username&#8221; will take the value the  user passes ,  &#8220;password&#8221; takes the password they passed &#8211;  if this were a real  password form that would  be an encrypted value &#8211;  but this is just a  toy to see what  values people will  attempt to pass to a login that they don&#8217;t own. &#8220;IP&#8221; will take the  $_SERVER['REMOTE_ADDR'] element, and &#8220;refer&#8221; takes the  $_SERVER['HTTP_REFERER'] element.<br />
Finally, you&#8217;ll write a form and a simple PHP page to take some variables and insert them into the database &#8211; here&#8217;s what I used:</p>
<p>##Add your css here if you want<br />
title>  /title> \ form method=&#8221;post&#8221; action=&#8221;?php echo $_SERVER['PHP_SELF']; ?>&#8221;>  label for=&#8221;username&#8221;>Username<br />
input type=&#8221;text&#8221; id=&#8221;username&#8221; name=&#8221;username&#8221; /><br />
label for=&#8221;password&#8221;>Password<br />
input type=&#8221;password&#8221; id=&#8221;password&#8221; name=&#8221;password&#8221; /><br />
input type=&#8221;submit&#8221; value=&#8221;log in&#8221; name=&#8221;submit&#8221; /><br />
$username = $_POST['username'];<br />
$password = $_POST['password'];<br />
$IP = $_SERVER['REMOTE_ADDR'];<br />
$refer = $_SERVER['HTTP_REFERER'];</p>
<p>if($db = @mysqli_connect(&#8216;localhost&#8217;, &#8216;USERNAME&#8217;, &#8216;PASSWORD&#8217;)) {<br />
mysqli_select_db($db, &#8216;login&#8217;);<br />
$query= &#8220;insert into login (username, password, IP, refer) values (&#8216;$username&#8217;, &#8216;$password&#8217;, &#8216;$IP&#8217;, &#8216;$refer&#8217;)&#8221;;<br />
mysqli_query($db, $query);<br />
mysqli_close($db);<br />
}else{<br />
echo &#8220;The db could not connect.&#8221;;}</p>
<p>if(isset($password)){<br />
echo &#8216;Your credentials failed.&#8217;;<br />
};<br />
?</p>
<p>That is really just gross. No kidding. It&#8217;s awful &#8211; I just started using wordpress and I have discovered that I&#8217;ll have to work on an effective way to share code, or at least learn how WordPress handles it. I do apolgize for the ugliness &#8211; hopefully it conveys the big picture!<br />
I have a confession. I suck at HTML formatting. I think it&#8217;s a failure to learn rather than a failure of creativity. At very point i am struggling with the layout of two tables on www.sl7pm.com that don&#8217;t even need to exist. I think I&#8217;m going to cruise over to amazon and pick up a good book on web2.0 formatting. My logical brain tells me that means using more CSS and XML, but my creative brain tells me it means making things look attractive.. and I know from my own experience that ugly sites aren&#8217;t sticky!</p>
<p>I am still using the 1999 &#8220;tables&#8221; style of formatting.. which i think is awesome for displaying database results, but needs to go out the door for attractive and functional web design.<br />
The title? I spent a good 5 minutes mis-spelling referer before i realized what  a goober i was. I thought i&#8217;d add that as a beacon to those who are still mispelling it!</p>
<h4>Incoming search terms:</h4><ul><li>html HTTP_REFERER</li><li>rde-dm:include referrer</li><li>android not http_referer</li><li>get http_referer html</li><li>http referer in html</li><li>http_referer html</li><li>http_referrer html</li><li>why http_referer not http_referrer</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.huanix.com/2006/11/21/http_referrer-and-html-formatting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

