<?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>TangoRangers.com's Blog</title>
	<atom:link href="http://blog.tangorangers.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.tangorangers.com</link>
	<description>Misc crap and such</description>
	<lastBuildDate>Sat, 21 Nov 2009 06:05:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Project: SSHT</title>
		<link>http://blog.tangorangers.com/2009/11/project-ssht/</link>
		<comments>http://blog.tangorangers.com/2009/11/project-ssht/#comments</comments>
		<pubDate>Sat, 21 Nov 2009 06:05:14 +0000</pubDate>
		<dc:creator>DaijoubuKun</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[ssht]]></category>

		<guid isPermaLink="false">http://blog.tangorangers.com/?p=231</guid>
		<description><![CDATA[SSHT is also known as Secure SHell Tracker. Think of it like a tracker for your ssh connections. I wrote it a long time ago to help keep track of all my connections. It has evolved a bit since then. As of this writing I&#8217;m at version 1.3. I know this program (more of a [...]]]></description>
			<content:encoded><![CDATA[<p>SSHT is also known as Secure SHell Tracker. Think of it like a tracker for your ssh connections. I wrote it a long time ago to help keep track of all my connections. It has evolved a bit since then. As of this writing I&#8217;m at version 1.3. I know this program (more of a script right now) could be useful to many Linux admins. The problem? It is hard to find. I&#8217;m trying to get on the list at Google if you type &#8220;ssh tracker.&#8221; Unfortunately it only works if you type &#8220;SSHT&#8221; or &#8220;Secure shell tracker.&#8221; I hope in the future I can get this script out to the wild for everyone to enjoy. Check it out at <a href="http://www.tangorangers.com/projects/ssht.php">TangoRangers.com.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tangorangers.com/2009/11/project-ssht/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ShopSavvy, Compare Everywhere, and SnapTell for Android</title>
		<link>http://blog.tangorangers.com/2009/10/shopsavvy-compare-everywhere-and-snaptell-for-android/</link>
		<comments>http://blog.tangorangers.com/2009/10/shopsavvy-compare-everywhere-and-snaptell-for-android/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 01:28:21 +0000</pubDate>
		<dc:creator>DaijoubuKun</dc:creator>
				<category><![CDATA[android]]></category>

		<guid isPermaLink="false">http://blog.tangorangers.com/?p=219</guid>
		<description><![CDATA[Some time ago I wrote that I was going to start writing regular reviews on cool apps for Android. Well I got side tracked. So today I&#8217;m going to talk about 3! ShopSavvy, Compate Everywhere, and SnapTell.
ShopSavvy and Compare Everywhere use the phone&#8217;s camera to scan barecodes! It&#8217;s pretty cool. I have both simply because [...]]]></description>
			<content:encoded><![CDATA[<p>Some time ago I wrote that I was going to start writing regular reviews on cool apps for Android. Well I got side tracked. So today I&#8217;m going to talk about 3! ShopSavvy, Compate Everywhere, and SnapTell.</p>
<p>ShopSavvy and Compare Everywhere use the phone&#8217;s camera to scan barecodes! It&#8217;s pretty cool. I have both simply because they both have their own different databases. For example, what I like to do is go to at my local super store and see what movies I would like. I always cringe when I see an older movie for $25 or more. That&#8217;s when I scan the barcode. Now I can see where to go to get the better deal. Keep in mind that the local portions don&#8217;t do very well all the time. This is by no fault of the program or it&#8217;s writers. It&#8217;s just the way things are.</p>
<p>Below are screen caps from both programs. Thinking back when I did those shots, I don&#8217;t know why I didn&#8217;t check the same product to see how the results differ.</p>
<p>First up, ShopSavvy. (Click on the picture to see the full size!)<br />
Picture Index:<br />
1. Main Screen.<br />
2. Scan the Barcode. See the Use Keyboard button. You can type in what you want to find!<br />
3. It found the book just fine.<br />
4. Two different local businesses were found.<br />
5. And a local map showing where to go.<br />
1<a href="http://www.tangorangers.com/files_blog/ShopSavy-Compare_Everywhere-and-SnapTell-for-Android/ShopSavvy_001.png"><img src="http://www.tangorangers.com/files_blog/ShopSavy-Compare_Everywhere-and-SnapTell-for-Android/thumb-ShopSavvy_001.png" alt="ShopSavy_1" /></a>&nbsp;&nbsp;2<a href="http://www.tangorangers.com/files_blog/ShopSavy-Compare_Everywhere-and-SnapTell-for-Android/ShopSavvy_002.png"><img src="http://www.tangorangers.com/files_blog/ShopSavy-Compare_Everywhere-and-SnapTell-for-Android/thumb-ShopSavvy_002.png" alt="ShopSavy_2" /></a>&nbsp;&nbsp;3<a href="http://www.tangorangers.com/files_blog/ShopSavy-Compare_Everywhere-and-SnapTell-for-Android/ShopSavvy_003.png"><img src="http://www.tangorangers.com/files_blog/ShopSavy-Compare_Everywhere-and-SnapTell-for-Android/thumb-ShopSavvy_003.png" alt="ShopSavy_3" /></a>&nbsp;&nbsp;4<a href="http://www.tangorangers.com/files_blog/ShopSavy-Compare_Everywhere-and-SnapTell-for-Android/ShopSavvy_004.png"><img src="http://www.tangorangers.com/files_blog/ShopSavy-Compare_Everywhere-and-SnapTell-for-Android/thumb-ShopSavvy_004.png" alt="ShopSavy_4" /></a>&nbsp;&nbsp;5<a href="http://www.tangorangers.com/files_blog/ShopSavy-Compare_Everywhere-and-SnapTell-for-Android/ShopSavvy_005.png"><img src="http://www.tangorangers.com/files_blog/ShopSavy-Compare_Everywhere-and-SnapTell-for-Android/thumb-ShopSavvy_005.png" alt="ShopSavy_5" /></a></p>
<p>Now I forgot to take a picture, but ShopSavvy will take you to the website where you can see more on the product and if you really want to you could buy it right away. That part is the same as the other programs.</p>
<p>Ok, so ShopSavvy is pretty cool. Now check out these pictures for Compare Everywhere:<br />
Picture Index:<br />
1. Main Screen<br />
2. Scan the Barcode<br />
3. Get your local and online store options.<br />
4. Just a scroll down from picture 3.<br />
5. Lets check these guys.<br />
6. Opened the browser and took me right there.<br />
1<a href="http://www.tangorangers.com/files_blog/ShopSavy-Compare_Everywhere-and-SnapTell-for-Android/Compare_Everywhere_001.png"><img src="http://www.tangorangers.com/files_blog/ShopSavy-Compare_Everywhere-and-SnapTell-for-Android/thumb-Compare_Everywhere_001.png" alt="Compare_Everywhere_1" /></a>&nbsp;&nbsp;2<a href="http://www.tangorangers.com/files_blog/ShopSavy-Compare_Everywhere-and-SnapTell-for-Android/Compare_Everywhere_002.png"><img src="http://www.tangorangers.com/files_blog/ShopSavy-Compare_Everywhere-and-SnapTell-for-Android/thumb-Compare_Everywhere_002.png" alt="Compare_Everywhere_2" /></a>&nbsp;&nbsp;3<a href="http://www.tangorangers.com/files_blog/ShopSavy-Compare_Everywhere-and-SnapTell-for-Android/Compare_Everywhere_003.png"><img src="http://www.tangorangers.com/files_blog/ShopSavy-Compare_Everywhere-and-SnapTell-for-Android/thumb-Compare_Everywhere_003.png" alt="Compare_Everywhere_3" /></a>&nbsp;&nbsp;4<a href="http://www.tangorangers.com/files_blog/ShopSavy-Compare_Everywhere-and-SnapTell-for-Android/Compare_Everywhere_004.png"><img src="http://www.tangorangers.com/files_blog/ShopSavy-Compare_Everywhere-and-SnapTell-for-Android/thumb-Compare_Everywhere_004.png" alt="Compare_Everywhere_4" /></a>&nbsp;&nbsp;5<a href="http://www.tangorangers.com/files_blog/ShopSavy-Compare_Everywhere-and-SnapTell-for-Android/Compare_Everywhere_005.png"><img src="http://www.tangorangers.com/files_blog/ShopSavy-Compare_Everywhere-and-SnapTell-for-Android/thumb-Compare_Everywhere_005.png" alt="Compare_Everywhere_5" /></a>&nbsp;&nbsp;6<a href="http://www.tangorangers.com/files_blog/ShopSavy-Compare_Everywhere-and-SnapTell-for-Android/Compare_Everywhere_006.png"><img src="http://www.tangorangers.com/files_blog/ShopSavy-Compare_Everywhere-and-SnapTell-for-Android/thumb-Compare_Everywhere_006.png" alt="Compare_Everywhere_6" /></a>&nbsp;&nbsp;</p>
<p>Not to bad so far right? Now I want to talk about SnapTell. If my memory serves me well, this app was originally written for the iphone, but it&#8217;s the same thing in the end. The difference here is that you take a picture of the movie, book, or what ever, and SnapTell tries the find you a match. As you will see in the pictures below, I took an alright picture of the book and SnapTell still figured it out very quickly.</p>
<p>Picture Index:<br />
1. The picture I took (This is an awesome book).<br />
2. The results.<br />
3. Took me right to the website I wanted.<br />
1<a href="http://www.tangorangers.com/files_blog/ShopSavy-Compare_Everywhere-and-SnapTell-for-Android/SnapTell_001.png"><img src="http://www.tangorangers.com/files_blog/ShopSavy-Compare_Everywhere-and-SnapTell-for-Android/thumb-SnapTell_001.png" alt="SnapTell_1" /></a>&nbsp;&nbsp;2<a href="http://www.tangorangers.com/files_blog/ShopSavy-Compare_Everywhere-and-SnapTell-for-Android/SnapTell_002.png"><img src="http://www.tangorangers.com/files_blog/ShopSavy-Compare_Everywhere-and-SnapTell-for-Android/thumb-SnapTell_002.png" alt="SnapTell_2" /></a>&nbsp;&nbsp;3<a href="http://www.tangorangers.com/files_blog/ShopSavy-Compare_Everywhere-and-SnapTell-for-Android/SnapTell_003.png"><img src="http://www.tangorangers.com/files_blog/ShopSavy-Compare_Everywhere-and-SnapTell-for-Android/thumb-SnapTell_003.png" alt="SnapTell_3" /></a></p>
<p>As you can see, all three of these programs are very cool. I use them quite often. Did you find an app like these and really like it? Let me know so I can share the information.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tangorangers.com/2009/10/shopsavvy-compare-everywhere-and-snaptell-for-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>An Interesting Conversation About Computer Security</title>
		<link>http://blog.tangorangers.com/2009/10/an-interesting-conversation-about-computer-security/</link>
		<comments>http://blog.tangorangers.com/2009/10/an-interesting-conversation-about-computer-security/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 01:19:22 +0000</pubDate>
		<dc:creator>DaijoubuKun</dc:creator>
				<category><![CDATA[good to know]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[secunia]]></category>
		<category><![CDATA[spyware]]></category>

		<guid isPermaLink="false">http://blog.tangorangers.com/?p=215</guid>
		<description><![CDATA[A few days ago I was with one of my good friends who owns a computer repair shop. I love going there because he always has something new and cool to show me (and I get to change to &#8220;geek out&#8221; for a bit), plus I like helping out so I don&#8217;t forget how to [...]]]></description>
			<content:encoded><![CDATA[<p>A few days ago I was with one of my good friends who owns a computer repair shop. I love going there because he always has something new and cool to show me (and I get to change to &#8220;geek out&#8221; for a bit), plus I like helping out so I don&#8217;t forget how to fix even the most basic computer problems. While there, a long time customer of his came in to pick up his computer and a very interesting conversation came up. The customer asked why his computer won&#8217;t stay clean after bringing it down to the shop.</p>
<p>It&#8217;s an interesting thing isn&#8217;t it? Why is it that we as admins and security experts and never seem to keep computers clean? Even the most skilled professionals can&#8217;t keep a computer clean. Well, it&#8217;s not our fault. There are so many security issues out there, and to be very blunt, the bad guys are always one step ahead of the security experts. Sometimes the good guys get a patch out (or publish the exploit) before the bad guys get a chance to exploit the security hole.</p>
<p>Unfortunately even when the good guys find the security hole before the bad guys there is the problem of getting the OS patched before someone becomes a victim. For example, a short time ago there was an ActiveX Draw exploit that affected millions of Windows PCs. Basically the bad guys somehow gained access to Google&#8217;s Adsence archive (and several other advertiser&#8217;s archives) and &#8220;infected&#8221; roughly 20% of the ads in the archive. I&#8217;m unsure of how the exploit functioned. I have heard everything from nothing to allowing someone to gain full control of your computer. Now, lets say for example that you visit a site, any site. You usually have two ads. One along the top and one down the side. So with one page view you have seen two ads. You click on something, new page, four ads have now been seen. You click again, six ads. Now you have reached the mark. There is a high probability you just saw one of the exploited ads. Whether you like it or not what you see in your web browser is also stored locally on your computer. No one was at fault with this (excluding the bad guys). Microsoft put out a patch after about a week of the exploit being known and Google fixed the hole allowing the bad guys to gain access to the Adsence servers. The problem now? Actually, two problems. One, some people are still making ads that are infected and trying to get them onto your computer. Two, there are still millions of computers that have not been updated.</p>
<p>There are always problems like this. I never like to blame any company directly unless they know of the issue but don&#8217;t bother fixing it. Other examples include more advanced techniques. You can gain access to a computer by sending certain information to it causing a hole to open temporarily.</p>
<p>The $1000 question is how do we keep out computer clean. Everyone has their own ways, but we came up with just a few basics. So if you run Windows try these out: Run <a href="http://www.mozilla.com">FireFox</a> instead of Internet Explore. Within FireFox get the extensions <a href="https://addons.mozilla.org/en-US/firefox/addon/1865">Adblock Plus</a> and <a href="https://addons.mozilla.org/en-US/firefox/addon/722">NoScript</a>. Make sure you have a good Virus Scanner and it&#8217;s up to date. Turn on Automatic Windows Updates and keep your Windows up to date. Get anti-spyware programs like <a href="http://www.lavasoft.com/">Adaware</a> (the free one is fine for me) and <a href="http://www.safer-networking.org/en/index.html">Spybot: Search and Destroy</a>. Make sure you have a firewall even if it&#8217;s the one built into Windows XP (or later), and lastly, be sure your not connected directly to the internet. Most ISPs will provide you with a modem or router, make sure you have a router even if it has the modem built in! It adds just that slight bit of extra protection.</p>
<p>Granted, those are just a few of the things you can do to keep your computer clean. I always recommend talking to an expert when wanting to try new software. If you feel your computer may not be clean find a &#8220;hole in the wall&#8221; style computer shop. Those are often the better choice compared to the larger companies. Ask questions to the shopkeep. Will they charge you even if they don&#8217;t fix the problem? Do they guarantee their work for at least 30 days? Will they wipe your computer&#8217;s hard drive or remove personal files without asking? Will they look at your personal files or web history? The best repair shops will answer honestly and quickly. Hesitation is a bad sign.</p>
<p>Lastly for all your Windows users out there. Get a program called <a href="http://secunia.com/vulnerability_scanning/personal/">Secunia PSI.</a> It is free for home users. This program will check almost every piece of software on your computer and see if there is an update for it. It works very well. For example a few weeks ago Adobe was consistently updating their Flash Player because of several security holes. Secunia PSI found the version I was running was insecure and provided me with a link to directly download and install the updated version! I must say it has been one of the best security programs I have seen for some time.</p>
<p>P.S. Just a note about NoScript. It can be hard for some users to get accustom to using it, and if you unblock the wrong script you will get infected.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tangorangers.com/2009/10/an-interesting-conversation-about-computer-security/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Free Burger from TGI Fridays</title>
		<link>http://blog.tangorangers.com/2009/10/free-burger-from-tgi-fridays/</link>
		<comments>http://blog.tangorangers.com/2009/10/free-burger-from-tgi-fridays/#comments</comments>
		<pubDate>Sun, 04 Oct 2009 16:25:14 +0000</pubDate>
		<dc:creator>DaijoubuKun</dc:creator>
				<category><![CDATA[In The News]]></category>

		<guid isPermaLink="false">http://blog.tangorangers.com/?p=208</guid>
		<description><![CDATA[As many users on facebook have seen there is an offer from TGI Fridays to get a free burger. I signed up. Why not? It&#8217;s a free burger and you don&#8217;t have to do more than give out your e-mail. Well time came to get the free burger. I went to their website and notices [...]]]></description>
			<content:encoded><![CDATA[<p>As many users on facebook have seen there is an offer from TGI Fridays to get a <a href="http://www.facebook.com/fanwoody">free burger</a>. I signed up. Why not? It&#8217;s a free burger and you don&#8217;t have to do more than give out your e-mail. Well time came to get the free burger. I went to their website and notices a few things wrong. For starters, you have to be running windows. That&#8217;s a problem for me. I run Linux, but I do have my windows inside a virtual machine. Anyways, I load up my windows and try to get my coupon, but what do I see, but I download for a program called couponprinter.exe from coupons.com. That seems a bit strange to me. So before downloading it I did some checking. I found it has been reported at a malicious program and according to many users it installs spyware.</p>
<p>The next day I was at my parents house and while waiting for other family members to arrive I went to check my e-mail using my Mother&#8217;s computer that I keep clean&#8230; very clean. I found that exact couponprinter.exe program on her computer. I didn&#8217;t think much of it at the time. I did my thing including backups and cleaning as I do when ever I see my family. It turns out that the very next week I was back. I checked on my mom&#8217;s computer. She said the only time it was used was to check on her e-mail. I found more spyware. I thought that was pretty interesting.</p>
<p>To test I removed all the spyware and rebooted. It was back. I then decided to remove the couponprinter.exe program she installed just as a test. I rebooted and nothing. The computer was clean. Now why I didn&#8217;t write down what I found I will never know. Just a lapse in judgment. Just to double check when I got back home I downloaded the installer on my Linux machine and uploaded the file to jotti&#8217;s virus scanner. Only one program reported it bad. Dr Web reported it as Adware.Coupons.34. Check it out <a href="http://virusscan.jotti.org/en/scanresult/619039182cc6f4a5b58ff5332754392de5e4d3b6/a3358f3b31f1f166ddbdbaf56bf73d25287261c6">Here.</a> I&#8217;m pretty sure I saw more than just the one when I ran Spybot: Search &#038; Destroy.</p>
<p>So, as much as I hate to say it (for possible legal issues), I would recommend NOT installing this program. Screw the free burner. I don&#8217;t want it anymore.</p>
<p>If you installed the program I highly recommend removing it and use free programs like Adaware and Spybot: Search &#038; Destroy to remove any traces the coupon printer program installed. These programs are available for windows users. If your on a mac I&#8217;m not sure. I don&#8217;t have a mac nor did I test the mac version of the program to see if there was anything bad.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tangorangers.com/2009/10/free-burger-from-tgi-fridays/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Other Day</title>
		<link>http://blog.tangorangers.com/2009/10/the-other-day/</link>
		<comments>http://blog.tangorangers.com/2009/10/the-other-day/#comments</comments>
		<pubDate>Sun, 04 Oct 2009 05:55:58 +0000</pubDate>
		<dc:creator>DaijoubuKun</dc:creator>
				<category><![CDATA[In The News]]></category>

		<guid isPermaLink="false">http://blog.tangorangers.com/?p=204</guid>
		<description><![CDATA[The other day I was listening to Maximum PC&#8217;s podcast and I thought &#8220;Those must be so fun to make. I bet I could do a great one.&#8221; So I got out my microphone and started talking about some of the interesting things going on in the tech world. After about 5 min I stopped [...]]]></description>
			<content:encoded><![CDATA[<p>The other day I was listening to Maximum PC&#8217;s podcast and I thought &#8220;Those must be so fun to make. I bet I could do a great one.&#8221; So I got out my microphone and started talking about some of the interesting things going on in the tech world. After about 5 min I stopped and realized how boring it would be to listen to just me, you need more people so you can banter back and forth. I need a friend to do this with. Unfortunately I only have 2 geek friends who would be willing to do it. One I can never get a hold of and the other is in Germany. Well crap. So in my weird own way I thought about posting more random crap since I don&#8217;t get very many hits here when I only post code information. Now my good friend over at <a href="http://spydersworld.com">SpydersWorld.com</a> posts about vulnerabilities. I will start posting there if I have something very cool and well documented. Otherwise it will be here. Lastly starting soon I&#8217;m going to start writing news and about programs I think are pretty cool (Windows, Linux, and Android). Check back soon and setup your rss readers now.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tangorangers.com/2009/10/the-other-day/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Javascript to hide single/multiple div tags with the same name Part 2</title>
		<link>http://blog.tangorangers.com/2009/08/using-javascript-to-hide-singlemultiple-div-tags-with-the-same-name-part-2/</link>
		<comments>http://blog.tangorangers.com/2009/08/using-javascript-to-hide-singlemultiple-div-tags-with-the-same-name-part-2/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 23:36:19 +0000</pubDate>
		<dc:creator>DaijoubuKun</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[div]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://blog.tangorangers.com/?p=194</guid>
		<description><![CDATA[Recently I was asked by a comment from my previous post Using Javascript to hide single/multiple div tags with the same name on how to get multiple buttons to control multiple div tags. For example, 2 div classes need to be hidden or shown with 2 different buttons controlling them. Turns out this is fairly [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I was asked by a comment from my previous post <a href="http://blog.tangorangers.com/2009/03/using-javascript-to-hide-singlemultiple-div-tags-with-the-same-name/">Using Javascript to hide single/multiple div tags with the same name</a> on how to get multiple buttons to control multiple div tags. For example, 2 div classes need to be hidden or shown with 2 different buttons controlling them. Turns out this is fairly simple. Basically you can use some previous code and alter some variable names in the javascript, but to make things simple here is the code.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> getElementsByClass<span style="color: #009900;">&#40;</span>searchClass<span style="color: #339933;">,</span> domNode<span style="color: #339933;">,</span> tagName<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
     <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>domNode <span style="color: #339933;">==</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> domNode <span style="color: #339933;">=</span> document<span style="color: #339933;">;</span>
     <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>tagName <span style="color: #339933;">==</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> tagName <span style="color: #339933;">=</span> <span style="color: #3366CC;">'*'</span><span style="color: #339933;">;</span>
     <span style="color: #003366; font-weight: bold;">var</span> el <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #003366; font-weight: bold;">var</span> tags <span style="color: #339933;">=</span> domNode.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span>tagName<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #003366; font-weight: bold;">var</span> tcl <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot; &quot;</span><span style="color: #339933;">+</span>searchClass<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot; &quot;</span><span style="color: #339933;">;</span>
     <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span>j<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span>tags.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #003366; font-weight: bold;">var</span> test <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot; &quot;</span> <span style="color: #339933;">+</span> tags<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">className</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot; &quot;</span><span style="color: #339933;">;</span>
          <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>test.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span>tcl<span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span>
               el<span style="color: #009900;">&#91;</span>j<span style="color: #339933;">++</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> tags<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
          <span style="color: #009900;">&#125;</span>
     <span style="color: #000066; font-weight: bold;">return</span> el<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> hidden <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">function</span> toggle_hideme1<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
     hidden <span style="color: #339933;">=</span> <span style="color: #339933;">!</span>hidden<span style="color: #339933;">;</span>
     <span style="color: #003366; font-weight: bold;">var</span> newDisplay<span style="color: #339933;">;</span>
     <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>hidden<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          newDisplay <span style="color: #339933;">=</span> <span style="color: #3366CC;">'block'</span><span style="color: #339933;">;</span>
     <span style="color: #009900;">&#125;</span>
     <span style="color: #000066; font-weight: bold;">else</span>
     <span style="color: #009900;">&#123;</span>
          newDisplay <span style="color: #339933;">=</span> <span style="color: #3366CC;">'none'</span><span style="color: #339933;">;</span>
     <span style="color: #009900;">&#125;</span>
     <span style="color: #003366; font-weight: bold;">var</span> showfirst <span style="color: #339933;">=</span> getElementsByClass<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;div_class_name&quot;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;div&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> showfirst.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          showfirst<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">style</span>.<span style="color: #660066;">display</span> <span style="color: #339933;">=</span> newDisplay<span style="color: #339933;">;</span>
     <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> hiddenb <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">function</span> toggle_hideme2<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
     hiddenb <span style="color: #339933;">=</span> <span style="color: #339933;">!</span>hiddenb<span style="color: #339933;">;</span>
     <span style="color: #003366; font-weight: bold;">var</span> newDisplay<span style="color: #339933;">;</span>
     <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>hiddenb<span style="color: #009900;">&#41;</span>
     <span style="color: #009900;">&#123;</span>
          newDisplay <span style="color: #339933;">=</span> <span style="color: #3366CC;">'block'</span><span style="color: #339933;">;</span>
     <span style="color: #009900;">&#125;</span>
     <span style="color: #000066; font-weight: bold;">else</span>
     <span style="color: #009900;">&#123;</span>
          newDisplay <span style="color: #339933;">=</span> <span style="color: #3366CC;">'none'</span><span style="color: #339933;">;</span>
     <span style="color: #009900;">&#125;</span>
     <span style="color: #003366; font-weight: bold;">var</span> showsecond <span style="color: #339933;">=</span> getElementsByClass<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;div_class_name&quot;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;div&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> k <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> k <span style="color: #339933;">&lt;</span> showsecond.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> k<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          showsecond<span style="color: #009900;">&#91;</span>k<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">style</span>.<span style="color: #660066;">display</span> <span style="color: #339933;">=</span> newDisplay<span style="color: #339933;">;</span>
     <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>For the variables &#8217;showfirst&#8217; and &#8217;showsecond&#8217; you can call them what ever you want, just make sure they stay the same in only one function, not two. Be sure to change &#8216;div_class_name&#8217; to a custom name for each field.</p>
<p>Also, these are setup to be hidden first, you can change that by swapping the &#8216;newDisplay = &#8216; lines.</p>
<p>For the HTML code we are going to use check boxes. We need two boxes each with names that call the function.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;input type=&quot;checkbox&quot; name=&quot;showone&quot; id=&quot;showone&quot; value=&quot;showone&quot; onClick=&quot;toggle_hideme1('showone');&quot;&gt;&lt;br /&gt;
&lt;input type=&quot;checkbox&quot; name=&quot;showtwo&quot; id=&quot;showtwo&quot; value=&quot;showtwo&quot; onClick=&quot;toggle_hideme2('showtwo');&quot;&gt;&lt;br /&gt;</pre></div></div>

<p>If you want the boxes checked to start first swap the &#8216;newDisplay =&#8217; lines, and use this.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;input type=&quot;checkbox&quot; name=&quot;showone&quot; id=&quot;showone&quot; value=&quot;showone&quot; onClick=&quot;toggle_hideme1('showone');&quot; CHECKED&gt;&lt;br /&gt;</pre></div></div>

<p>As in my previous post you need to put what ever will be shown or hidden in a div class tag.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;div class=&quot;div_class_name&quot; style=&quot;display: none;&quot;&gt;</pre></div></div>

<p>The style hides everything in the class until the box is checked.</p>
<p>That will start the boxed checked, when you un-check it the data in all div classes with that name will hide (remember the &#8216;div_class_name&#8217;? that&#8217;s what we are working with).</p>
<p>I wrote this up in just a couple minutes, so I truly help it makes scene. You can check out an example of how it works <a href="http://www.tangorangers.com/examples/jshidedivs_part2/">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tangorangers.com/2009/08/using-javascript-to-hide-singlemultiple-div-tags-with-the-same-name-part-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Defcon 17 thoughts</title>
		<link>http://blog.tangorangers.com/2009/08/defcon-17-thoughts/</link>
		<comments>http://blog.tangorangers.com/2009/08/defcon-17-thoughts/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 06:30:57 +0000</pubDate>
		<dc:creator>DaijoubuKun</dc:creator>
				<category><![CDATA[In The News]]></category>
		<category><![CDATA[defcon]]></category>
		<category><![CDATA[ucod]]></category>

		<guid isPermaLink="false">http://blog.tangorangers.com/?p=188</guid>
		<description><![CDATA[First off, I want to say that Spyder wrote an excellent article that I&#8217;m kinda taking my ideas from. Check it out at spydersworld.com.
This was my 4th year attending Defcon (all in a row!) and was by far the best year.  I&#8217;m going to try putting everything in chronological order, lets see how well [...]]]></description>
			<content:encoded><![CDATA[<p>First off, I want to say that Spyder wrote an excellent article that I&#8217;m kinda taking my ideas from. Check it out at <a href="http://spydersworld.com/?p=286">spydersworld.com</a>.</p>
<p>This was my 4th year attending Defcon (all in a row!) and was by far the best year.  I&#8217;m going to try putting everything in chronological order, lets see how well I do.</p>
<p>It all started shortly after arriving at the Riviera Hotel and Casino in Las Vegas on Thursday, July 30th. We has just gotten to our room and started relaxing after the crappy plane ride when we realized that it was time to prepare for the Toxic BBQ. Having a good friend that lives in Vegas is very handy at times like these. After going to Walmart to pick up the items everyone forgets (Thanks again for paying for everything Spyder) like: Water, Ice, Napkins, Paper Plates, and Plastic Silverware, we arrived at Sunset Park. Everyone was very grateful to us for bringing ice and water. Many were dehydrated and were happy for cold clean water. We all had a great time, good food, good friends. We even ran into Winn and his daughter Ashley (maker of Hackers Are People Too).  When it was time to go we piled back into the truck (with about 9 or so people in the back that needed a ride) and went back to the Riviera. It was pretty quiet after that. We all thought it would be a good idea to take it easy so we could get up early for the fun.</p>
<p>Friday morning was just like any other&#8230; except having to stand in line for a few hours to try and exchange our paper badges for real ones. A special thanks there goes to my buddie Mikey for getting in line early. I don&#8217;t want to go into too much detail on the days, mostly the events and special occasions.</p>
<p>This year I was fortunate enough to meet Johnny Long who was there to do a talk about his charity work in Uganda.  If you don&#8217;t know about it goto <a href="http://johnny.ihackstuff.com/">johnny.ihackstuff.com</a> and help out! The next day (after winning a little extra cash in the casino) I got a book called &#8220;Stealing the Network: The Complete Series Collector&#8217;s Edition&#8221; and got it signed my Johnny Long and Ryan Russell, but unfortunately Timothy Mullen wasn&#8217;t there. A special thanks goes to Ryan Russell, I can&#8217;t wait to read the book, and thank you Johnny Long for also signing my book.</p>
<p>I was to talk a little bit about Hacker Jeopardy. As usual Winn was awesome, and Gmark did a great job this year. As Spyder said in his post, Bansee is no longer Vynl Vanna. She always did a great job, she will be missed. The questions this year were kinda lame, Spyder and I talked to Winn about it and gave a few suggestions (they were all Spyder&#8217;s ideas), lets see if they use them next year.</p>
<p>Moxie&#8217;s talk about SSL was a real eye opener. Spyder has been blogging about it for quite some time, but seeing it in the presentation was a real eye opener. It&#8217;s true, security is an illusion. Scary thought, but it&#8217;s true, I have seen it with my own eyes.</p>
<p>Adam Savage from Mythbusters did a talk, I missed it. I wanted to see it. After the talk he was signing autographs. I found out from defcon&#8217;s twitter feed. The instant it was posted I got it on my phone and rushed to the War Room. I got there a few minutes late and a Goon kept me out of the line. If I had a beer for him he probably would have let me in, but I don&#8217;t drink beer so I was out of luck.</p>
<p>I was fortunate enough (also thanks to Spyder) to meet Keven (DJ Shadowvex) and talk with him for a bit. I enjoy his music and always look forward to next year&#8217;s disk. I also meet up with a few of his friends, but I&#8217;m bad with names. Sorry guys!</p>
<p>Over all this year was a great year and I look forward to going back next year. I think I have started to get myself known to some of the best people at Defcon and I know they will recognize me next year and I can&#8217;t wait to see them again.  Special thanks to Spyder. If it wasn&#8217;t for you I&#8217;m not sure I would have made it since I couldn&#8217;t afford a room by myself. Special thanks to Mikey. You are an awesome friend. I couldn&#8217;t ask for a better one. You know how to get around town and even help me win a few extra bucks on the video poker machine. Thank you for picking us up and dropping us off at the airport, and for the ride to and from the Toxic BBQ. Thanks for everything! I feel very fortunate that I have good friends and good times. By the end I didn&#8217;t want to leave Vegas since I was having such a great time, but all good things must some to and end. So I went home and took a nap.</p>
<p>What was your Defcon 17 experience like? Did you meet me? Who did you meet? What fun things did you do? I was to hear all about it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tangorangers.com/2009/08/defcon-17-thoughts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using SSH as a secure proxy</title>
		<link>http://blog.tangorangers.com/2009/07/using-ssh-as-a-secure-proxy/</link>
		<comments>http://blog.tangorangers.com/2009/07/using-ssh-as-a-secure-proxy/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 20:18:23 +0000</pubDate>
		<dc:creator>DaijoubuKun</dc:creator>
				<category><![CDATA[good to know]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://blog.tangorangers.com/?p=183</guid>
		<description><![CDATA[Recently I started school (which is why I haven&#8217;t done much of anything on my sites) where they have a wifi connection just like at a coffee shop.  The problem with these open networks is that people (like myself) can run a packet catcher like WireShark and get user names and password for various [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I started school (which is why I haven&#8217;t done much of anything on my sites) where they have a wifi connection just like at a coffee shop.  The problem with these open networks is that people (like myself) can run a packet catcher like <a href="http://www.wireshark.org/" target="_blank">WireShark</a> and get user names and password for various sites such as yahoo, facebook, and myspace.  Since when you log in to those you are doing so without https (encryption).  Also my school logs every site to visit and when I&#8217;m bored in class I don&#8217;t want them to know I&#8217;m researching hacking sites.</p>
<p>To solve this I setup a Linux box on my network and point port 22 to it.  22 is the default SSH port in case you didn&#8217;t know.  Then I create a secure tunnel from my laptop to my home box (my laptop also running Linux).</p>
<pre>SSH -D 1080 username@ip</pre>
<p>This creates what is essentially a SOCKS v5 proxy on port 1080.  Anything and everything you do remotely can be routed through 1080 (any port works, I just like that number).</p>
<p>Now I don&#8217;t know how to setup my Linux machine so that I don&#8217;t need to configure every program I use to work with the proxy and currently have to setup everything manually.  Here is how to do it with FireFox.</p>
<p>Open FireFox, goto Edit &#8211;> Preferences &#8211;> Advanced &#8211;> Network &#8211;> Connection &#8211;> Settings<br />
<img src="http://www.tangorangers.com/files_blog/ssh_proxy1.jpg" alt="pic1" /><br />
Click &#8220;Manual proxy configuration:&#8221;, then under SOCKS Host put &#8220;localhost&#8221; port &#8220;1080&#8243; and make sure that SOCKS v5 is clicked.<br />
Where it says &#8220;No Proxy For&#8221; you can leave localhost in, I&#8217;m not really sure, never tried.  I just cleared it out and everything went smoothly.<br />
<img src="http://www.tangorangers.com/files_blog/ssh_proxy2.jpg" alt="pic2" /><br />
Close the window and start surfing!</p>
<p>As long as you keep the SSH connection alive this will work.  If you SSH connection does die you will know right away when you can&#8217;t surf.  You will also need to revert your connection settings back when you are no longer using the SSH proxy.  Also keep in mind that even tho you are routing via an encrypted tunnel to your remote machine, traffic will still be unencrypted after that point.  Surfing may take longer than you would like.  This is due to the fact that ALL traffic will be routed first to your remote machine then to you via the tunnel.</p>
<p>Lastly, I&#8217;m told that not every SSHd configuration allows SSH proxies.  Mine does.  I&#8217;m not sure why, I haven&#8217;t bothered to look into that yet.  You may need to check your /etc/sshd_config file as there may be an option there.  If you need help you know where to ask for it.  Enjoy! </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tangorangers.com/2009/07/using-ssh-as-a-secure-proxy/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Use Battery Widget to fix possible battery issues after installing CupCake</title>
		<link>http://blog.tangorangers.com/2009/06/use-battery-widget-to-fix-possible-battery-issues-after-installing-cupcake/</link>
		<comments>http://blog.tangorangers.com/2009/06/use-battery-widget-to-fix-possible-battery-issues-after-installing-cupcake/#comments</comments>
		<pubDate>Sat, 20 Jun 2009 13:21:16 +0000</pubDate>
		<dc:creator>DaijoubuKun</dc:creator>
				<category><![CDATA[android]]></category>
		<category><![CDATA[cupcake]]></category>

		<guid isPermaLink="false">http://blog.tangorangers.com/?p=176</guid>
		<description><![CDATA[Like so many out there my battery started acting funky after I installed cupcake.  Mine was an automatic update and after it downloaded my battery was at about 70%.  This was apparently a bad thing.  It seems everyone who installed cupcake with a low battery has tried to charge it but it [...]]]></description>
			<content:encoded><![CDATA[<p>Like so many out there my battery started acting funky after I installed cupcake.  Mine was an automatic update and after it downloaded my battery was at about 70%.  This was apparently a bad thing.  It seems everyone who installed cupcake with a low battery has tried to charge it but it never seems to reach 100%.  Some say to just pull the battery, some say use the phone until it dies then charge.  I did both with no success.</p>
<p>Before I continue with how I solved the problem let me first give some information about how this all came to be.  My battery would stop charging (or so I thought) at about 87%.  While using the phone throughout the day I noticed that the battery level didn&#8217;t drop below 87% for quite some time.  This told me that there is nothing actually wrong with my battery and must be related to the phone (I wish I realized that before getting a replacement battery from HTC, whom by the way has excellent customer service!).</p>
<p>So here is what I did to solve the problem.  Granted I did this only a couple of days ago.  The first day of charging 100%, the next, about 97%, the third, 100% (that&#8217;s today).  I will keep track of the battery level throughout the next week or so and update this post.  First, open your Market and search for &#8220;Battery Widget&#8221;, for me it was the third in the list.  Make sure you get &#8220;Battery Widget&#8221; and nothing else.  Install, then place it on your desktop.  You will get an icon that looks like this.<br />
<img src="http://www.tangorangers.com/files_blog/android_apps/battery_widget/battery_widget_screen1.png" alt="icon" /><br />
The program does add a couple nifty features.  Just click on it and you get:<br />
<img src="http://www.tangorangers.com/files_blog/android_apps/battery_widget/battery_widget_screen2.png" alt="screen" /><br />
The top and bottom option will load into new windows (these same things are found in your Settings menu.)<br />
<img src="http://www.tangorangers.com/files_blog/android_apps/battery_widget/battery_widget_screen3.png" alt="sound &#038; display" />&nbsp;&nbsp;&nbsp;<img src="http://www.tangorangers.com/files_blog/android_apps/battery_widget/battery_widget_screen4.png" alt="Security &#038; location" /><br />
If you hit wifi, it will just turn your wifi on, it doesn&#8217;t take you to your settings menu.</p>
<p>Did Battery Widget fix your phone&#8217;s battery issue?  Hit the comments and let us know!</p>
<p>UPDATE!  Well it seems this really didn&#8217;t solve anything for me.  Damn, I was very hopeful it would.  Guess I need to either get that giant extended life battery or manually reinstall cupcake.</p>
<p>UPDATE! &#8230; again&#8230; Here&#8217;s the thing.  If you tried pulling the battery, draining it, or running Battery Widget and none of those worked try to reinstall cupcake.  I have even tried that and it didn&#8217;t work for me.  Apparently I need to install an older version then to cupcake again.  For me it&#8217;s not a big enough of a deal to bother going through that headache.</p>
<p>Check out <a href="http://www.androidcentral.com/how-manually-install-android-15-cupcake-us-version">Android Central</a> on instructions and links.  Please keep in mind that before you can install you must turn the phone off then back on using the home + power button!  That will not restart it!  Turn the power off then home + power for it to start properly!  I wish everyone the best of luck in this matter.  I just hope when my 220mAh battery arrives I won&#8217;t have any problems&#8230; and it did! I would highly recommend the battery, the case makes the back speaker quieter, but I&#8217;m sure I can fit that with a plastic tube inside the case&#8230; that is, if I ever get around to it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tangorangers.com/2009/06/use-battery-widget-to-fix-possible-battery-issues-after-installing-cupcake/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dynamically add form fields using javascript and DOM with dynamic post method</title>
		<link>http://blog.tangorangers.com/2009/05/dynamically-add-form-fields-using-javascript-and-dom-with-dynamic-post-method/</link>
		<comments>http://blog.tangorangers.com/2009/05/dynamically-add-form-fields-using-javascript-and-dom-with-dynamic-post-method/#comments</comments>
		<pubDate>Wed, 06 May 2009 01:14:39 +0000</pubDate>
		<dc:creator>DaijoubuKun</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.tangorangers.com/?p=120</guid>
		<description><![CDATA[Lets say you need to add some extra text fields but you don&#8217;t want to write a bunch of code.  I not only have how to quickly and easily add the input fields, but also how to take the data and put in into a MySQL DB!
I start with creating the DB.  Lets [...]]]></description>
			<content:encoded><![CDATA[<p>Lets say you need to add some extra text fields but you don&#8217;t want to write a bunch of code.  I not only have how to quickly and easily add the input fields, but also how to take the data and put in into a MySQL DB!</p>
<p>I start with creating the DB.  Lets call the table &#8216;phone&#8217;.  We need 3 rows.  &#8216;idx&#8217; int(10) with Auto Increment and primary key. &#8216;name&#8217; varchar(30), and &#8216;numb&#8217; varchar(20).  You can setup the db how ever you choose.  I create the idx so that I have a key field.</p>
<p>Now we need some javascript.</p>

<div class="wp_syntax"><div class="code"><pre class="javascipt" style="font-family:monospace;">var counter = 0;
Start a counter. Yes, at 0
function add_phone() {
    counter++;
// I find it easier to start the incrementing of the counter here.
    var newFields = document.getElementById('add_phone').cloneNode(true);
    newFields.id = '';
    newFields.style.display = 'block';
    var newField = newFields.childNodes;
    for (var i=0;i&lt;newField.length;i++) {
        var theName = newField[i].name
        if (theName)
                newField[i].name = theName + counter;
// This will change the 'name' field by adding an auto incrementing number at the end. This is important.
        }
        var insertHere = document.getElementById('add_phone');
// Inside the getElementById brackets is the name of the div class you will use.
        insertHere.parentNode.insertBefore(newFields,insertHere);
}</pre></div></div>

<p>Now I like to put that in a seperate .js file, but you can add it to your HTML HEAD tag.</p>
<p>Next we need to build the form.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;form name=&quot;add_a_phone&quot; action=&quot;&lt;?php echo $_SERVER['PHP_SELF']; ?&gt;&quot; method=&quot;post&quot; enctype=&quot;multipart/form-data&quot;&gt;
&lt;fieldset&gt;
&lt;div id=&quot;phone&quot;&gt;
    &lt;input type=&quot;text&quot; name=&quot;phone_0&quot; value=&quot;&quot; /&gt;
    &lt;input type=&quot;text&quot; name=&quot;phone_num_0&quot; value=&quot;&quot; /&gt;&lt;br&gt;
&lt;/div&gt;
&lt;div id=&quot;add_phone&quot; style=&quot;display: none;&quot;&gt;
    &lt;input type=&quot;text&quot; name=&quot;phone_&quot; value=&quot;&quot; /&gt;
    &lt;input type=&quot;text&quot; name=&quot;phone_num_&quot; value=&quot;&quot; /&gt;&lt;br&gt;
&lt;/div&gt;
&lt;input type=&quot;button&quot; id=&quot;add_phone()&quot; onclick=&quot;add_phone()&quot; value=&quot;Give me more fields!&quot; /&gt;&lt;br&gt;
&lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;submit&quot; /&gt;
&lt;/fieldset&gt;
&lt;/form&gt;</pre></div></div>

<p>Notice how in the input button field that the &#8216;id&#8217; and &#8216;onclick&#8217; are the same. That&#8217;s important, and yes you do need the brackets for some reason.<br />
Also note that the form name can NOT be the same as any div id!!! I keep making that mistake.<br />
You will need some way of checking how many fields were added when you get to your &#8216;if(isset($_POST[&#8217;submit&#8217;))&#8217; statement. This gets a little messy.<br />
Because I like my forms to go back to this page and check if submit was clicked we need to put some php code at the very top.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'submit'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;You clicked submit!&lt;br&gt;&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Here is your data&lt;br&gt;&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;br&gt;&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'phone_num_0'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$continue</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$continue</span> <span style="color: #339933;">==</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #009900;">&#41;</span>
                <span style="color: #009900;">&#123;</span>
                    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'phone_'</span><span style="color: #339933;">.</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                    <span style="color: #009900;">&#123;</span>
                    <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'phone_'</span><span style="color: #339933;">.</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot; = &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'phone_num_'</span><span style="color: #339933;">.</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;&lt;br&gt;&quot;</span><span style="color: #339933;">;</span>
                    <span style="color: #000088;">$phone</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'phone_'</span><span style="color: #339933;">.</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
                    <span style="color: #000088;">$phone_num</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'phone_num_'</span><span style="color: #339933;">.</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
                    <span style="color: #000088;">$query</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;INSERT INTO phone (idx, name, numb) VALUES ('NULL', '<span style="color: #006699; font-weight: bold;">$phone</span>', '<span style="color: #006699; font-weight: bold;">$phone_num</span>')&quot;</span><span style="color: #339933;">;</span>
                    <span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
                <span style="color: #b1b100;">else</span>
                <span style="color: #009900;">&#123;</span>
                    <span style="color: #000088;">$continue</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">TRUE</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
                <span style="color: #000088;">$i</span><span style="color: #339933;">++;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Obviously I left out some information.  Like connecting to your DB.  I&#8217;m assuming you already know how to do that.</p>
<p>I first wrote this on my main page.  This post is almost a copy/paste from the main page. I like adding it to the blog since it gets better indexing from search engines and hopefully the information will be useful to you.  On the main page there is also a working example so you can see how it all ties in.  Check it out <a href="http://www.tangorangers.com/examples/dynadddynpost/index.php">Here</a></p>
<p>Questions?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tangorangers.com/2009/05/dynamically-add-form-fields-using-javascript-and-dom-with-dynamic-post-method/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
	</channel>
</rss>
