<?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>brian dichiara</title>
	<atom:link href="http://blog.briandichiara.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.briandichiara.com</link>
	<description>designer. developer. friend.</description>
	<lastBuildDate>Wed, 03 Feb 2010 20:16:20 +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>Longest Spades Game Ever!</title>
		<link>http://blog.briandichiara.com/longest-spades-game-ever/</link>
		<comments>http://blog.briandichiara.com/longest-spades-game-ever/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 06:29:30 +0000</pubDate>
		<dc:creator>briandichiara</dc:creator>
				<category><![CDATA[Bin]]></category>

		<guid isPermaLink="false">http://blog.briandichiara.com/?p=191</guid>
		<description><![CDATA[The past few months or so, I&#8217;ve been playing Spades online at MSN Games Zone. I like it SO much better than Yahoo. Well, they&#8217;ve got this version called Whiz. Basically the rules are same as normal Spades, however when you bid, you must bid either the number of Spades in your hand or Nil. [...]]]></description>
			<content:encoded><![CDATA[<p>The past few months or so, I&#8217;ve been playing Spades online at MSN Games Zone. I like it SO much better than Yahoo. Well, they&#8217;ve got this version called Whiz. Basically the rules are same as normal Spades, however when you bid, you must bid either the number of Spades in your hand or Nil. I really enjoy this game, almost a little too much.  So tonight I got in a room with 3 others and little did we know what was sort of game we had gotten ourselves into. I can&#8217;t remember the stats exactly, but it was a 2050 rated player paired with a 1600 rated player, vs. 2200 and 1480. This game went 50 rounds of rediculous back and forth setting and missed nils. It took so long the other 3 players dropped out before it ended. I pasted the scores here.<br />
<span id="more-191"></span></p>
<p><code>[Event "MSN Games - Whiz2 Spades"]<br />
[Site "games.msn.com"]<br />
[Date "2009.12.2"]<br />
[Board "1"]<br />
[South "sole_pixel"]<br />
[West "Computer2"]<br />
[North "Computer3"]<br />
[East "Computer4"]<br />
[EndScore "500"]<br />
[MaxRounds "50"]<br />
[AllowBlindNil "false"]<br />
[Dealer "W"]<br />
[Deal "N:AT.KJ962.T4.J863 K98762.85.Q9.QT2 54.Q74.KJ872.A54 QJ3.AT3.A653.K97"]<br />
[Auction "N"]<br />
2S 6S 2S 3S<br />
[Play "N"]<br />
 1. D4 D9 DJ DA<br />
 2. HA H9 H5 H4<br />
 3. H3 HK H8 H7<br />
 4. DT DQ DK D3<br />
 5. HQ HT H6 S2<br />
 6. C2 C4 CK C8<br />
 7. C9 CJ CQ CA<br />
 8. C5 C7 C3 CT<br />
 9. S6 S4 SJ SA<br />
10. C6 S7 D2 D5<br />
11. SK S5 S3 ST<br />
12. S9 D8 SQ H2<br />
13. D6 HJ S8 D7<br />
[Dealer "N"]<br />
[Deal "E:K9842.KT76.Q4.A7 3.94.AKJT762.Q52 5.Q8532.93.KJ963 AQJT76.AJ.85.T84"]<br />
[Auction "E"]<br />
5S NIL NIL 6S<br />
[Play "E"]<br />
 1. CA CQ CK C8<br />
 2. DQ DJ D9 D5<br />
 3. HK H9 HQ HA<br />
 4. D8 D4 D7 D3<br />
 5. C4 C7 C5 C6<br />
 6. HT H4 H8 HJ<br />
 7. CT S2 C2 CJ<br />
 8. SK S3 S5 SA<br />
 9. SQ S4 DA C9<br />
10. SJ S8 DK H5<br />
11. ST S9 DT C3<br />
12. S7 H7 D6 H3<br />
13. S6 H6 D2 H2<br />
[Dealer "E"]<br />
[Deal "S:JT.764.KJT.97432 K98.KJT982.87.K5 7654.A.Q9642.J86 AQ32.Q53.A53.AQT"]<br />
[Auction "S"]<br />
2S 3S 4S 4S<br />
[Play "S"]<br />
 1. H6 HT HA H3<br />
 2. C8 CA C2 C5<br />
 3. CT C3 CK C6<br />
 4. D7 D6 DA DT<br />
 5. CQ C4 D8 CJ<br />
 6. HQ H7 H2 S4<br />
 7. D2 D3 DK S8<br />
 8. H8 S5 H5 H4<br />
 9. D4 D5 DJ S9<br />
10. H9 S6 SQ C7<br />
11. S2 SJ SK S7<br />
12. HK DQ SA ST<br />
13. S3 C9 HJ D9<br />
[Dealer "S"]<br />
[Deal "W:AQJT7.KQ3.KT92.7 K85.T.Q874.KJ643 943.AJ64.A65.T85 62.98752.J3.AQ92"]<br />
[Auction "W"]<br />
5S 3S 3S NIL<br />
[Play "W"]<br />
 1. C7 C6 C5 C2<br />
 2. H3 HT HJ H9<br />
 3. C8 C9 S7 C3<br />
 4. HQ D4 H6 H8<br />
 5. HK D7 H4 H7<br />
 6. DT DQ DA DJ<br />
 7. D5 D3 DK D8<br />
 8. SA S5 S9 S6<br />
 9. ST SK S4 S2<br />
10. CK CT CQ SJ<br />
11. SQ S8 S3 CA<br />
12. D2 C4 D6 H5<br />
13. HA H2 D9 CJ<br />
[Dealer "W"]<br />
[Deal "N:A754.543.Q43.965 Q8.AKT98.A8.KQ82 K9.J72.T52.AJT73 JT632.Q6.KJ976.4"]<br />
[Auction "N"]<br />
4S 2S 2S 5S<br />
[Play "N"]<br />
 1. H3 HA H2 H6<br />
 2. HK H7 HQ H4<br />
 3. H8 HJ S2 H5<br />
 4. C4 C6 CK CA<br />
 5. DT DJ DQ DA<br />
 6. CQ C3 D6 C9<br />
 7. D8 D5 DK D4<br />
 8. D9 D3 S8 D2<br />
 9. HT CJ S3 S4<br />
10. SA SQ S9 S6<br />
11. S5 C2 SK ST<br />
12. C7 SJ C5 C8<br />
13. D7 S7 H9 CT<br />
[Dealer "N"]<br />
[Deal "E:763.832.A9872.76 KT94.Q754.4.AT85 A5.AKJ6.KQT53.J3 QJ82.T9.J6.KQ942"]<br />
[Auction "E"]<br />
NIL 4S 2S 4S<br />
[Play "E"]<br />
 1. C6 CA C3 C4<br />
 2. D4 DQ D6 D9<br />
 3. HA H9 H8 H7<br />
 4. CJ CQ C7 C8<br />
 5. HT H3 HQ HJ<br />
 6. H5 H6 DJ H2<br />
 7. DT SJ DA CT<br />
 8. S8 S7 SK SA<br />
 9. DK SQ D8 ST<br />
10. S2 S3 S4 S5<br />
11. D5 C9 D2 S9<br />
12. C5 HK CK D7<br />
13. C2 S6 H4 D3<br />
[Dealer "E"]<br />
[Deal "S:Q64.76.T8.A98762 98.KJ9543.J54.43 AKJ72.AT82.AKQ9. T53.Q.7632.KQJT5"]<br />
[Auction "S"]<br />
3S NIL 5S 3S<br />
[Play "S"]<br />
 1. H7 H5 HA HQ<br />
 2. DK D2 DT DJ<br />
 3. DQ D3 D8 D5<br />
 4. D9 D6 C9 D4<br />
 5. DA D7 C8 HK<br />
 6. H2 S3 H6 HJ<br />
 7. CK CA C4 SJ<br />
 8. H8 C5 C7 H4<br />
 9. HT S5 S6 H9<br />
10. C2 C3 SK CT<br />
11. S7 ST S4 S9<br />
12. CQ C6 H3 SA<br />
13. S2 CJ SQ S8<br />
[Dealer "S"]<br />
[Deal "W:962.J6.KT984.K85 T87.752.A32.Q764 J53.AKQT94.6.JT3 AKQ4.83.QJ75.A92"]<br />
[Auction "W"]<br />
3S 3S 3S 4S<br />
[Play "W"]<br />
 1. H6 H7 HA H3<br />
 2. HK H8 HJ H5<br />
 3. D6 D7 DT DA<br />
 4. H2 HQ S4 S6<br />
 5. C5 C7 CJ CA<br />
 6. SA S2 S7 S3<br />
 7. DJ DK D2 C3<br />
 8. CK C6 CT C2<br />
 9. D4 D3 S5 D5<br />
10. HT SQ D8 C4<br />
11. SK S9 S8 SJ<br />
12. DQ D9 CQ H4<br />
13. C9 C8 ST H9<br />
[Dealer "W"]<br />
[Deal "N:Q86.J83.K732.QJ6 AT7.AK42.JT95.T4 9432.T976.A6.K53 KJ5.Q5.Q84.A9872"]<br />
[Auction "N"]<br />
3S 3S 4S 3S<br />
[Play "N"]<br />
 1. D7 D9 DA D4<br />
 2. D6 D8 DK D5<br />
 3. D2 DJ S2 DQ<br />
 4. C5 CA C6 C4<br />
 5. C2 CJ CT C3<br />
 6. D3 DT S3 S5<br />
 7. H5 HJ HA H6<br />
 8. HK H7 HQ H3<br />
 9. H2 H9 SJ H8<br />
10. C7 CQ S7 CK<br />
11. H4 HT SK SQ<br />
12. C8 S8 SA S9<br />
13. ST S4 C9 S6<br />
[Dealer "N"]<br />
[Deal "E:KQJ92.QT2.KQ3.64 A87.94.9862.JT97 43.AKJ86.75.K852 T65.753.AJT4.AQ3"]<br />
[Auction "E"]<br />
5S 3S NIL 3S<br />
[Play "E"]<br />
 1. DK D9 D7 DA<br />
 2. H7 HQ H9 HJ<br />
 3. DQ D8 D5 DJ<br />
 4. HT H4 H8 H5<br />
 5. D3 D2 HA D4<br />
 6. H3 H2 CJ H6<br />
 7. C5 CQ C4 C7<br />
 8. DT S2 D6 HK<br />
 9. SK SA S4 S5<br />
10. S7 S3 ST SQ<br />
11. C6 CT C8 C3<br />
12. C9 C2 CA S9<br />
13. SJ S8 CK S6<br />
[Dealer "E"]<br />
[Deal "S:KT642.942.QJ52.A AQ973.Q.A843.985 J8.KT76.K96.KJ74 5.AJ853.T7.QT632"]<br />
[Auction "S"]<br />
5S 5S 2S 1S<br />
[Play "S"]<br />
 1. H9 HQ HK HA<br />
 2. D7 DJ DA D9<br />
 3. D3 DK DT D2<br />
 4. D6 S5 D5 D4<br />
 5. C2 CA C5 C7<br />
 6. DQ D8 H7 H3<br />
 7. H4 S7 H6 H5<br />
 8. SA S8 C3 S2<br />
 9. C9 CK C6 H2<br />
10. CJ CQ S4 C8<br />
11. S6 S9 SJ H8<br />
12. HT HJ ST SQ<br />
13. S3 C4 CT SK<br />
[Dealer "S"]<br />
[Deal "W:Q864..Q432.87543 KJ75.QT43.86.QJ6 T3.J762.KJ7.KT92 A92.AK985.AT95.A"]<br />
[Auction "W"]<br />
4S 4S 2S 3S<br />
[Play "W"]<br />
 1. D2 D6 DK DA<br />
 2. CA C3 C6 C2<br />
 3. HK S4 H4 H2<br />
 4. D4 D8 DJ D5<br />
 5. CK S2 C4 CJ<br />
 6. DT DQ S5 D7<br />
 7. CQ C9 H5 C5<br />
 8. HQ H6 H8 S6<br />
 9. D3 S7 ST D9<br />
10. HJ HA SQ H3<br />
11. C7 SJ CT H9<br />
12. HT H7 S9 C8<br />
13. SA S8 SK S3<br />
[Dealer "W"]<br />
[Deal "N:53.A7.AKJ72.KJ74 AQ762.KQT64.3.86 KT8.J82.Q64.AT93 J94.953.T985.Q52"]<br />
[Auction "N"]<br />
2S 5S 3S NIL<br />
[Play "N"]<br />
 1. HA H4 H8 H9<br />
 2. H7 HK HJ H5<br />
 3. HQ H2 H3 S5<br />
 4. S3 SA ST SJ<br />
 5. HT DQ CQ DJ<br />
 6. H6 D6 DT CJ<br />
 7. C8 CT C5 CK<br />
 8. C4 C6 C3 C2<br />
 9. SQ SK S9 DK<br />
10. D4 D5 D2 D3<br />
11. S4 D7 S7 S8<br />
12. CA D9 C7 S6<br />
13. S2 C9 D8 DA<br />
[Dealer "N"]<br />
[Deal "E:AQ954.AK5.K96.97 J8732.62.J52.KJ3 6.QJT94.A4.Q6542 KT.873.QT873.AT8"]<br />
[Auction "E"]<br />
5S 5S 1S 2S<br />
[Play "E"]<br />
 1. HA H2 H4 H8<br />
 2. HK H6 H9 H3<br />
 3. H5 S2 HT H7<br />
 4. DJ DA D7 D6<br />
 5. D4 D8 DK D2<br />
 6. D9 D5 S6 D3<br />
 7. C2 CA C7 C3<br />
 8. DQ S4 S7 C4<br />
 9. CK C5 C8 C9<br />
10. CJ CQ CT S5<br />
11. S9 S3 C6 ST<br />
12. DT SQ SJ HJ<br />
13. SA S8 HQ SK<br />
[Dealer "E"]<br />
[Deal "S:KQ9653..J854.Q43 AJT.AQJ7632..A98 2.KT94.KQ976.KJT 874.85.AT32.7652"]<br />
[Auction "S"]<br />
6S 3S 1S NIL<br />
[Play "S"]<br />
 1. C4 CA CJ C7<br />
 2. HA H9 H8 SK<br />
 3. C3 C8 CT C6<br />
 4. CK C5 CQ C9<br />
 5. HT H5 SQ H2<br />
 6. D5 ST D9 DA<br />
 7. HJ H4 DT S9<br />
 8. D4 SJ D7 D3<br />
 9. H7 HK C2 S6<br />
10. S5 SA S2 S8<br />
11. H6 DK D2 S3<br />
12. DJ H3 DQ S7<br />
13. S4 D8 HQ D6<br />
[Dealer "S"]<br />
[Deal "W:A7642.Q7.954.JT3 Q5.KJ96432.Q2.Q6 J983.A8.AKJ8.K82 KT.T5.T763.A9754"]<br />
[Auction "W"]<br />
5S 2S 4S 2S<br />
[Play "W"]<br />
 1. H7 HK HA H5<br />
 2. H8 HT HQ H9<br />
 3. C3 CQ CK CA<br />
 4. C9 CT C6 C2<br />
 5. CJ S5 C8 C4<br />
 6. D2 DA D3 D4<br />
 7. DK D6 D5 DQ<br />
 8. S9 ST S2 SQ<br />
 9. H2 S3 SK SA<br />
10. S6 H6 SJ C5<br />
11. DJ D7 D9 H3<br />
12. D8 DT S7 H4<br />
13. S4 HJ S8 C7<br />
[Dealer "W"]<br />
[Deal "N:9652.AT8753.K3.2 AKJT843.K4.84.97 .J2.AJT9652.AKQJ Q7.Q96.Q7.T86543"]<br />
[Auction "N"]<br />
4S 7S NIL NIL<br />
[Play "N"]<br />
 1. HA H4 HJ HQ<br />
 2. HT HK H2 H9<br />
 3. C9 CA CT C2<br />
 4. D5 D7 DK D4<br />
 5. D3 D8 D9 DQ<br />
 6. C3 S2 C7 CK<br />
 7. H8 S8 CQ H6<br />
 8. SA CJ SQ S5<br />
 9. SK DJ S7 S6<br />
10. SJ DT C8 S9<br />
11. ST D6 C6 H7<br />
12. S4 DA C5 H5<br />
13. S3 D2 C4 H3<br />
[Dealer "N"]<br />
[Deal "E:Q53.AK42.JT975.8 J72.T.K62.KJ7543 K9864.J53.AQ4.AQ AT.Q9876.83.T962"]<br />
[Auction "E"]<br />
3S NIL 5S 2S<br />
[Play "E"]<br />
 1. HA HT H5 H6<br />
 2. C8 C7 CA C2<br />
 3. DA D3 D9 DK<br />
 4. DQ D8 D7 D6<br />
 5. D4 ST D5 D2<br />
 6. SA S5 SJ S4<br />
 7. HQ HK CK H3<br />
 8. H2 CJ HJ H7<br />
 9. CQ C9 DJ C5<br />
10. SK C6 SQ S7<br />
11. S6 H9 S3 S2<br />
12. S8 H8 DT C4<br />
13. S9 CT H4 C3<br />
[Dealer "E"]<br />
[Deal "S:T65.KQ92.Q3.AK76 J983.J654.A9.Q95 AKQ742.83.75.T84 .AT7.KJT8642.J32"]<br />
[Auction "S"]<br />
3S 4S 6S NIL<br />
[Play "S"]<br />
 1. C7 C9 CT C3<br />
 2. C4 C2 CA C5<br />
 3. C6 CQ C8 CJ<br />
 4. DA D5 DK D3<br />
 5. HJ H8 HT HK<br />
 6. H2 H6 H3 HA<br />
 7. D2 DQ D9 D7<br />
 8. CK S9 SQ DJ<br />
 9. SA H7 S5 S3<br />
10. SK DT S6 S8<br />
11. S2 D8 ST SJ<br />
12. H5 S4 D6 H9<br />
13. S7 D4 HQ H4<br />
[Dealer "S"]<br />
[Deal "W:82.KJ7.T8.KQT985 AQ7.AT643.A65.A2 KT43.95.Q974.764 J965.Q82.KJ32.J3"]<br />
[Auction "W"]<br />
NIL 3S 4S 4S<br />
[Play "W"]<br />
 1. D8 DA D4 DJ<br />
 2. CA C4 CJ CK<br />
 3. C2 C6 C3 C5<br />
 4. DQ DK DT D6<br />
 5. D3 HK D5 D7<br />
 6. D9 D2 CQ S7<br />
 7. H3 H9 H8 H7<br />
 8. SK S5 S8 SA<br />
 9. H4 H5 H2 HJ<br />
10. C8 SQ C7 HQ<br />
11. HA S3 S6 C9<br />
12. SJ S2 HT S4<br />
13. S9 CT H6 ST<br />
[Dealer "W"]<br />
[Deal "N:7652.T3.9873.QT6 JT4.K75.65.KJ982 Q3.AJ96.AQJT4.A3 AK98.Q842.K2.754"]<br />
[Auction "N"]<br />
NIL 3S 2S 4S<br />
[Play "N"]<br />
 1. HT H5 HJ HQ<br />
 2. H4 H3 HK H6<br />
 3. D5 DA D2 D9<br />
 4. DQ DK D8 D6<br />
 5. H2 CQ H7 HA<br />
 6. H9 H8 CT SJ<br />
 7. C2 CA C7 C6<br />
 8. DJ S9 D7 C9<br />
 9. C4 D3 CK C3<br />
10. ST S3 S8 S7<br />
11. S4 SQ SK S6<br />
12. SA S5 CJ D4<br />
13. C5 S2 C8 DT<br />
[Dealer "N"]<br />
[Deal "E:64.J854.KJ4.KQ85 AJ98.K2.T93.T762 KQT7.QT7.AQ76.A4 532.A963.852.J93"]<br />
[Auction "E"]<br />
2S 4S 4S NIL<br />
[Play "E"]<br />
 1. H4 HK HT H9<br />
 2. CT CA CJ C8<br />
 3. HQ H6 HJ H2<br />
 4. H7 H3 H8 D3<br />
 5. H5 S8 ST HA<br />
 6. C4 C3 CK C2<br />
 7. C5 C6 D6 C9<br />
 8. D5 DK D9 D7<br />
 9. CQ C7 DQ D8<br />
10. D4 DT DA D2<br />
11. SK S2 S6 SJ<br />
12. SQ S5 S4 S9<br />
13. S7 S3 DJ SA<br />
[Dealer "E"]<br />
[Deal "S:QJT9.KQ9.T87543. 872.743.AK6.Q542 AK543.85.J.KJT83 6.AJT62.Q92.A976"]<br />
[Auction "S"]<br />
4S 3S 5S 1S<br />
[Play "S"]<br />
 1. H9 H3 H5 HT<br />
 2. CA S9 C2 C8<br />
 3. DT DK DJ D2<br />
 4. DA S3 D9 D8<br />
 5. CK C6 D7 C4<br />
 6. SA S6 ST S2<br />
 7. SK H2 SJ S7<br />
 8. CJ C7 SQ C5<br />
 9. HK H4 H8 HA<br />
10. DQ D4 D6 S4<br />
11. S5 H6 D5 S8<br />
12. CQ C3 C9 HQ<br />
13. H7 CT HJ D3<br />
[Dealer "S"]<br />
[Deal "W:T97.JT.QJT94.974 AJ652.86.3.QT832 83.AKQ53.A87.KJ6 KQ4.9742.K652.A5"]<br />
[Auction "W"]<br />
NIL 5S 2S 3S<br />
[Play "W"]<br />
 1. C4 C3 C6 CA<br />
 2. C5 C7 C2 CJ<br />
 3. CK SK C9 C8<br />
 4. D6 D4 D3 D7<br />
 5. DA D5 DQ S6<br />
 6. H6 HA H9 HJ<br />
 7. HK H7 HT H8<br />
 8. HQ H4 DJ S5<br />
 9. CQ H3 H2 DT<br />
10. CT H5 DK D9<br />
11. SJ S3 SQ ST<br />
12. D2 S9 S2 D8<br />
13. S7 SA S8 S4<br />
[Dealer "W"]<br />
[Deal "N:K5.QT.K652.T7643 AJ943.A762.QT4.5 Q8762.J5.A9.AQJ9 T.K9843.J873.K82"]<br />
[Auction "N"]<br />
2S 5S 5S NIL<br />
[Play "N"]<br />
 1. C3 C5 C9 C8<br />
 2. H5 H4 HQ H2<br />
 3. C4 S3 CJ CK<br />
 4. SA S2 ST S5<br />
 5. HA HJ HK HT<br />
 6. H7 S6 H9 CT<br />
 7. D9 D8 DK D4<br />
 8. C6 S4 CQ C2<br />
 9. DQ DA DJ D6<br />
10. CA H8 C7 H6<br />
11. S7 D7 SK S9<br />
12. D2 DT S8 D3<br />
13. SQ H3 D5 SJ<br />
[Dealer "N"]<br />
[Deal "E:Q83.J32.A98543.T 972.8.KQT72.8765 AKJ64.A765.6.KJ9 T5.KQT94.J.AQ432"]<br />
[Auction "E"]<br />
3S NIL 5S 2S<br />
[Play "E"]<br />
 1. CT C8 CK CA<br />
 2. DJ DA DK D6<br />
 3. D3 D2 S4 C2<br />
 4. HA H4 HJ H8<br />
 5. CJ CQ SQ C7<br />
 6. D4 DQ C9 S5<br />
 7. HK H3 DT H5<br />
 8. HQ H2 D7 H6<br />
 9. HT S8 S7 H7<br />
10. D5 C6 SJ C3<br />
11. SK ST S3 S9<br />
12. SA C4 D9 S2<br />
13. S6 H9 D8 C5<br />
[Dealer "E"]<br />
[Deal "S:74.32.K76.AKQT84 A96.A9654.J2.953 KQJT32.K.AQ943.7 85.QJT87.T85.J62"]<br />
[Auction "S"]<br />
2S 3S 6S 2S<br />
[Play "S"]<br />
 1. H3 HA HK H7<br />
 2. D2 DQ D5 D6<br />
 3. C7 CJ CA C3<br />
 4. DK DJ D3 D8<br />
 5. H2 H4 S2 H8<br />
 6. DA DT D7 S6<br />
 7. C5 S3 C2 C4<br />
 8. D9 S5 S7 S9<br />
 9. SA ST S8 S4<br />
10. H5 SJ HT C8<br />
11. SK C6 CT C9<br />
12. SQ HJ CK H6<br />
13. D4 HQ CQ H9<br />
[Dealer "S"]<br />
[Deal "W:4.8754.A53.KQ982 K2.KJ6.KT76.AJT4 AJT7653.A9.Q8.53 Q98.QT32.J942.76"]<br />
[Auction "W"]<br />
1S 2S 7S 3S<br />
[Play "W"]<br />
 1. DA D7 D8 D2<br />
 2. D3 DK DQ D4<br />
 3. H6 HA H2 H4<br />
 4. H9 HT H5 HJ<br />
 5. HK S3 H3 H7<br />
 6. C3 C6 CQ CA<br />
 7. DT S5 D9 D5<br />
 8. C5 C7 CK C4<br />
 9. H8 D6 S6 HQ<br />
10. SJ SQ S4 S2<br />
11. S8 C2 SK SA<br />
12. ST S9 C8 CT<br />
13. S7 DJ C9 CJ<br />
[Dealer "W"]<br />
[Deal "N:KQ8654.75.982.K6 A.AKQ2.AJT3.J954 J2.JT983.K6.AQ72 T973.64.Q754.T83"]<br />
[Auction "N"]<br />
6S 1S 2S NIL<br />
[Play "N"]<br />
 1. CK C4 C7 CT<br />
 2. C6 CJ CQ C8<br />
 3. H8 H6 H7 H2<br />
 4. H3 H4 H5 HA<br />
 5. HK H9 DQ SQ<br />
 6. D9 DA D6 D7<br />
 7. HQ HJ C3 S8<br />
 8. D8 DJ DK D5<br />
 9. HT D4 D2 D3<br />
10. C2 S3 SK C5<br />
11. S4 SA SJ ST<br />
12. DT S2 S7 S6<br />
13. S9 S5 C9 CA<br />
[Dealer "N"]<br />
[Deal "E:AJ.AJ972.K94.KT2 T7.K43.7532.A653 KQ432.T6.AQJ.987 9865.Q85.T86.QJ4"]<br />
[Auction "E"]<br />
2S 2S 5S 4S<br />
[Play "E"]<br />
 1. HA H4 H6 H8<br />
 2. H2 HK HT H5<br />
 3. D7 DA D6 D4<br />
 4. DJ D8 D9 D2<br />
 5. DQ DT DK D3<br />
 6. CK C6 C7 C4<br />
 7. CT CA C8 CJ<br />
 8. C5 C9 CQ C2<br />
 9. HQ H7 H3 S2<br />
10. S4 S5 SJ ST<br />
11. H9 D5 S3 S6<br />
12. S8 SA S7 SQ<br />
13. HJ C3 SK S9<br />
[Dealer "E"]<br />
[Deal "S:AKJT.KJ52.Q762.K 9.AQT963.AK43.A8 Q8763.7.T95.T974 542.84.J8.QJ6532"]<br />
[Auction "S"]<br />
4S 1S 5S 3S<br />
[Play "S"]<br />
 1. H5 HA H7 H4<br />
 2. CA C4 C2 CK<br />
 3. DA D9 D8 D2<br />
 4. DK D5 DJ D6<br />
 5. C8 CT CQ ST<br />
 6. SA S9 S3 S2<br />
 7. HK H3 DT H8<br />
 8. DQ D3 C9 S5<br />
 9. C3 HJ HQ C7<br />
10. S6 S4 SK D4<br />
11. D7 H6 SQ CJ<br />
12. S7 C6 SJ H9<br />
13. H2 HT S8 C5<br />
[Dealer "S"]<br />
[Deal "W:984.AJT6.KJ.AK82 A72.752.753.JT97 QT6.K3.QT842.Q65 KJ53.Q984.A96.43"]<br />
[Auction "W"]<br />
3S 3S 3S 4S<br />
[Play "W"]<br />
 1. CA C7 C5 C4<br />
 2. CK C9 C6 C3<br />
 3. HA H2 H3 H4<br />
 4. DK D7 D2 DA<br />
 5. D9 DJ D3 D4<br />
 6. C2 CT CQ S3<br />
 7. D6 S4 D5 D8<br />
 8. C8 CJ S6 SJ<br />
 9. HQ H6 H5 HK<br />
10. DQ S5 HT H7<br />
11. SK S8 S2 ST<br />
12. H9 HJ S7 SQ<br />
13. DT H8 S9 SA<br />
[Dealer "W"]<br />
[Deal "N:964.A862.AK7.QJ3 AKQ32.K4.9532.K5 J.T9753.Q6.AT864 T875.QJ.JT84.972"]<br />
[Auction "N"]<br />
3S 5S 1S 4S<br />
[Play "N"]<br />
 1. DA D2 D6 D4<br />
 2. DK D3 DQ D8<br />
 3. D7 D5 SJ DT<br />
 4. CA C2 C3 C5<br />
 5. CT C7 CJ CK<br />
 6. D9 C8 DJ S4<br />
 7. S9 S3 HT S5<br />
 8. H6 H4 H7 HJ<br />
 9. HQ H8 HK H9<br />
10. S2 H5 ST S6<br />
11. S8 CQ SA C6<br />
12. SK C4 S7 HA<br />
13. SQ H3 C9 H2<br />
[Dealer "N"]<br />
[Deal "E:T753.T942.QT8.T9 KJ98.J8763.A93.7 AQ2.AKQ.62.65432 64.5.KJ754.AKQJ8"]<br />
[Auction "E"]<br />
4S 4S 3S 2S<br />
[Play "E"]<br />
 1. C9 C7 C2 CJ<br />
 2. CA CT D3 C3<br />
 3. CK S3 S8 C4<br />
 4. DA D2 DJ D8<br />
 5. D9 D6 DK DT<br />
 6. CQ S5 S9 C5<br />
 7. HJ HA H5 H2<br />
 8. HK S4 H4 H8<br />
 9. C8 HT H7 C6<br />
10. S6 S7 SK SQ<br />
11. H6 HQ D7 H9<br />
12. S2 D5 ST SJ<br />
13. H3 SA D4 DQ<br />
[Dealer "E"]<br />
[Deal "S:42.KQ7632..AJ764 A85.95.T8764.T52 QJ6.AT.AKQ953.83 KT973.J84.J2.KQ9"]<br />
[Auction "S"]<br />
2S 3S 3S 5S<br />
[Play "S"]<br />
 1. CA C2 C3 C9<br />
 2. C4 C5 C8 CK<br />
 3. CQ C7 CT S6<br />
 4. DA D2 H2 D4<br />
 5. HA H4 H3 H5<br />
 6. DK DJ C6 D6<br />
 7. DQ S3 S4 D7<br />
 8. HK H9 HT HJ<br />
 9. S2 S5 SJ ST<br />
10. D3 H8 HQ DT<br />
11. D8 D5 SK CJ<br />
12. S7 H7 S8 SQ<br />
13. D9 S9 H6 SA<br />
[Dealer "S"]<br />
[Deal "W:AJ84.Q973.96.854 653.KJ.QT54.AQ32 K.A8.KJ8732.K976 QT972.T6542.A.JT"]<br />
[Auction "W"]<br />
4S 3S 1S 5S<br />
[Play "W"]<br />
 1. D6 DT DJ DA<br />
 2. CJ C4 C2 CK<br />
 3. D2 S2 D9 D4<br />
 4. CT C5 C3 C6<br />
 5. HT HQ HJ H8<br />
 6. C8 CA C7 H2<br />
 7. CQ C9 H4 S4<br />
 8. H3 HK HA H6<br />
 9. DK S7 S8 D5<br />
10. H9 S3 SK H5<br />
11. D3 SQ SJ DQ<br />
12. ST SA S6 D8<br />
13. H7 S5 D7 S9<br />
[Dealer "W"]<br />
[Deal "N:K76.A754.Q4.AK65 A.J96.A87632.832 T95432.83.J95.Q9 QJ8.KQT2.KT.JT74"]<br />
[Auction "N"]<br />
3S 1S 6S 3S<br />
[Play "N"]<br />
 1. CA C2 C9 C4<br />
 2. HA H6 H3 H2<br />
 3. CK C3 CQ C7<br />
 4. C5 C8 S2 CT<br />
 5. H8 HK H4 H9<br />
 6. HQ H5 HJ S3<br />
 7. DJ DT D4 DA<br />
 8. D2 D9 DK DQ<br />
 9. HT H7 D3 S4<br />
10. D5 S8 SK D6<br />
11. C6 D7 S5 CJ<br />
12. ST SJ S6 SA<br />
13. D8 S9 SQ S7<br />
[Dealer "N"]<br />
[Deal "E:A876.Q952.KQ8.52 Q.T63.T732.AQT93 JT432.J874.J9.K7 K95.AK.A654.J864"]<br />
[Auction "E"]<br />
4S 1S 5S 3S<br />
[Play "E"]<br />
 1. C2 CA C7 C4<br />
 2. HT HJ HA H2<br />
 3. DA D8 D2 D9<br />
 4. HK H5 H3 H4<br />
 5. D4 DK D3 DJ<br />
 6. DQ D7 S2 D5<br />
 7. CK C6 C5 C3<br />
 8. H7 S5 H9 H6<br />
 9. C8 HQ CQ H8<br />
10. SQ SJ S9 S8<br />
11. DT S3 D6 SA<br />
12. S7 CT S4 SK<br />
13. CJ S6 C9 ST<br />
[Dealer "E"]<br />
[Deal "S:2.A93.T763.KQJ52 AQJT7.QJ54.982.3 K96.8762.QJ54.T7 8543.KT.AK.A9864"]<br />
[Auction "S"]<br />
1S 5S 3S 4S<br />
[Play "S"]<br />
 1. DT D2 DJ DA<br />
 2. DK D3 D8 D4<br />
 3. HT HA H4 H2<br />
 4. D6 D9 DQ S3<br />
 5. HK H3 H5 H6<br />
 6. CA C2 C3 C7<br />
 7. C4 CJ S7 CT<br />
 8. HQ H7 C6 H9<br />
 9. HJ H8 C8 S2<br />
10. CK ST SK C9<br />
11. D5 S4 D7 SJ<br />
12. SA S6 S5 C5<br />
13. SQ S9 S8 CQ<br />
[Dealer "S"]<br />
[Deal "W:QJT532.KQ4.K.KJ5 87.JT872.J953.T6 64.93.AT872.A743 AK9.A65.Q64.Q982"]<br />
[Auction "W"]<br />
6S NIL NIL 3S<br />
[Play "W"]<br />
 1. HK HJ H9 H5<br />
 2. DK DJ DT D4<br />
 3. CK CT C7 C2<br />
 4. HQ HT H3 H6<br />
 5. CJ C6 C4 CQ<br />
 6. HA H4 H8 CA<br />
 7. DQ S2 D9 DA<br />
 8. C5 H7 C3 C9<br />
 9. D6 S3 D5 D8<br />
10. SQ S8 S6 S9<br />
11. SJ S7 S4 SK<br />
12. C8 S5 H2 D7<br />
13. ST D3 D2 SA<br />
[Dealer "W"]<br />
[Deal "N:J74.54.98632.J96 63.AKQJ86.74.A84 QT85.973.AKJ.T73 AK92.T2.QT5.KQ52"]<br />
[Auction "N"]<br />
3S 2S 4S 4S<br />
[Play "N"]<br />
 1. H4 HA H3 H2<br />
 2. CA C3 C2 C6<br />
 3. C4 C7 CK C9<br />
 4. CQ CJ C8 CT<br />
 5. C5 S4 S6 S8<br />
 6. DA D5 D2 D4<br />
 7. DK DT D3 D7<br />
 8. H9 HT H5 H6<br />
 9. DQ D6 H8 DJ<br />
10. SA S7 S3 SQ<br />
11. S2 SJ HK ST<br />
12. D8 HQ H7 SK<br />
13. S9 D9 HJ S5<br />
[Dealer "N"]<br />
[Deal "E:Q5.Q9542.Q3.JT85 A2.J863.KJ875.KQ JT86.AT.AT4.9762 K9743.K7.962.A43"]<br />
[Auction "E"]<br />
2S 2S 4S 5S<br />
[Play "E"]<br />
 1. D3 D5 DA D2<br />
 2. HA H7 H2 H3<br />
 3. HT HK H4 H6<br />
 4. CA C5 CQ C2<br />
 5. C3 C8 CK C6<br />
 6. DK D4 D6 DQ<br />
 7. HJ S6 S7 H5<br />
 8. D9 S5 D7 DT<br />
 9. CJ S2 C7 C4<br />
10. H8 S8 S9 H9<br />
11. S3 SQ SA ST<br />
12. DJ C9 S4 HQ<br />
13. SK CT D8 SJ<br />
[Dealer "E"]<br />
[Deal "S:AJ65.A853.KJ.AJ9 T4.QJT4.T43.KQ73 Q983.9762.A86.52 K72.K.Q9752.T864"]<br />
[Auction "S"]<br />
4S 2S 4S 3S<br />
[Play "S"]<br />
 1. HA H4 H2 HK<br />
 2. CA C3 C2 C4<br />
 3. CJ CK C5 C6<br />
 4. CQ S3 C8 C9<br />
 5. DA D2 DJ D3<br />
 6. D6 D7 DK D4<br />
 7. H8 HQ H6 D5<br />
 8. HJ H7 D9 H5<br />
 9. HT H9 CT H3<br />
10. DT D8 DQ S5<br />
11. S6 ST SQ SK<br />
12. S2 SJ S4 S8<br />
13. SA C7 S9 S7<br />
[Dealer "S"]<br />
[Deal "W:J95.854.A6.Q9432 KT8732.QJ32.Q2.8 AQ6.K6.98753.T76 4.AT97.KJT4.AKJ5"]<br />
[Auction "W"]<br />
3S 6S 3S 1S<br />
[Play "W"]<br />
 1. DA D2 D3 D4<br />
 2. D6 DQ D5 DT<br />
 3. C8 CT CA C2<br />
 4. CK C3 H2 C6<br />
 5. DK S5 S7 D7<br />
 6. H3 H6 HA H4<br />
 7. C5 CQ S2 C7<br />
 8. HJ HK H7 H5<br />
 9. D8 DJ S9 ST<br />
10. HQ S6 H9 H8<br />
11. D9 S4 SJ SK<br />
12. S3 SQ CJ C9<br />
13. SA HT C4 S8<br />
[Dealer "W"]<br />
[Deal "N:K.97.KT653.KJ753 A63.KQT852.A9.86 QJ85.AJ6.842.T92 T9742.43.QJ7.AQ4"]<br />
[Auction "N"]<br />
1S 3S 4S 5S<br />
[Play "N"]<br />
 1. H7 H8 HA H3<br />
 2. HJ H4 H9 HQ<br />
 3. DA D2 D7 D3<br />
 4. HK H6 C4 SK<br />
 5. DK D9 D4 DJ<br />
 6. C3 C6 C9 CQ<br />
 7. CA C5 C8 C2<br />
 8. DQ D5 H2 D8<br />
 9. S2 D6 SA S5<br />
10. HT S8 S9 C7<br />
11. S4 DT S6 SJ<br />
12. SQ S7 CJ S3<br />
13. CT ST CK H5<br />
[Dealer "N"]<br />
[Deal "E:AJ632.43.AJ7.842 T87.KQJ.Q98.KT97 K.AT8752.KT432.3 Q954.96.65.AQJ65"]<br />
[Auction "E"]<br />
5S 3S 1S 4S<br />
[Play "E"]<br />
 1. DA D8 D2 D5<br />
 2. H3 HJ HA H6<br />
 3. DK D6 D7 D9<br />
 4. C3 CA C2 C7<br />
 5. H9 H4 HQ H2<br />
 6. HK H5 C5 S2<br />
 7. DJ DQ D3 C6<br />
 8. CK SK CJ C4<br />
 9. H7 S4 S6 S7<br />
10. CT D4 CQ C8<br />
11. S5 SA S8 H8<br />
12. S3 ST HT SQ<br />
13. S9 SJ C9 DT<br />
[Dealer "E"]<br />
[Deal "S:J73.98753.J.AKJ3 A95.QT42.QT975.T T642.J6.A32.Q952 KQ8.AK.K864.8764"]<br />
[Auction "S"]<br />
3S 3S 4S 3S<br />
[Play "S"]<br />
 1. DJ D5 DA D4<br />
 2. H6 HA H3 H2<br />
 3. DK S3 D7 D2<br />
 4. CA CT C2 C4<br />
 5. CK S5 C5 C6<br />
 6. H4 HJ HK H5<br />
 7. C7 CJ S9 C9<br />
 8. HQ S2 S8 H7<br />
 9. C8 C3 D9 CQ<br />
10. D3 D6 S7 DT<br />
11. SJ SA S4 SQ<br />
12. HT S6 SK H9<br />
13. D8 H8 DQ ST<br />
[Dealer "S"]<br />
[Deal "W:QJT86.94.93.JT73 A9753.AK7.JT5.54 .QJT653.K8.KQ986 K42.82.AQ7642.A2"]<br />
[Auction "W"]<br />
5S 5S NIL 3S<br />
[Play "W"]<br />
 1. CJ C5 C9 CA<br />
 2. C2 CT C4 C8<br />
 3. H9 HA HQ H2<br />
 4. HK HJ H8 H4<br />
 5. H7 H6 S2 D3<br />
 6. DA D9 DJ DK<br />
 7. DQ S6 DT D8<br />
 8. C7 S3 CK D7<br />
 9. D5 HT D6 C3<br />
10. D4 S8 S9 H5<br />
11. SA H3 SK ST<br />
12. S5 CQ S4 SQ<br />
13. SJ S7 C6 D2<br />
[Dealer "W"]<br />
[Deal "N:AT2.AQ974.J5.K64 QJ3.K65.K964.AQ9 96.JT32.A83.T732 K8754.8.QT72.J85"]<br />
[Auction "N"]<br />
3S 3S NIL 5S<br />
[Play "N"]<br />
 1. HA H6 HJ H8<br />
 2. CK CA CT CJ<br />
 3. HK HT DT H4<br />
 4. CQ C7 C8 C4<br />
 5. D4 D8 D7 DJ<br />
 6. H7 H5 H3 S4<br />
 7. C5 C6 C9 C3<br />
 8. S3 S9 S8 SA<br />
 9. H9 SJ H2 D2<br />
10. D6 D3 DQ D5<br />
11. SK S2 SQ S6<br />
12. S5 ST DK DA<br />
13. HQ D9 C2 S7<br />
[Dealer "N"]<br />
[Deal "E:T852.KQ74.AJ8.62 QJ3.T82.Q742.QJ9 AK764.93.5.T8543 9.AJ65.KT963.AK7"]<br />
[Auction "E"]<br />
4S 3S 5S 1S<br />
[Play "E"]<br />
 1. DA D2 D5 D3<br />
 2. C2 C9 CT CK<br />
 3. CA C6 CJ C3<br />
 4. HA H4 H2 H3<br />
 5. DK D8 D4 S4<br />
 6. H9 HJ HK H8<br />
 7. HQ HT C4 H5<br />
 8. H7 S3 S6 H6<br />
 9. C5 C7 S2 CQ<br />
10. DJ DQ S7 D6<br />
11. C8 S9 ST SJ<br />
12. D7 SK D9 S5<br />
13. SA DT S8 SQ<br />
</code></p>
<p>After it was nothing but the computers and I, my team ended up losing. Mainly because I stopped really playing to write this post.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.briandichiara.com/longest-spades-game-ever/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nested Sub-folder Controllers in CodeIgniter</title>
		<link>http://blog.briandichiara.com/nested-sub-folder-controllers-in-codeigniter/</link>
		<comments>http://blog.briandichiara.com/nested-sub-folder-controllers-in-codeigniter/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 04:14:50 +0000</pubDate>
		<dc:creator>briandichiara</dc:creator>
				<category><![CDATA[Bin]]></category>

		<guid isPermaLink="false">http://blog.briandichiara.com/?p=184</guid>
		<description><![CDATA[If you have gotten to the point where one sub-folder for your controllers just isn&#8217;t enough, you probably found a frustrating problem in CodeIgniter. Whether or not MVC Frameworks are supposed to allow nested sub-folders is debatable, however I like the organization. This post solved my problem (very simply) and I got right back to [...]]]></description>
			<content:encoded><![CDATA[<p>If you have gotten to the point where one sub-folder for your controllers just isn&#8217;t enough, you probably found a frustrating problem in CodeIgniter. Whether or not MVC Frameworks are supposed to allow nested sub-folders is debatable, however I like the organization. This post solved my problem (very simply) and I got right back to developing:</p>
<p><a href="http://glennpratama.wordpress.com/2009/10/20/multi-level-subfolder-for-controller-in-codeigniter/">Multi Level Subfolder Controller in CodeIgniter <br />http://glennpratama.wordpress.com/2009/10/20/multi-level-subfolder-for-controller-in-codeigniter/</a></p>
<p>Thanks Glenn!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.briandichiara.com/nested-sub-folder-controllers-in-codeigniter/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Switching IDEs! CodeIgniter Users Should Too!</title>
		<link>http://blog.briandichiara.com/switching-ides-codeigniter-users-should-too/</link>
		<comments>http://blog.briandichiara.com/switching-ides-codeigniter-users-should-too/#comments</comments>
		<pubDate>Sun, 18 Oct 2009 23:57:12 +0000</pubDate>
		<dc:creator>briandichiara</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.briandichiara.com/?p=160</guid>
		<description><![CDATA[I don&#8217;t know about you, but changing IDEs is a major thing for me. As my development skills have progressed over the years, I have been looking for more ways to take advantage of the development software I&#8217;ve been using. I am constantly wanting to improve my development experience and trying to find ways to [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t know about you, but changing IDEs is a major thing for me. As my development skills have progressed over the years, I have been looking for <a href="/dreamweaver-extensions/">more ways</a> to take advantage of the development software I&#8217;ve been using. I am constantly wanting to improve my development experience and trying to find ways to speed up programming. Well, this past week, I basically did an assessment of Dreamweaver and here are my conclusions.<br />
<span id="more-160"></span></p>
<ul>
<li style="color:#1D9F47; font-weight:bold; list-style:none; background-image:none; padding-left:0; margin-left:0;">Dreamweaver Pros</li>
<li>I like the code colors. (or maybe I&#8217;m just used to them)</li>
<li>&#8220;Upload on Save&#8221; feature. &#8211; I used to not be able to live without this feature, but as I&#8217;ve progressed as developer, I&#8217;ve been using a local webserver for testing before uploading anything to server. It makes development and testing a WHOLE lot faster.</li>
<li>Great Find/Replace tool (with Regex)</li>
<li>Not-so-bad code completion (at least for PHP)</li>
<li>The interface is easily de-cluttered.</li>
<li>Mac and PC versions available</li>
</ul>
<ul>
<li style="color:#BF3317; font-weight:bold; list-style:none; background-image:none; padding-left:0; margin-left:0;">Dreamweaver Cons</li>
<li>It&#8217;s really a glorified Frontpage. The application was designed for programmers and Front-end designers with little programming experience (more-so for the latter)</li>
<li>Limited programming tools</li>
<li>Bloated &#8211; As with most Adobe products, you never want to set any of them to an &#8220;Open with [this] by default&#8221; setting unless you have a pretty awesome computer.</li>
<li>Poor FTP &#8211; With me it was always timing out.</li>
<li>Most of the built in features are for people that don&#8217;t know how to program or want a more &#8220;point-and-click&#8221; way of doing things.</li>
<li>EXPENSIVE!</li>
<li>They tend to add useless features that only junk up the application, like Code Navigator and Spry</li>
</ul>
<p>So I searched <a href="http://en.wikipedia.org/wiki/List_of_PHP_editors">far and wide</a> for as many IDEs I could find to install and test on my machine. Here are some of the ones I tried out:</p>
<ul>
<li>Aptana</li>
<li>PHPEclipse</li>
<li>PHPEdit</li>
<li>Zend Studio</li>
<li>Komodo IDE</li>
<li>RapidPHP 2010</li>
<li>e Text Editor</li>
</ul>
<p>Now there are <a href="http://www.php-editors.com/">several</a> <a href="http://free-php-editor.com/">websites</a> where you will find reviews of the software mentioned above, however that&#8217;s not really what I wanted to accomplish in this post. I really wanted to compare the previous tool I was using with a new one. I could go on and on all day about what features I believe an IDE should have as well as my likes and dislikes of all the software above, however one piece of software I was really impressed with is <a href="http://www.mpsoftware.dk/phpdesigner.php">phpDesigner</a> (version 7).</p>
<p>As of this past week, I have officially moved on from ten years of using Dreamweaver to this very fine piece of software. You may have heard of it or tried it yourself, although I can&#8217;t speak for past versions. Let me just start by pointing out my most absolute favorite feature of this software. It&#8217;s a feature that I&#8217;ve been looking for in pretty much every piece of software I tested, but couldn&#8217;t find done as well as phpDesigner. phpDesigner doesn&#8217;t have any special name for it, but it&#8217;s the Code Completion tool I have wanted for years.</p>
<p>Just to give you an idea as to how much work it took to get this working here are the steps I took when testing this software:</p>
<ol>
<li>Create a new project (I used a project I was currently working on that was using the <a href="http://codeigniter.com/">CodeIgniter</a> framework)</li>
<li>Open a file in the project</li>
<li>Code completion automatically works.</li>
</ol>
<p>That&#8217;s IT! And not only does it work for all the classes and methods built into CodeIgniter, but it also adds the classes I write into the code tips as well. You should check out <a href="http://www.mpsoftware.dk/phpdesigner_screencasts.php">some of the videos</a> on their website to see this in action. They even use CodeIgniter in their examples, however I believe this will work with any PHP framework out there. The best part of it all: it&#8217;s super fast! I did find one or two other pieces of software out there that did something similar, however I was typing much faster than the letters would spit out onto the document due to software constantly trying to parse my text to decide what code hint or suggestion to display.</p>
<p>Here are some other features I really like in phpDesigner that I didn&#8217;t have in Dreamweaver:</p>
<ul>
<li>Built In Inline Debugger (with no additional setup or local web server required)</li>
<li>CTRL+Click on a method or custom function takes you to the declaration of that method/function</li>
<li>Custom syntax highlighting colors &#8211; Although I REALLY liked most of the default PHP color settings.</li>
<li>Auto completion library (the CTRL+J function)</li>
<li>Inline TODO and BUG panel</li>
<li>Support for PHP 5.3 (and any future versions)</li>
</ul>
<p>Here are the features that (thankfully) carried over from Dreamweaver:</p>
<ul>
<li>Customizable shortcuts (although it will not allow me to use Space or Enter in shortcuts)</li>
<li>Tabs for open files (with the ability to reload open)</li>
<li>Regex Find/Replace tool with the ability to search within a set of folders inside your project</li>
<li>Tabs for open files (with the ability to reload open)</li>
<li>Code Snippets</li>
</ul>
<p>I hate to do this, but I must be objective. Here are my gripes:</p>
<ul>
<li>The software has built in FTP, but no simple way uploading one file to and FTP sites relative directory. This problem is somewhat manageable by creating your FTP accounts in the Tools > FTP menu and having the FTP/SFTP panel side by side with the Project panel, however I would really like to have a feature where I can click a file in the Project panel and then click Upload, and it uploads in the corresponding directory of the remote site. The tool I thought that did this required that I select the FTP account and the directory every time I wanted to upload a file.</li>
<li>I would like for it to support Space and Enter in the keyboard shortcut customizer.</li>
<li>You cannot CTRL+C / CTRL+V Copy/Paste in the Project panel. There are 2 ways around this, however one way has another gripe. You can right click a file, but then you are given a custom context menu (bleh) which you must then click Shell menu to see the Copy command. (follow the same process for paste). The 2nd way is by clicking the folder location of the open file in the Status Bar, and using Windows to copy/paste.</li>
<li>The Project panel goes nuts when your project is on Network or Mapped drive with constantly updating the file list. It inserts a new item at the top of every open folder reading<br />
&#8220;Loading folder content&#8221; which is constantly distracting as well as irritating when you&#8217;re trying to work with files in that panel. This is not a problem for me at home for I&#8217;m working off a local drive, but at work it&#8217;s a bit frustrating.</li>
</ul>
<p>The software is still a bit larger than I&#8217;d like (not nearly as large as Dreamweaver), however I suppose that&#8217;s a sacrifice you must make if you want all the tools built into the software. If you&#8217;re looking for an extremely fast, lightweight application, I would highly recommend <a href="http://notepad-plus.sourceforge.net/">Notepad++</a>.</p>
<p>I think it&#8217;s a pretty safe to assumption to say there is no software out there that is perfect. Mainly because &#8220;perfect&#8221; is a personal opinion on how things should work. That is a struggle every programmer deals with trying to make software pleasing to every single user that uses it, it&#8217;s dang near impossible. But for all the amazing features I get with phpDesigner that I never had with Dreamweaver, I can live with this issues until they&#8217;re either addressed or I just get used to them and don&#8217;t even notice them anymore <img src='http://blog.briandichiara.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>I would like to encourage developers using CodeIgniter or any other PHP framework to <a href="http://www.mpsoftware.dk/downloads.php">try this out</a>. They offer a 21 day free trial as well as an extension of that trial if you need more time.</p>
<p>As an added bonus, I&#8217;m attaching my color styles for PHP, CSS, HTML, and JS. The javascript one hasn&#8217;t changed much from the defaults, except I colored the comments like Dreamweaver (in gray). Let me know if you try out this software, I&#8217;d love to hear your feedback!</p>
<ul>
<li><a href='http://blog.briandichiara.com/wp-content/uploads/2009/10/syntax_php2.dat'>syntax_php2</a></li>
<li><a href='http://blog.briandichiara.com/wp-content/uploads/2009/10/syntax_css2.dat'>syntax_css2</a></li>
<li><a href='http://blog.briandichiara.com/wp-content/uploads/2009/10/syntax_html2.dat'>syntax_html2</a></li>
<li><a href='http://blog.briandichiara.com/wp-content/uploads/2009/10/syntax_js2.dat'>syntax_js2</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.briandichiara.com/switching-ides-codeigniter-users-should-too/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PHP Function for URI and URI Segments</title>
		<link>http://blog.briandichiara.com/php-uri-function/</link>
		<comments>http://blog.briandichiara.com/php-uri-function/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 20:23:57 +0000</pubDate>
		<dc:creator>briandichiara</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.briandichiara.com/?p=152</guid>
		<description><![CDATA[Here's a function I wrote to parse through the URI to get segments. I wrote it to use with CodeIgniter to get URI segments before they had been altered and "-" gets changed to "_". It can be used in any application.

PLAIN TEXT
PHP:




&#60;?php


function uri&#40;$segment=NULL, $qs=false&#41;&#123;


&#160; &#160; $uri = $_SERVER&#91;'REQUEST_URI'&#93;;


&#160; &#160; if&#40;!$qs &#124;&#124; $segment !== NULL&#41;&#123;


&#160; [...]]]></description>
			<content:encoded><![CDATA[<p>Here's a function I wrote to parse through the URI to get segments. I wrote it to use with CodeIgniter to get URI segments before they had been altered and "-" gets changed to "_". It can be used in any application.<br />
<span id="more-152"></span></p>
<div class="igBar"><span id="lphp-3"><a href="#" onclick="javascript:showPlainTxt('php-3'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-3">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">function</span> uri<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$segment</span>=<span style="color:#000000; font-weight:bold;">NULL</span>, <span style="color:#0000FF;">$qs</span>=<span style="color:#000000; font-weight:bold;">false</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$uri</span> = <span style="color:#0000FF;">$_SERVER</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'REQUEST_URI'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span>!<span style="color:#0000FF;">$qs</span> || <span style="color:#0000FF;">$segment</span> !== <span style="color:#000000; font-weight:bold;">NULL</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/strpos"><span style="color:#000066;">strpos</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$uri</span>, <span style="color:#FF0000;">'?'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/list"><span style="color:#000066;">list</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$uri</span>, <span style="color:#0000FF;">$query</span><span style="color:#006600; font-weight:bold;">&#41;</span> = <a href="http://www.php.net/explode"><span style="color:#000066;">explode</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'?'</span>, <span style="color:#0000FF;">$uri</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$segment</span> !== <span style="color:#000000; font-weight:bold;">NULL</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/is_string"><span style="color:#000066;">is_string</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$segment</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$segment</span> != <span style="color:#FF0000;">'last'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">return</span> <span style="color:#006600; font-weight:bold;">&#40;</span> <a href="http://www.php.net/strlen"><span style="color:#000066;">strlen</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$uri</span><span style="color:#006600; font-weight:bold;">&#41;</span>&gt;= <a href="http://www.php.net/strlen"><span style="color:#000066;">strlen</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$segment</span><span style="color:#006600; font-weight:bold;">&#41;</span> &amp;&amp; <a href="http://www.php.net/substr"><span style="color:#000066;">substr</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$uri</span>, <span style="color:#CC66CC;color:#800000;">0</span>, <a href="http://www.php.net/strlen"><span style="color:#000066;">strlen</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$segment</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$str</span> = <a href="http://www.php.net/trim"><span style="color:#000066;">trim</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$uri</span>, <span style="color:#FF0000;">'/'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$segments</span> = <span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/strpos"><span style="color:#000066;">strpos</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$str</span>, <span style="color:#FF0000;">'/'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> ? <a href="http://www.php.net/explode"><span style="color:#000066;">explode</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'/'</span>, <span style="color:#0000FF;">$str</span><span style="color:#006600; font-weight:bold;">&#41;</span> : <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$str</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$ttl</span> = <a href="http://www.php.net/count"><span style="color:#000066;">count</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$segments</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/is_string"><span style="color:#000066;">is_string</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$segment</span><span style="color:#006600; font-weight:bold;">&#41;</span> &amp;&amp; <span style="color:#0000FF;">$segment</span> == <span style="color:#FF0000;">'last'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$seg</span> = <a href="http://www.php.net/array_pop"><span style="color:#000066;">array_pop</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$segments</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#616100;">elseif</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$segment</span> &lt;= <span style="color:#0000FF;">$ttl</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$segment</span> &lt;<span style="color:#CC66CC;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#0000FF;">$segment</span> = <span style="color:#0000FF;">$ttl</span> - <a href="http://www.php.net/abs"><span style="color:#000066;">abs</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$segment</span><span style="color:#006600; font-weight:bold;">&#41;</span> + <span style="color:#CC66CC;color:#800000;">1</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$seg</span> = <span style="color:#0000FF;">$segments</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$segment</span>-<span style="color:#CC66CC;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#616100;">else</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">return</span> <span style="color:#FF0000;">''</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">return</span> <span style="color:#0000FF;">$seg</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">return</span> <span style="color:#0000FF;">$uri</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Usage:</p>
<div class="igBar"><span id="lphp-4"><a href="#" onclick="javascript:showPlainTxt('php-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-4">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// uri:&nbsp; http://www.mysite.com/some-controller/some-method/</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> uri<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// displays: /some-controller/some-method/</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> uri<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;color:#800000;">2</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// displays: some-method</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Pass true into 2nd paramater ($qs) to display Query String with URI</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// uri:&nbsp; http://www.mysite.com/some-controller/?foo=bar&amp;bar=foo</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> uri<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#000000; font-weight:bold;">NULL</span>, <span style="color:#000000; font-weight:bold;">true</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// displays: /some-controller/?foo=bar&amp;bar=foo </span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.briandichiara.com/php-uri-function/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Our First Big Fight</title>
		<link>http://blog.briandichiara.com/our-first-big-fight/</link>
		<comments>http://blog.briandichiara.com/our-first-big-fight/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 14:28:42 +0000</pubDate>
		<dc:creator>briandichiara</dc:creator>
				<category><![CDATA[Bin]]></category>

		<guid isPermaLink="false">http://blog.briandichiara.com/?p=138</guid>
		<description><![CDATA[I've been using CodeIgniter for the past 6 months or so and while we've had our minor indifferences, I've thought of CodeIgniter to be a pretty decent PHP MVC. There was very little learning curve for me and we hit off quite easily. We were like peas and carrots. Unfortunately, as go most relationships, I [...]]]></description>
			<content:encoded><![CDATA[<p>I've been using CodeIgniter for the past 6 months or so and while we've had our minor indifferences, I've thought of CodeIgniter to be a pretty decent PHP MVC. There was very little learning curve for me and we hit off quite easily. We were like peas and carrots. Unfortunately, as go most relationships, I knew this "new love" wouldn't last forever.<br />
<span id="more-138"></span></p>
<h3>How it Started</h3>
<p>I had been working on a project for about a month or so when I decided to make a very minor tweak to a database column. I'm not sure if this is what kicked it off or what, but I tested my changes and I get the good ol' WSOD (White Screen of Death). In PHP, this is very bad, mmk. What this means is an error has occurred somewhere in your code, and PHP's not telling you where. I was stunned. I had no idea where to start other than reverting my tiny change which I knew wouldn't make a difference at all. I did, and of course, still nothing.</p>
<h3>How I Dealt With It</h3>
<p>I first pinpointed where the problem was occurring, and it was during the call to parent::Controller() in the constructor of my default controller. So, I hit up the CodeIgniter IRC channel to see if anyone had had this problem before. Nobody seemed to have any advice except for to enable <a href="http://codeigniter.com/user_guide/general/errors.html">CI's logging</a> feature, set it to level 5, and stand back. Since I had no idea what was supposed to be occurring in the background, I pastebin'd the log, where a user responded, "It seems to be stopping at the Encryption Library. PHP isn't loading the mcrypt." Ah, ok. I'll go enable that.</p>
<blockquote><p>My Computer > PHP > php.ini > Uncomment mcrypt extension > Restart Apache</p></blockquote>
<p>Apache doesn't start back up. It can't find the mcrypt library. Well, I don't appear to have it in my ext folder. Why? I don't know??? Off to PHP's site to download it. Well, I thought maybe this is a good time to go ahead and upgrade PHP. Big mistake.....</p>
<h3>The Frustration</h3>
<p>I am by no means a server administrator. I know enough to be dangerous, that's about it. When it comes to troubleshooting server problems, I miserably fail. I had setup PHP/Apache/MySQL through a tutorial I found a while back, although I can't recall which one, but setup was not too bad. Now diving back into that, I knew I had really screwed up. After downloading many different versions of PHP for Windows, I realized I needed to actually <a href="http://windows.php.net/download/">RTFM</a> and get the right one. Still I was unsuccessful in starting Apache. Ok, maybe my version of Apache won't work with the latest version of PHP. Let's upgrade that.</p>
<p>I finally get Apache starting, however PHP would seem to "lock up" whenever a database connection was being made, causing Apache to crash with no errors in it's error log.</p>
<p>I think I completely uninstalled and reinstalled PHP/Apache 6 times in about 6 different ways. Completely frustrated and at a loss, I resorted to installing <a href="http://www.apachefriends.org/en/xampp-windows.html">XAMPP</a>. I wanted to be one of the cool kids and have my own Apache server running on my machine, but I guess I'll have to wait for that day to come.</p>
<h3>The Resolution</h3>
<p>So now that I had my webserver back up and running, I was pretty much back to square one with the WSOD. After a few days, I had also noticed that the page would load after it had "sat" for a while, but upon refresh would fail. I began my normal Debugging routine by echoing various numbers and obscenities throughout the code until something doesn't work, I started with the Session library, thinking this is where my problem lied. I dug deep and dug hard and hit something!</p>
<div class="igBar"><span id="lphp-6"><a href="#" onclick="javascript:showPlainTxt('php-6'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-6">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Lines 706-721 of system/libraries/Session.php</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">function</span> _unserialize<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$data</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$data</span> = @<a href="http://www.php.net/unserialize"><span style="color:#000066;">unserialize</span></a><span style="color:#006600; font-weight:bold;">&#40;</span>strip_slashes<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$data</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/is_array"><span style="color:#000066;">is_array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$data</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">foreach</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$data</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$key</span> =&gt; <span style="color:#0000FF;">$val</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$data</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$key</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <a href="http://www.php.net/str_replace"><span style="color:#000066;">str_replace</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'{{slash}}'</span>, <span style="color:#FF0000;">'<span style="color:#000099; font-weight:bold;">\\</span>'</span>, <span style="color:#0000FF;">$val</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">return</span> <span style="color:#0000FF;">$data</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">return</span> <a href="http://www.php.net/str_replace"><span style="color:#000066;">str_replace</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'{{slash}}'</span>, <span style="color:#FF0000;">'<span style="color:#000099; font-weight:bold;">\\</span>'</span>, <span style="color:#0000FF;">$data</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Can you spot it? What on earth is an @ symbol doing in there? Who would do such a thing? What cruel developer thought it would be a good idea to do that? *In case you didn't know, <a href="http://us.php.net/manual/en/language.operators.errorcontrol.php">@ suppresses any errors</a> on what appears to be the entire line of code, or at least the ones inside the scope.</p>
<p>So I dropped the @, received my long awaited error message, and could finally move on developing whatever it was I was doing in the first place.</p>
<h3>The Closure</h3>
<p>I found my problem where I was using my own helper called 'string', which was causing CI's helper not to load. I renamed it, and everything's back to normal.</p>
<p>I've never contributed to an open source applications, although I've always felt I wanted to, but was nervous that I might screw something up, or do something wrong. I feel like CI would be a great project for me to contribute to. I already have a few things I'd like to add, but I'm not really sure how to go about doing it. Is there some sort of etiquette to getting involved? Is there a set of rules I should know? Should I be nervous about breaking something when it seems like there are already developers working on it that leave @ symbols instead of writing the necessary code to handle any issues? I would love to get some feedback on this sort of thing.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.briandichiara.com/our-first-big-fight/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remap function for CodeIgniter</title>
		<link>http://blog.briandichiara.com/remap-function-for-codeigniter/</link>
		<comments>http://blog.briandichiara.com/remap-function-for-codeigniter/#comments</comments>
		<pubDate>Mon, 27 Jul 2009 03:59:19 +0000</pubDate>
		<dc:creator>briandichiara</dc:creator>
				<category><![CDATA[Bin]]></category>

		<guid isPermaLink="false">http://blog.briandichiara.com/remap-function-for-codeingiter/</guid>
		<description><![CDATA[I got tired of looking for this code in other projects so I wanted a handy place to keep it.
PLAIN TEXT
PHP:




&#60;?php


function _remap&#40;$method&#41;


&#123;


&#160; &#160; if &#40;method_exists&#40;$this, $method&#41;&#41;&#123;


&#160; &#160; &#160; &#160; $this-&#62;$method&#40;$this-&#62;uri-&#62;segment&#40;3&#41;&#41;;


&#160; &#160; &#125; else &#123;


&#160; &#160; &#160; &#160; $this-&#62;index&#40;$method&#41;;


&#160; &#160; &#125;


&#125;


?&#62; 






In case you're wondering, this function is a reserved method in CodeIgniter controllers that will [...]]]></description>
			<content:encoded><![CDATA[<p>I got tired of looking for this code in other projects so I wanted a handy place to keep it.</p>
<div class="igBar"><span id="lphp-8"><a href="#" onclick="javascript:showPlainTxt('php-8'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-8">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">function</span> _remap<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$method</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/method_exists"><span style="color:#000066;">method_exists</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$this</span>, <span style="color:#0000FF;">$method</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#0000FF;">$method</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">uri</span>-&gt;<span style="color:#006600;">segment</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;color:#800000;">3</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#616100;">else</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">index</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$method</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
In case you're wondering, this function is a reserved method in CodeIgniter controllers that will allow for a dynamic method name to be passed into the URL. Docs on it are here: <a href="http://codeigniter.com/user_guide/general/controllers.html#remapping" target="_blank">codeigniter.com/user_guide/general/controllers.html#remapping</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.briandichiara.com/remap-function-for-codeigniter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Backwards Text in Gmail App</title>
		<link>http://blog.briandichiara.com/backwards-text-in-gmail-app/</link>
		<comments>http://blog.briandichiara.com/backwards-text-in-gmail-app/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 03:15:31 +0000</pubDate>
		<dc:creator>briandichiara</dc:creator>
				<category><![CDATA[Bin]]></category>

		<guid isPermaLink="false">http://blog.briandichiara.com/backwards-text-in-gmail-app/</guid>
		<description><![CDATA[
I'm not sure exactly what happened here, but this is what I saw when I re-opened Chrome and my Gmail Tab that was left open got restored. Any ideas?
]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.briandichiara.com/wp-content/uploads/2009/07/backwards-gmail.jpg" rel="lightbox"><img src="http://blog.briandichiara.com/wp-content/uploads/2009/07/backwards-gmail-300x96.jpg" alt="backwards-gmail" title="backwards-gmail" width="300" height="96" class="alignleft size-medium wp-image-131" /></a><br />
I'm not sure exactly what happened here, but this is what I saw when I re-opened Chrome and my Gmail Tab that was left open got restored. Any ideas?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.briandichiara.com/backwards-text-in-gmail-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why &#8220;hiding&#8221; source code is bad.</title>
		<link>http://blog.briandichiara.com/why-hiding-source-code-is-bad/</link>
		<comments>http://blog.briandichiara.com/why-hiding-source-code-is-bad/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 21:48:58 +0000</pubDate>
		<dc:creator>briandichiara</dc:creator>
				<category><![CDATA[Bin]]></category>

		<guid isPermaLink="false">http://blog.briandichiara.com/?p=125</guid>
		<description><![CDATA[I've been working at my current employer for about 5 months now and since I started, I have been involved in or heard this conversation more than 10 times, which is 10 times more than I've heard within the past 7 years I've been doing web development. The client wants their source code hidden from [...]]]></description>
			<content:encoded><![CDATA[<p>I've been working at my current employer for about 5 months now and since I started, I have been involved in or heard this conversation more than 10 times, which is 10 times more than I've heard within the past 7 years I've been doing web development. <strong>The client wants their source code hidden from public view.</strong></p>
<p>Let me first explain where I feel the communication has failed. The client says "Source code", however they may mean "Application code". To the client, when they "View Source", they may not know exactly what they are looking at, all they see is code. If they don't understand the difference between HTML code and Server side code (PHP/.NET/JSP), they feel like the code that makes their site work could be compromised. It is imperative that the client understand the difference between these 2 types of code and that their server side source code is safe.</p>
<p><span id="more-125"></span></p>
<p>Moving forward, if they completely understand the above information, here are some of the reasons clients may want their source code hidden, some of which are very valid requests, in my opinion, however their lack of knowledge on the subject limits their ability to come up with real solutions to the problems.</p>
<ul>
<li>Their site is unique, and they don't want it replicated.</li>
<li>They have login forms on their site they want to protect even further.</li>
<li>Robot/Spam prevention</li>
<li>and the number one reason: <strong>Phishing Protection</strong></li>
</ul>
<p>There are plenty of good reasons to protect your website from the things mentioned above, however trying to hide the source code is not the solution. The current measures on the web for hiding the source code is as follows, in order from least effective to most effective:</p>
<ol>
<li>Disable Right Click</li>
<li>Adding X number of blank lines at the top of the source code.</li>
<li>Using a Javascript Source encrypter to change the way the rendered source looks. - There are many different versions of this out there.</li>
<li>Design entire site in Flash</li>
<li>Design entire site in Java</li>
<li>Restrict access to your site to only users with HTTP Authorization</li>
<li>Remove your website from the internet</li>
</ol>
<p>Obviously the last 4 are quite ridiculous, however I felt the need to mention them due to the number of times I've tried convincing clients how ignorant trying to hide the source code is. Here is why all the items above are bad:</p>
<ol>
<li>Easy to get around, doesn't stop Menu commands and keyboard shortcuts, loses functionality on your website.</li>
<li>Will only foil CEOs and Bigwigs, not the actual people you're trying to protect the code from.</li>
<li>Slows down site, fails horribly, DOM source still easily visible.</li>
<li>Probably the "best" solution, but costs a bit more, and doesn't prevent screenshots, not SEO friendly</li>
<li>Costs a whole lot more, requires all visitors to have Java plugin installed</li>
<li>Requires everyone to log into the site before doing anything.</li>
<li>Makes it impossible for visitors to get to your website.</li>
</ol>
<p>After discussing this several times in the past few months, I could go on and on listing reasons against these practices, however to be a bit more practical, let's take a look at some companies that would do this if it was at all worth it:</p>
<ul>
<li><a href="http://www.bankofamerica.com/" target="_blank">Bank of America</a></li>
<li><a href="http://www.wellsfargo.com/" target="_blank">Wells Fargo</a></li>
<li><a href="http://gmail.google.com/" target="_blank">Gmail (Google)</a></li>
<li><a href="http://www.etrade.com/" target="_blank">E Trade</a></li>
<li><a href="http://www.godaddy.com/" target="_blank">GoDaddy</a></li>
</ul>
<p>If you'll notice, none of these websites are practicing any of the methods mentioned above. There's good reason. Because they are useless. They do nothing but slow down your visitors experience to get what they came to your site for. It's my understanding that the ultimate goal of web design is to attract visitors to your site, and by doing the things mentioned above, you would be driving traffic away from your site.</p>
<p><a href="http://www.felgall.com/htmlt4.htm">Here's a page</a> that has more information on this subject and further explains how unnecessary these attempts are.</p>
<p>Are there any developers or web shops out there running into this problem, particularly with credit unions or financial institutions?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.briandichiara.com/why-hiding-source-code-is-bad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Review of LG enV3 (VX9200)</title>
		<link>http://blog.briandichiara.com/review-of-lg-env3-vx9200/</link>
		<comments>http://blog.briandichiara.com/review-of-lg-env3-vx9200/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 00:50:03 +0000</pubDate>
		<dc:creator>briandichiara</dc:creator>
				<category><![CDATA[Bin]]></category>

		<guid isPermaLink="false">http://blog.briandichiara.com/?p=96</guid>
		<description><![CDATA[ I upgraded my mobile device yesterday (relative to when I started this post on June 10th) from the LG VX8600 (Chocolate2 Flip) to the brand new enV3 (VX9200). I've already seen a few reviews out there, however it seems most, if not all have reviewed the slate blue, and not the maroon (red). I [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.briandichiara.com/wp-content/uploads/2009/06/env3-front.jpg" rel="lightbox"><img src="http://blog.briandichiara.com/wp-content/uploads/2009/06/env3-front-150x150.jpg" alt="env3-front" title="env3-front" width="150" height="150" class="alignleft size-thumbnail wp-image-99" /></a> I upgraded my mobile device yesterday (relative to when I started this post on June 10th) from the LG VX8600 (Chocolate2 Flip) to the brand new enV3 (VX9200). I've already seen a <a href="http://www.youtube.com/watch?v=852CeG-MoPg" target="_blank">few</a> <a href="http://dailyphones.blogspot.com/2009/06/lg-env3-video-review.html" target="_blank">reviews</a> out there, however it seems most, if not all have reviewed the slate blue, and not the maroon (red). I actually got the maroon version by mistake, however I actually like it, probably more than I would've the blue version. Let me tell you this is a great mobile device! I say mobile device because phone just doesn't cut it. It is packed with features, yet isn't so complicated to make usage difficult. Video below, or you can read the text version after the jump.</p>
<p>[video review <del datetime="2009-12-01T05:39:02+00:00">to be posted shortly</del> not coming <img src='http://blog.briandichiara.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> ]</p>
<p><span id="more-96"></span><br />
I've been up for my new every two with Verizon since April and have been looking at phones ever since, although wasn't quite ready to replace my Chocolate2, plus I wanted to find a phone that suit me best. I like a sleek, compact design that is very functional. I love my Chocolate2 for it's thin size, external screen (where I can read text messages), and ease of use. I knew when I got a replacement, I'd probably get an LG. I'm a huge fan after switching from Motorola about 2 years ago.</p>
<p>The enV3 has a pretty decent size external display that is 10x more functional than the Chocolate2. Not only can I read text messages, but I can browse contacts (even add contacts), send messages, view call history, see my photos, and adjust bluetooth settings. The external keypad makes this phone extremely exceptional and a very easy transition from the Chocolate2 to a QWERTY phone. I actually find myself going back and forth to send text messages, depending on the length of my message.</p>
<h3>So here are some things you've probably heard</h3>
<ul>
<li>2.6" Internal Display, 1.56" External Display</li>
<li>Full QWERTY Keyboard</li>
<li>3.0 Megapixel Camera &#038; Camcorder with Flash</li>
<li>Full HTML Web Browser (with Javascript)</li>
<li>Up to 16GB microSD Memory Slot</li>
<li style="margin-bottom:0; padding-bottom:1px;">Battery Life:
<ul>
<li style="margin-top:0; padding-top:1px; margin-bottom:0; padding-bottom:1px;">Usage Time: 327 Minutes (approx. 5.5 hours)</li>
<li style="margin-top:0; padding-top:1px;">Standby Time: 460 Hours (approx. 19 days)</li>
</ul>
</li>
</ul>
<h3>Things you may not have already heard</h3>
<ul>
<li>Watch YouTube videos, browse Facebook and Twitter, and other standard web activities.</li>
<li>Photo manipulation including, rotate, zoom, crop and more</li>
<li>Support for Visual Voicemail</li>
<li>Voice Readout for text messages</li>
<li>Threaded Message View</li>
<li>Camera Panorama Mode (5 guided shots in a row for wide area view)</li>
<li>Contacts Favorites (with dedicated key)</li>
</ul>
<p>I mainly wanted to focus on some of the things left off in other reviews. Firstly, the Maroon phone, although it may look "pinkish" in the photos, it's actually Maroon. It's almost a crimson color, so don't be afraid of it's color. I don't think LG was going for "his and hers" versions. The phone comes with a multi-purpose charging cable, which doubles as a USB device cable. The data/charge port is on the bottom and is <a href="http://media.digikey.com/photos/Hirose%20Elect%20Photos/MFG-H11489-ND,%20H11503-ND,%20H11504-ND.jpg" target="_blank">MicroUSB</a>, which may or may not be the standard mobile phone charging port.</p>
<p>The back of the phone has a nice rubber-like grip feel to it, making it easy to hold, as well as cutting back on a whole lot of ugly smudging and some of the fancier glossy phones.</p>
<p><a href="http://blog.briandichiara.com/wp-content/uploads/2009/06/env3-open-470x427.jpg" rel="lightbox"><img src="http://blog.briandichiara.com/wp-content/uploads/2009/06/env3-open-470x427-300x272.jpg" alt="env3-open-470x427" title="env3-open-470x427" width="300" height="272" class="alignright size-medium wp-image-107" /></a></p>
<p>One review I saw mentioned how distracting the 2,Q,W,E, and S keys were (optional directional gaming keys), however it seems to be only a major problem on the Blue Slate version. The Maroon keys only stand out slightly and are not a distraction (photo on right does not accurately depict gray colored keys; in reality they're a bit darker). I believe it was the same review that mentioned there was no zoom buttons available on the web browser, without going into a special Zoom menu, however if the reviewer had played with the phone for more than 5 minutes, they would have found out that the browser will zoom in/out with the Volume up/down keys located on the side of the phone. Additionally, the reviewer mentioned the browser navigation was a bit slow/choppy, unresponsive to up/down commands to scroll. I'm not sure if this is something LG has fixed after his review, but scrolling on mine is excellent and smooth. It also doesn't pool scroll commands when they don't execute, so you don't get that rapid 50 zooms in a row after it completes whatever process it's doing.</p>
<p>The external directional keys function like shortcut keys, however can be easily overlooked with the functionality of the OK (menu) key. You can quickly access Music (up), Photos (left), Bluetooth (right), and Messaging (down) with these keys. Lastly, I just want to say the keyboard is phenomenal. I consider myself to have large fingers and would go crazy with a keyboard where the keys were too tiny for me to use. I actually tested many of the QWERTY (why do I always want to type a U after the Q...) keyboard designs, and this one is very easy to type on.</p>
<h3>I only have just a few gripes, but nothing too bad</h3>
<p>The camera button only serves camera functionality. On my VX8600, I could press the camera button again to switch to camcorder mode, however on the VX9200 you must go to Pictures and Video > Record Video to access the camcorder function.</p>
<p>When taking pictures, your photo subject must be fairly still. So far I've gotten quite a few blurry photos from the camera, although I must say, the flash helps a lot with clarity. The manual simply says "Avoid jolting the camera." and cleverly enough "Do not cover the lens with your finger."</p>
<p>The way the phone is designed makes it a bit difficult to wipe the internal screen with a t-shirt or cloth due need to access the side buttons while the phone is open. Not sure of a better way to have done this, but I typically will rub the phone on my shirt or pants leg to clear any smudges off the screen, as do a lot of people from what I've seen.</p>
<p>Even though they crammed a whole lot more keys into the internal keypad than the average phone, I feel maybe the layout didn't "click" with me right off. I feel like the clear/speakerphone keys and send/end key should be swapped, putting clear closer to where the backspace key should be, and end key at bottom right, where i typically look to escape or back out of stuff. I don't know maybe it's just me, maybe I just need to get used to, but I find myself hitting the speakerphone key all the time trying to clear out of a menu.</p>
<h3>A few other things to note</h3>
<p>The phone comes with protective plastic coating stuck to it from the manufacturer. I removed most of it, but left the two pieces on both displays. They do not bother me or get in the way and will help make them last a bit longer.</p>
<p>I tend to use my phone as a flashlight, so I changed my external display theme to a much brighter white-colored theme, which makes it a bit brighter when navigating through dark room.</p>
<p>Also, don't run out and buy a USB cable or Driver disk from eBay. This phone comes with the necessary USB cable (for charging and data connectivity) and the drivers can be found on Verizon's website (see link below).</p>
<h3>Here are some useful links</h3>
<ul>
<li><a href="http://estore.vzwshop.com/env3" target="_blank">Product Page</a> | <a href="http://www.lge.com/us/mobile-phones/LG-VX9200-Red.jsp" target="_blank">on LG's Site</a></li>
<li><a href="http://www.verizonwireless.com/b2c/store/controller?item=phoneFirst&#038;action=viewPhoneDetail&#038;selectedPhoneId=4746" target="_blank">Buy It</a></li>
<li><a href="http://vzam.net/vcastmusic/Step3.aspx?modelID=74&#038;driverFile=LGUSBModemDriver_WHQL_Eng_Ver_4.8.1.exe" target="_blank">Windows Software Drivers</a> | <a href="http://vzam.net/vcastmusic/Step2.aspx?manufacturerID=1" target="_blank">Alternate Link</a></li>
<li><a href='http://blog.briandichiara.com/wp-content/uploads/2009/06/env3-manual-english-sm.pdf'>Manual</a> (PDF) | <a href='http://blog.briandichiara.com/wp-content/uploads/2009/06/env3-datasheet-english-sm.pdf'>Datasheet</a> (PDF)</li>
</ul>
<h3>Some forum posts I've scouted out</h3>
<ul>
<li><a href='http://forums.mobiledia.com/viewtopic.php?p=266192'>enV3 and BitPim</a> - <a href="http://verizonwireless.howardforums.com/showthread.php?t=1532654">Also here.</a> - In summary, make sure you get BitPim 1.0.7 or greater for it to work successfully, otherwise, try Bluetooth.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.briandichiara.com/review-of-lg-env3-vx9200/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>jQuery + JSON + AJAX = My own custom solution.</title>
		<link>http://blog.briandichiara.com/jquery-json-ajax/</link>
		<comments>http://blog.briandichiara.com/jquery-json-ajax/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 18:44:39 +0000</pubDate>
		<dc:creator>briandichiara</dc:creator>
				<category><![CDATA[Bin]]></category>

		<guid isPermaLink="false">http://blog.briandichiara.com/?p=78</guid>
		<description><![CDATA[So. In an effort to come up with a solution to a very common AJAX problem (at least for me), I have put together a little tutorial for handling AJAX responses in a simple, yet effective manner. Here's the problem:
AJAX is used sometimes for validation, sometimes for quick little updates to the database, and other [...]]]></description>
			<content:encoded><![CDATA[<p>So. In an effort to come up with a solution to a very common AJAX problem (at least for me), I have put together a little tutorial for handling AJAX responses in a simple, yet effective manner. Here's the problem:</p>
<p>AJAX is used sometimes for validation, sometimes for quick little updates to the database, and other times for the same old add/edit/delete functions. There's an infinite ways AJAX can be used in your web application, so I'm pretty sure my solution will not work 100% of the time, but it may make things a little bit easier to handle 90% of the time.</p>
<p><span id="more-78"></span></p>
<p>So sometimes when you execute an AJAX request, you have a "positive" and a "negative" response. Positive meaning that the request performed successfully and you now want to do something with the positive response. It can also come back negative, like, it wasn't completed because the user's session timed out, or the data passed failed validation, or for some reason failed to do what it was supposed to do and a response needed to be sent back to the user. Please note, when I talk about "positive" and "negative" (and later "success"), I'm not referring to the default options for the $.ajax() method in jQuery for finding out if the AJAX request itself was successful (or encountered an error), however I'm referring to the actual result itself (assuming that the request was a success).</p>
<p>Let's get to the code and maybe make some sense of all this jabbering I'm doing.</p>
<p>To start out, you'll need the latest jQuery library (<a href="http://docs.jquery.com/Downloading_jQuery#Download_jQuery" target="_blank">found here</a>). </p>
<p>Place a reference to jquery inside your document's <code>&lt;head&gt;</code> tags.</p>
<div class="igBar"><span id="lhtml-14"><a href="#" onclick="javascript:showPlainTxt('html-14'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-14">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"text/javascript"</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">"jquery-1.3.2.min.js"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>I'm going to go ahead and put the necessary code here for usage, then I'll give a few examples.</p>
<div class="igBar"><span id="ljavascript-15"><a href="#" onclick="javascript:showPlainTxt('javascript-15'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span>
<div id="javascript-15">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">function</span> ajaxJSON<span style="color: #66cc66;">&#40;</span>json<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> obj = <span style="color: #66cc66;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span><span style="color: #66cc66;">&#40;</span>json<span style="color: #66cc66;">&#41;</span> == <span style="color: #3366CC;">'object'</span><span style="color: #66cc66;">&#41;</span> ? json : <span style="color: #000066; font-weight: bold;">eval</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'('</span> + json + <span style="color: #3366CC;">')'</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">eval</span><span style="color: #66cc66;">&#40;</span>obj.<span style="color: #006600;">script</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>obj.<span style="color: #000066;">confirm</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; obj.<span style="color: #006600;">success</span> = <span style="color: #000066;">confirm</span><span style="color: #66cc66;">&#40;</span>obj.<span style="color: #000066;">confirm</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> obj;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>As you can see, it's very simple (right now). All it does is converts your AJAX response from a string to an object, evaluates the scripts inside the object, then returns the object to your script, with the optional confirm dialog which will determine whether or not the result was a successful one (positive).</p>
<p>In PHP, there is a function called json_encode() which will convert an array into a JSON object. Other application languages may have something similar, or you can just create the JSON string by hand. Here are a <a href="http://www.json.org/js.html" target="_blank">couple</a> of <a href="http://www.prototypejs.org/learn/json">links</a> you want more information about JSON.</p>
<p>So below is my sample AJAX application.</p>
<div class="igBar"><span id="lhtml-16"><a href="#" onclick="javascript:showPlainTxt('html-16'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-16">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00bbdd;">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/html.html"><span style="color: #000000; font-weight: bold;">&lt;html</span></a> xmlns=<span style="color: #ff0000;">"http://www.w3.org/1999/xhtml"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/head.html"><span style="color: #000000; font-weight: bold;">&lt;head&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/meta.html"><span style="color: #000000; font-weight: bold;">&lt;meta</span></a> <span style="color: #000066;">http-equiv</span>=<span style="color: #ff0000;">"Content-Type"</span> <span style="color: #000066;">content</span>=<span style="color: #ff0000;">"text/html; charset=utf-8"</span> /<span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/title.html"><span style="color: #000000; font-weight: bold;">&lt;title&gt;</span></a></span>AJAX + JSON = Organized Responses<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/title&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"text/javascript"</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">"/jquery-1.3.2.min.js"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"text/javascript"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; // this will parse scripts, execute the confirm if applicable and return the object for further use</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; function ajaxJSON(json){</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var obj = (typeof(json) == 'object') ? json : eval('(' + json + ')');</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; eval(obj.script);</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(obj.confirm){</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; obj.success = confirm(obj.confirm);</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return obj;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; }</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; $(function(r){</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $(&quot;#my_form&quot;).submit(function(s){</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var params = $(this).serialize();</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $.ajax({</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; type: 'post',</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; url: 'products_ajax/add/',</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; data: params,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dataType: 'json',</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; success: function(response){</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; result = ajaxJSON(response);</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(result.html){</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(result.success){</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $(&quot;.error&quot;).hide();</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $(&quot;#response&quot;).show().html(result.html);</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // reset my form to get ready for a new entry</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $('#my_form').each(function(e){</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.reset();</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; });</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else {</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $(&quot;#response&quot;).hide();</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $(&quot;.error&quot;).show().html(result.html);</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; focus_first();</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; });</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /*</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // A non-async way to use this is:</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var response = $.ajax({</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; type: 'post',</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; url: 'products_ajax/add/',</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; data: params,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dataType: 'json',</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; async: false</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }).responseText;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; result = ajaxJSON(response);</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(result.html){</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(result.success){</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $(&quot;.error&quot;).hide();</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $(&quot;#response&quot;).show().html(result.html);</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // reset my form to get ready for a new entry</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $('#my_form').each(function(e){</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.reset();</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; });</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else {</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $(&quot;#response&quot;).hide();</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $(&quot;.error&quot;).show().html(result.html);</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; focus_first();</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // you may want to submit the form with the following line</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //return result.success;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; */</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return false;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; });</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // form init</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; focus_first();</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $(&quot;a.delete&quot;).live('click', function(c){</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(confirm('Are you sure?')){</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $(this).parents('div:first').remove();</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; focus_first();</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return false;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; });</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; });</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; function focus_first(){</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $(&quot;#my_form input[type=text][value='']:first&quot;).focus();</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; }</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/style.html"><span style="color: #000000; font-weight: bold;">&lt;style</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"text/css"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; #response { color:#090; }</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; .error { color:#F00; }</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; #my_form, #products { float:left; width:300px; }</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/style&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/head&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/body.html"><span style="color: #000000; font-weight: bold;">&lt;body&gt;</span></a></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"response"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span><span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- successful response message --&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">"error"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span><span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- error response message --&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/form.html"><span style="color: #000000; font-weight: bold;">&lt;form</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"my_form"</span> <span style="color: #000066;">action</span>=<span style="color: #ff0000;">"/"</span> <span style="color: #000066;">method</span>=<span style="color: #ff0000;">"post"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/fieldset.html"><span style="color: #000000; font-weight: bold;">&lt;fieldset&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/legend.html"><span style="color: #000000; font-weight: bold;">&lt;legend&gt;</span></a></span>Add a Product<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/legend&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></a></span><span style="color: #009900;"><a href="http://december.com/html/4/element/label.html"><span style="color: #000000; font-weight: bold;">&lt;label&gt;</span></a></span>Description: <span style="color: #009900;"><a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">&lt;input</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"text"</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">"description"</span> /<span style="color: #000000; font-weight: bold;">&gt;</span></a></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/label&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></a></span><span style="color: #009900;"><a href="http://december.com/html/4/element/label.html"><span style="color: #000000; font-weight: bold;">&lt;label&gt;</span></a></span>SKU: <span style="color: #009900;"><a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">&lt;input</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"text"</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">"sku"</span> /<span style="color: #000000; font-weight: bold;">&gt;</span></a></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/label&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">&lt;input</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"submit"</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">"Go!"</span> /<span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/fieldset&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/form&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"products"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/h2.html"><span style="color: #000000; font-weight: bold;">&lt;h2&gt;</span></a></span>Products<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/h2&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/body&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/html&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>My AJAX response page:</p>
<div class="igBar"><span id="lphp-17"><a href="#" onclick="javascript:showPlainTxt('php-17'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-17">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$description</span> = <a href="http://www.php.net/trim"><span style="color:#000066;">trim</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$_POST</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'description'</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$sku</span> = <a href="http://www.php.net/trim"><span style="color:#000066;">trim</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$_POST</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'sku'</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$result</span> = <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/empty"><span style="color:#000066;">empty</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$description</span><span style="color:#006600; font-weight:bold;">&#41;</span> || <a href="http://www.php.net/empty"><span style="color:#000066;">empty</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$sku</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$result</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'html'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#FF0000;">'Please fill in all required fields.'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$result</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'success'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#000000; font-weight:bold;">false</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#616100;">else</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$result</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'html'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#FF0000;">'Your product was added successfully.'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$result</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'success'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#000000; font-weight:bold;">true</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#008000;">/* I'd also like to add the product to a list of products on the page. */</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$product_string</span> = <span style="color:#FF0000;">'$(&quot;#products&quot;).append(<span style="color:#000099; font-weight:bold;">\'</span>&lt;div&gt;%s (%s) - &lt;a href=&quot;#delete&quot; class=&quot;delete&quot;&gt;delete&lt;/a&gt;&lt;/div&gt;<span style="color:#000099; font-weight:bold;">\'</span>);'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$result</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'script'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <a href="http://www.php.net/sprintf"><span style="color:#000066;">sprintf</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$product_string</span>, <span style="color:#0000FF;">$description</span>, <span style="color:#0000FF;">$sku</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> json_encode<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$result</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/exit"><span style="color:#000066;">exit</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Please note my example is very simple and basic. Also note, in my example, I'm using an asynchronous request. A non-asynchronous request is required if you want to use the Confirm dialog to determine the success of your request (as well as if you want to use your success value to determine whether or not to submit the form), you'll want to use the option async:false. (see the 2nd commented out example)</p>
<p>So I hope this makes sense. I wrote this to either encourage consistency with AJAX results, so anybody picking up someone else's project can make heads or tails as to what's going on with AJAX results, or in hopes that someone would look at it, see the effort I'm trying to make and provide a better solution to this problem.</p>
<p>The reason I went this route is mainly because I've been getting into working with an MVC (<a href="http://codeigniter.com" target="_blank">CodeIgniter</a>) and a lot of functionality is based off Arrays which makes programming highly flexible and dynamic. I figured to do this in Javascript, it was either with JSON or XML. I felt like it's only right to use JSON with Javascript since they pretty much go hand in hand. Plus with the hopeful addition to jQuery to support JSON parsing, it could be very powerful.</p>
<p>I'm using this on a current project and so far it's been working pretty good. I went ahead and created a PHP Class for this, which is easily integrated into CodeIgniter. It too is very simple. I called it Cajax because I typically will create a Controller called Ajax so I didn't want it to conflict. See below:</p>
<div class="igBar"><span id="lphp-18"><a href="#" onclick="javascript:showPlainTxt('php-18'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-18">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span> <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span> ! <a href="http://www.php.net/defined"><span style="color:#000066;">defined</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'BASEPATH'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <a href="http://www.php.net/exit"><span style="color:#000066;">exit</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'No direct script access allowed'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">class</span> Cajax <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; private <span style="color:#0000FF;">$ci</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; private <span style="color:#0000FF;">$result</span> = <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">function</span> Cajax<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// uncomment the next line if you want CI access</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">//$this-&gt;ci = get_instance();</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">function</span> add<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$data</span>, <span style="color:#0000FF;">$key</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/isset"><span style="color:#000066;">isset</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">result</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$key</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> &amp;&amp; !<a href="http://www.php.net/empty"><span style="color:#000066;">empty</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">result</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$key</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">result</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$key</span><span style="color:#006600; font-weight:bold;">&#93;</span> .= <span style="color:#0000FF;">$data</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#616100;">else</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">result</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$key</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#0000FF;">$data</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">function</span> add_html<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$html</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">add</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$html</span>, <span style="color:#FF0000;">'html'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">function</span> add_script<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$script</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">add</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$script</span>, <span style="color:#FF0000;">'script'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">function</span> add_text<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$text</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">add</span><span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/strip_tags"><span style="color:#000066;">strip_tags</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$text</span><span style="color:#006600; font-weight:bold;">&#41;</span>, <span style="color:#FF0000;">'text'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">function</span> success<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$val</span>=<span style="color:#000000; font-weight:bold;">true</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">result</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'success'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#0000FF;">$val</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">function</span> confirm<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$confirm</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">result</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'confirm'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#0000FF;">$confirm</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">function</span> restrict<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$loggedin</span>, <span style="color:#0000FF;">$redirect</span>=<span style="color:#FF0000;">'/login/'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span>!<span style="color:#0000FF;">$loggedin</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">add_script</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'alert(&quot;Your session is no longer valid. Press OK to be taken to login page.&quot;); window.location = &quot;'</span>.<span style="color:#0000FF;">$redirect</span>.<span style="color:#FF0000;">'&quot;;'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">finish</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">function</span> finish<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$success</span>=<span style="color:#000000; font-weight:bold;">NULL</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$success</span> != <span style="color:#000000; font-weight:bold;">NULL</span> &amp;&amp; <a href="http://www.php.net/is_bool"><span style="color:#000066;">is_bool</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$success</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">success</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$success</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/count"><span style="color:#000066;">count</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">result</span><span style="color:#006600; font-weight:bold;">&#41;</span>&gt; <span style="color:#CC66CC;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> json_encode<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">result</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/exit"><span style="color:#000066;">exit</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Please comment to let me know what you think, or how you would modify this method, or if you think you have a better solution. I'd love to hear it. Thanks for reading!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.briandichiara.com/jquery-json-ajax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
