<?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; php</title>
	<atom:link href="http://www.huanix.com/category/php/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>iTunes 8 running natively in Ubuntu 8.10 with Wine</title>
		<link>http://www.huanix.com/2008/11/07/itunes-8-running-natively-in-ubuntu-810-with-wine/</link>
		<comments>http://www.huanix.com/2008/11/07/itunes-8-running-natively-in-ubuntu-810-with-wine/#comments</comments>
		<pubDate>Sat, 08 Nov 2008 03:17:15 +0000</pubDate>
		<dc:creator>huanix</dc:creator>
				<category><![CDATA[geek]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[iTunes]]></category>
		<category><![CDATA[jailbreak]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[wine]]></category>

		<guid isPermaLink="false">http://www.huanix.com/?p=209</guid>
		<description><![CDATA[Here&#8217;s a screenshot of iTunes 8 running on Ubuntu 8.10 Intrepid Ibex: wine-116-itunes-no-devices.sh (right-click the link to download this script) to run it: save the script to your desktop or home folder open a terminal (Applications &#62; Accessories &#62; Terminal), navigate to the same directory as the script. type: chmod 777 wine-116-itunes-no-devices.sh (hit enter) then [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">Here&#8217;s a screenshot of iTunes 8 running on Ubuntu 8.10 Intrepid Ibex:</p>
<p style="text-align: center;"><a href="http://www.huanix.com/wp-content/uploads/2008/11/itunes_ubuntu.jpg"><img class="aligncenter size-thumbnail wp-image-212" title="itunes_ubuntu" src="http://www.huanix.com/wp-content/uploads/2008/11/itunes_ubuntu-150x150.jpg" alt="" width="150" height="150" /></a></p>
<p style="text-align: center;"><strong><a href="http://www.huanix.com/wp-content/uploads/2008/11/wine-116-itunes-no-devices.sh">wine-116-itunes-no-devices.sh</a></strong><br />
(right-click the link to download this script)</p>
<p style="text-align: left;"><strong>to run it:</strong><br />
save the script to your desktop or home folder<br />
open a terminal (Applications &gt; Accessories &gt; Terminal), navigate to the same directory as the script.<br />
type: chmod 777 wine-116-itunes-no-devices.sh (hit enter)<br />
then type: ./wine-116-itunes-no-devices.sh (hit enter)</p>
<p>This script will build a custom version of wine 1.1.6 that will run iTunes 8.0.1 on Ubuntu 8.10. The resulting installation of wine will *NOT* (?) recognize iPhones or iPods. This installation will <strong>NOT</strong> conflict with your existing wine installation &#8211; it is separate!!!</p>
<p>Expect to download 500+ mb of stuff and compile for 2+ hours. I may find a way to simplify it later, but my goal now is to get it working reliably and predictably for everyone running Ubuntu 8.10.</p>
<p>Please leave detailed feedback including your operating system and version of iTunes as well as other information (i expect people to try lots of different things). &#8220;it worked&#8221; or &#8220;it didn&#8217;t work&#8221; are not useful comments!!<br />
As far as getting devices to work, my best shot was Marteen  Lankhorst&#8217;s rejected patches (<a title="http://www.winehq.org/pipermail/wine-patches/2008-May/054483.html" href="http://www.winehq.org/pipermail/wine-patches/2008-May/054483.html" target="_blank">http://www.winehq.org/pipermail/wine-patches/2008-May/054483.html</a>), but i haven&#8217;t gotten them to work with iTunes 8 (not sure why). Just in case you weren&#8217;t clear: This version WILL run iTunes 8, but it will NOT recognize your iPod/iPhone.  My current solution for that is with VirtualBox: <a title="http://www.huanix.com/2008/11/03/fixing-usb-on-virtualbox-to-allow-iphone-sync-with-an-ubuntu-host-running-windows-xp/" href="http://www.huanix.com/2008/11/03/fixing-usb-on-virtualbox-to-allow-iphone-sync-with-an-ubuntu-host-running-windows-xp/" target="_self">http://www.huanix.com/2008/11/03/fixing-usb-on-virtualbox-to-allow-iphone-sync-with-an-ubuntu-host-running-windows-xp/</a></p>
<p><strong>For the latest developments on this, go to the wiki at : <a title="http://www.huanix.com/sync-in-linux/index.php/ITunes_8_through_modified_Wine" href="http://www.huanix.com/sync-in-linux/index.php/ITunes_8_through_modified_Wine">http://www.huanix.com/sync-in-linux/index.php/ITunes_8_through_modified_Wine</a></strong></p>
<h4>Incoming search terms:</h4><ul><li>itunes ubuntu</li><li>UBUNTU ITUNES</li><li>Wine ubuntu</li><li>ubuntu wine</li><li>itunes wine iphone</li><li>itunes ubuntu wine</li><li>itunes on ubuntu</li><li>itunes for ubuntu</li><li>ubuntu itunes wine</li><li>ubuntu itunes iphone</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.huanix.com/2008/11/07/itunes-8-running-natively-in-ubuntu-810-with-wine/feed/</wfw:commentRss>
		<slash:comments>57</slash:comments>
		</item>
		<item>
		<title>MythTV setup for IPTV through fiberoptic connection</title>
		<link>http://www.huanix.com/2008/06/27/mythtv-setup-for-iptv-through-fiberoptic-connection/</link>
		<comments>http://www.huanix.com/2008/06/27/mythtv-setup-for-iptv-through-fiberoptic-connection/#comments</comments>
		<pubDate>Sat, 28 Jun 2008 04:16:24 +0000</pubDate>
		<dc:creator>huanix</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.huanix.com/?p=122</guid>
		<description><![CDATA[I&#8217;ve spent the last several hours trying to configure mythtv (Mythbuntu and Knoppmyth) to record my incoming IPTV stream. I haven&#8217;t had any success yet, but let me give you my details and hopefully we&#8217;ll figure something out. I have a fiberoptic to the home (FTTH) internet connection, and with that comes IPTV. The IPTV [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve spent the last several hours trying to configure mythtv (Mythbuntu and Knoppmyth) to record my incoming IPTV stream. I haven&#8217;t had any success yet, but let me give you my details and hopefully we&#8217;ll figure something out.</p>
<p>I have a fiberoptic to the home (FTTH) internet connection, and with that comes IPTV. The IPTV is run through Amino 125 STB&#8217;s running Kasenna middleware.</p>
<p>The Amino box is accessible through Telnet. It&#8217;s not difficult to connect &#8211; I may elaborate later, but once you get the ip of the box, you can use<br />
telnet [ip to box]<br />
login: root<br />
password: root2root</p>
<p>Inside the box is a basic linux directory system and a pretty extensive busybox implementation (Busybox offers basic GNU commands without a complete linux install).</p>
<p>My current issue is an inability to connect my mythtv installation to the IPTV network. I can spoof a MAC from one of the amino boxes using a &#8220;hw address&#8221; call added to the init script. (more later if you need it).</p>
<p>The problem is that the amino box uses specific network paramaters to request DHCP and I&#8217;m having trouble (lots of trouble) getting them right. I telnetted into a running box and set a static interface to mimic the directives (bcast, address, netmask) (I did not specify gateway as I can&#8217;t find it again &#8211; though I did see it in the config files on the STB).</p>
<p>The bonus is that the config files are all available in simple config scripts available on the STB. If I pull it off the closed Kasenna network I can give it my own DHCP and explore it all day long.</p>
<p>There is a LOT of info on the VLC forums about using these boxes, but like I said, I&#8217;m not interested in the box, I&#8217;m interested in connecting myth to the iptv stream.</p>
<p>I&#8217;m going to add a directory listing of the rc.d files to try to attract some traffic to what I&#8217;m doing. If I can find even one person to commit to working with me, I&#8217;ll be glad to set up a wiki and do some in-depth documentation.</p>
<p>./init.d:<br />
drwxr-xr-x    5 root     root            0 Jan  1  1970 .<br />
drwxr-xr-x    7 root     root            0 Jan  1 00:00 ..<br />
drwxr-xr-x    2 root     root            0 Jan  1  1970 CVS<br />
-rwxr-xr-x    1 root     root          319 Jan  1  1970 mountscript<br />
-rwxr-xr-x    1 root     root          989 Jan  1  1970 rc<br />
-rwxr-xr-x    1 root     root          922 Jan  1  1970 rc.STBremoteconf<br />
-rwxr-xr-x    1 root     root          323 Jan  1  1970 rc.ami_wm<br />
-rwxr-xr-x    1 root     root          276 Jan  1  1970 rc.av_router<br />
-rwxr-xr-x    1 root     root         1124 Jan  1  1970 rc.bootmcastbootd<br />
-rwxr-xr-x    1 root     root          475 Jan  1  1970 rc.ca_app<br />
-rwxr-xr-x    1 root     root          493 Jan  1  1970 rc.ca_kmod<br />
-rwxr-xr-x    1 root     root         3503 Jan  1  1970 rc.checkforupgrade<br />
-rwxr-xr-x    1 root     root          483 Jan  1  1970 rc.cookies<br />
-rwxr-xr-x    1 root     root          566 Jan  1  1970 rc.daemon_app<br />
-rwxr-xr-x    1 root     root          454 Jan  1  1970 rc.davincistb_gfx<br />
-rwxr-xr-x    1 root     root          338 Jan  1  1970 rc.davincistb_os_core<br />
-rwxr-xr-x    1 root     root          613 Jan  1  1970 rc.dvbttx<br />
-rwxr-xr-x    1 root     root        11009 Jan  1  1970 rc.ethernet<br />
-rwxr-xr-x    1 root     root           94 Jan  1  1970 rc.final<br />
-rwxr-xr-x    1 root     root          831 Jan  1  1970 rc.finalise_upgrade<br />
-rwxrwxr-x    1 root     root          481 Jan  1  1970 rc.gpio_driver<br />
-rwxr-xr-x    1 root     root         1166 Jan  1  1970 rc.ir_driver<br />
-rwxr-xr-x    1 root     root          662 Jan  1  1970 rc.js_management_pages<br />
-rwxr-xr-x    1 root     root          499 Jan  1  1970 rc.linkstate<br />
-rwxr-xr-x    1 root     root          302 Jan  1  1970 rc.norflash_driver<br />
-rwxr-xr-x    1 root     root         2335 Jan  1  1970 rc.ntpclient<br />
-rwxr-xr-x    1 root     root          338 Jan  1  1970 rc.opera<br />
-rwxr-xr-x    1 root     root          689 Jan  1  1970 rc.osk<br />
-rwxr-xr-x    1 root     root          558 Jan  1  1970 rc.remote_login<br />
-rwxr-xr-x    1 root     root          499 Jan  1  1970 rc.smartcard<br />
-rwxr-xr-x    1 root     root          288 Jan  1  1970 rc.telnetd<br />
-rwxr-xr-x    1 root     root          450 Jan  1  1970 rc.tira<br />
-rwxr-xr-x    1 root     root         1456 Jan  1  1970 rc.tistb_av_core<br />
drwxr-xr-x    2 root     root            0 Jan  1  1970 rc3.d<br />
drwxr-xr-x    2 root     root            0 Jan  1  1970 rc5.d<br />
-rwxr-xr-x    1 root     root          743 Jan  1  1970 rcS</p>
<p>Your comments and help are appreciated.</p>
<p>Config (Testing):<br />
1. Set the mythtv MAC to an Amino mac: &#8220;ifconfig eth0 inet hw ether ##:##:MA:C#:## up&#8221; (you will have to take the network down first.</p>
<h4>Incoming search terms:</h4><ul><li>mythtv iptv</li><li>STBremoteconf</li><li>mythbuntu iptv</li><li>iptv mythtv</li><li>stbremoteconf download</li><li>mythtv iptv setup</li><li>amino mythtv</li><li>verimatrix mythtv</li><li>myth tv iptv</li><li>setup iptv in mythtv</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.huanix.com/2008/06/27/mythtv-setup-for-iptv-through-fiberoptic-connection/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>The best CMS for 2007?</title>
		<link>http://www.huanix.com/2007/06/04/the-best-cms-for-2007/</link>
		<comments>http://www.huanix.com/2007/06/04/the-best-cms-for-2007/#comments</comments>
		<pubDate>Mon, 04 Jun 2007 13:21:43 +0000</pubDate>
		<dc:creator>huanix</dc:creator>
				<category><![CDATA[Apache2]]></category>
		<category><![CDATA[CMS]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.huanix.com/2007/06/04/the-best-cms-for-2007/</guid>
		<description><![CDATA[I&#8217;m very new to the concept of using a CMS to publish a community website, so I&#8217;ve been doing some research to find the best and most current free Content Management System. The first valuable resource I found is wikipedia&#8217;s list of CMS&#8217;s, which is initially impressive, but I quickly found it overwhelming. To be [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m very new to the concept of using a CMS to publish a community website, so I&#8217;ve been doing some research to find the best and most current free Content Management System.</p>
<p>The first valuable resource I found is <a href="http://en.wikipedia.org/wiki/List_of_content_management_systems">wikipedia&#8217;s list of CMS&#8217;s</a>, which is initially impressive, but I quickly found it overwhelming. To be perfectly honest, I don&#8217;t feel like sorting through a list of hundreds of CMS&#8217;s, I want a CMS that meets two sets of criteria: One, it has to meet my platform preferences, and two, it has to be in current cutting-edge development.</p>
<p>My platform preferences:</p>
<ul>
<li>Linux 2.6</li>
<li>Apache 2.2</li>
<li>PHP 5</li>
<li>Mysql 5</li>
</ul>
<p>My development preferences:</p>
<ul>
<li>GNU license</li>
<li>In development 2+ years</li>
<li>The most downloads from <a href="http://www.sourceforge.net">Sourceforge</a>.</li>
<li>The site with the highest traffic on <a href="http://www.alexa.com">Alexa</a>.</li>
</ul>
<p>While I have yet to document my results, which I plan to share later on this blog, the winner appears to be <a href="http://www.joomla.org">Joomla!</a>. The only drawback to this point is that it does appear to require patience in implementation, something I lack! I spent a couple hours with it recently, and while I was impressed with it&#8217;s capability, I realized it would take signifcant experience to make it jump through the hoops I have in mind.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.huanix.com/2007/06/04/the-best-cms-for-2007/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>creating web pages in c</title>
		<link>http://www.huanix.com/2007/05/20/creating-web-pages-in-c/</link>
		<comments>http://www.huanix.com/2007/05/20/creating-web-pages-in-c/#comments</comments>
		<pubDate>Mon, 21 May 2007 02:10:27 +0000</pubDate>
		<dc:creator>huanix</dc:creator>
				<category><![CDATA[Apache2]]></category>
		<category><![CDATA[C programming]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.huanix.com/2007/05/20/creating-web-pages-in-c/</guid>
		<description><![CDATA[I wrote my first cgi script today.. it actually sounds pretty juvenile now that i say it out loud. here it is&#8230; ( i really need to read the geshi docs so i can format this properly!) #include int main(){ std::cout &#60;&#60;"Content-Type: text/html&#60;html&#62;\n\n "; std::cout &#60;&#60; "text."; std::cout &#60;&#60; "&#60;/html&#62;"; return 0; } Anyway, it [...]]]></description>
			<content:encoded><![CDATA[<p>I wrote my first cgi script today.. it actually sounds pretty juvenile now that i say it out loud.</p>
<p>here it is&#8230; ( i really need to read the geshi docs so i can format this properly!)</p>
<p><code language="cpp"><br />
#include <iostream></iostream><br />
int main(){<br />
std::cout &lt;&lt;"Content-Type: text/html&lt;html&gt;\n\n  ";<br />
std::cout &lt;&lt; "text.";<br />
std::cout &lt;&lt; "&lt;/html&gt;";<br />
return 0;<br />
}</code></p>
<p>Anyway, it compiled pretty easily as a cgi script; getting it to run in apache took me a few minutes, as a matter of fact, i am afraid i hosed some stuff on this test system trying to get it working. I finally added<br />
<code language="html"><br />
Options +ExecCGI<br />
</code><br />
to the apache2 config file &#8212; in ubuntu, i actually modified the /etc/apache2/sites-available/default file, under the Directory /var/www tag.</p>
<p>This allowed me to run the cgi.. at least.. i tried 84 things, so I -think- that&#8217;s what finally worked <img src='http://www.huanix.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>tomorrow i&#8217;d like to try some post/get forms with c++, i write my forms with so much php that i&#8217;m not sure how i&#8217;ll do it with c.</p>
<p>btw &#8211; thanks to <a href="http://www.metalshell.com/view/source/127/">http://www.metalshell.com/view/source/127/</a> for the idea.</p>
<p><a href="http://www.huanix.com/wp-content/uploads/2007/05/text.png" title="a snapshot of the text site"><img src="http://www.huanix.com/wp-content/uploads/2007/05/text.thumbnail.png" alt="a snapshot of the text site" /></a><a href="http://www.huanix.com/wp-content/uploads/2007/05/sites-available.png" title="a snapshot of my /etc/apache2/sites-available/default file"><img src="http://www.huanix.com/wp-content/uploads/2007/05/sites-available.thumbnail.png" alt="a snapshot of my /etc/apache2/sites-available/default file" /></a><a href="http://www.huanix.com/wp-content/uploads/2007/05/sites-available.png" title="a snapshot of my /etc/apache2/sites-available/default file"> </a></p>
<p><a href="http://www.huanix.com/wp-content/uploads/2007/05/sites-available.png" title="a snapshot of my /etc/apache2/sites-available/default file"> </a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.huanix.com/2007/05/20/creating-web-pages-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>enable mod_rewrite apache2 ubuntu</li><li>mod_rewrite a2enmod</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>Dynamic Dependent Drop Down Select Forms using PHP, MySQL, and JavaScript</title>
		<link>http://www.huanix.com/2006/12/25/dynamic-dependent-drop-down-select-forms-using-php-mysql-and-javascript/</link>
		<comments>http://www.huanix.com/2006/12/25/dynamic-dependent-drop-down-select-forms-using-php-mysql-and-javascript/#comments</comments>
		<pubDate>Mon, 25 Dec 2006 21:39:53 +0000</pubDate>
		<dc:creator>huanix</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.huanix.com/?p=15</guid>
		<description><![CDATA[I knew it was possible to create a dynamic dependent drop down form using PHP, MySQL, and JavaScript, but I had never had an excuse to use one before my Christmas-break project. I have always thought the forms were neat &#8211; like when you select a Country and the next drop-down automagically displays the states [...]]]></description>
			<content:encoded><![CDATA[<p>I knew it was possible to create a dynamic dependent drop down form using PHP, MySQL, and JavaScript, but I had never had an excuse to use one before my Christmas-break project. I have always thought the forms were neat &#8211; like when you select a Country and the next drop-down automagically displays the states from that country. These are also referred to as drill down menus.<br />
It&#8217;s &#8220;family time&#8221;, so I&#8217;m building a basic inventory control system for the school I work at, and one of the basic goals is that users would select their &#8220;hardware type&#8221; (tv, pc computer, mac computer, laptop, etc.) and subsequently select the model # from a list rather than entering it manually. In addition, an administrator has the option to add both hardware types and models to the list at his/her discretion.</p>
<p>All of these things require a dynamic dependent drop down list. I found several resources for completing this task, and after several hours of work, I got it to work using what I believe is the simplest method. You may be far more skilled than I am, and this may be a breeze for you, but I have very little knowledge of JavaScript, so I relied on PHP as much as possible.<br />
Many folks use DreamWeaver to create these menus &#8211; I am challenge-oriented, so all of my techniques refer to hand-coded methods.</p>
<p>The first and most highly regarded source for creating dependent dynamic drop downs is the <a href="http://www.mattkruse.com/javascript/dynamicoptionlist/">Matt Kruse method</a>, Matt has written an extensive JavaScript library that simplifies the entire dynamic dropdown task.. and it does, but because of my unfamiliarity with JavaScript, I had trouble adding the database through PHP.<br />
I was initially stoked about an AJAX method, and I found one at <a href="http://www.webmonkey.com/webmonkey/06/15/index3a_page2.html?tw=authoring">webmonkey</a>, but I am a novice to AJAX, and I couldn&#8217;t make it happen.<br />
I also tried <a href="http://www.codefixer.com/codesnippets/dynamically_dependent_dropdown_lists.asp">codefixer</a>, but after some struggling, I decided it wasn&#8217;t the method for me.</p>
<p>All of this to say, I did eventually find the magic, and it was relatively easy to use (if you add a trick). The source is at <a href="http://p2p.wrox.com/topic.asp?TOPIC_ID=17383">wrox</a>, and the trick I used to make it work was to create a simulated database using their structure, and slowly migrate it over to my setup. It worked really well, used a minimum of code, and does the job perfectly!</p>
<p><strong> Here is my cleaned up and working version of the script:<a href="http://www.huanix.com/files/dependent_select/dependent_select.php">http://www.huanix.com/files/dependent_select/dependent_select.php</a></strong></p>
<h4>Incoming search terms:</h4><ul><li>php dependent drop down list</li><li>dependent dropdown in php</li><li>dependent drop down list in php</li><li>php dependent drop down</li><li>dependent drop down php</li><li>dependent drop down list php</li><li>dependent dropdown php</li><li>php dependent dropdown</li><li>dependent dropdowns php</li><li>php mysql dynamic dropdown</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.huanix.com/2006/12/25/dynamic-dependent-drop-down-select-forms-using-php-mysql-and-javascript/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Exploit? Viewing unparsed PHP code on a remote server</title>
		<link>http://www.huanix.com/2006/12/10/exploit-viewing-unparsed-php-code-on-a-remote-server/</link>
		<comments>http://www.huanix.com/2006/12/10/exploit-viewing-unparsed-php-code-on-a-remote-server/#comments</comments>
		<pubDate>Sun, 10 Dec 2006 16:49:26 +0000</pubDate>
		<dc:creator>huanix</dc:creator>
				<category><![CDATA[Apache2]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Server]]></category>

		<guid isPermaLink="false">http://www.huanix.com/?p=14</guid>
		<description><![CDATA[I don&#8217;t know how well documented this hack is, but I dreamed it up while I was laying in bed last night, and tried it out this morning and it works. The hack requires that the target php file has been edited locally in the web directory of a linux server. Linux makes a hidden [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t know how well documented this hack is, but I dreamed it up while I was laying in bed last night, and tried it out this morning and it works. The hack requires that the target php file has been edited locally in the web directory of a linux server. Linux makes a hidden backup copy of the file by appending a tilde (~) to the file name, and leaves it in the directory as a hidden file. If you access a website with this file and append a ~ to the filename, i.e. &#8220;index.php~&#8221; you will be able to view the uninterpreted php code. This seems so trivial that I&#8217;m sure it has to be documented somewhere else, though I couldn&#8217;t find it &#8211; part of it has to do with the difficulty associated with searching for special characters, and the alternate use of the ~ (home directory). </p>
<p>I have three ideas to prevent the exploit:<br />
1. Edit the Apache config file to allow php to parse &#8220;php~&#8221; files.<br />
2. Write a cron job to remove temporary backup files from the web directory.<br />
3. Manually delete ~ files from the web directory, or don&#8217;t edit files on the server. </p>
<h4>Incoming search terms:</h4><ul><li>view unparsed php</li><li>unparsed php code</li><li>how to view unparsed php</li><li>unparsed php removed</li><li>un-parsed server code</li><li>tell server return unparsed php file</li><li>svn entries exploit tool</li><li>remoteviewphp howto</li><li>read uninterpreted php scripts</li><li>read php unparsed</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.huanix.com/2006/12/10/exploit-viewing-unparsed-php-code-on-a-remote-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Lamp Group &#8211; The CLAMPP</title>
		<link>http://www.huanix.com/2006/11/25/geshi-test/</link>
		<comments>http://www.huanix.com/2006/11/25/geshi-test/#comments</comments>
		<pubDate>Sat, 25 Nov 2006 13:22:31 +0000</pubDate>
		<dc:creator>huanix</dc:creator>
				<category><![CDATA[Apache2]]></category>
		<category><![CDATA[Clarksville]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[LAMPP]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.huanix.com/?p=10</guid>
		<description><![CDATA[Good news everyone! There&#8217;s a new Linux &#8211; type group in Clarksville, Tennessee. Check out the Clarksville Linux Apache MySQL PHP Perl group &#8211;CLAMPP I just wanted to test php highlighting in geshi]]></description>
			<content:encoded><![CDATA[<p>Good news everyone! There&#8217;s a new Linux &#8211; type group in Clarksville, Tennessee. Check out the Clarksville Linux Apache MySQL PHP Perl group &#8211;<a href="http://www.clampp.com">CLAMPP</a></p>
<p>I just wanted to test php highlighting in geshi</p>
<p><code lang="php"><?echo 'check out www.CLAMPP.com!'; ?> </code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.huanix.com/2006/11/25/geshi-test/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>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>

