<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>Cohesive Web</title>
	
	<link>http://blog.webconsultingengineering.com</link>
	<description>In search of reasons for web addiction</description>
	<lastBuildDate>Tue, 12 Jan 2010 12:00:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/CohesiveWeb" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="cohesiveweb" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>QuickForm and AutoSuggest</title>
		<link>http://blog.webconsultingengineering.com/phptalk/quickform-autosuggest.html</link>
		<comments>http://blog.webconsultingengineering.com/phptalk/quickform-autosuggest.html#comments</comments>
		<pubDate>Tue, 12 Jan 2010 11:23:10 +0000</pubDate>
		<dc:creator>Susenjit</dc:creator>
				<category><![CDATA[Php Talk]]></category>
		<category><![CDATA[autosuggest]]></category>
		<category><![CDATA[dbtable]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[pear]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[quickform]]></category>

		<guid isPermaLink="false">http://blog.webconsultingengineering.com/?p=70</guid>
		<description><![CDATA[ The best example of auttosuggest filed I can instantly think of is Google. While designing dynamic forms I felt the requirement of such field. As I mostly use PEAR class and HTML Quickform to design dynamic forms in php. However in HTML Quickform there is autocomplete type but still there is no support for [...]]]></description>
			<content:encoded><![CDATA[<!-- This is a HTML comment, it will not display in any page. Feel free to remove this comment if it cause any inconvenient to you.
	Thanks for using digg digg, please visit http://www.mkyong.com/blog/digg-digg-wordpress-plugin for any comments and ideas, 
	
    Author : Yong Mook Kim
    Website : http://www.mkyong.com
	--><div style='float:right'><table> <td><iframe src='http://digg.com/api/diggthis.php?w=new&amp;u=http://blog.webconsultingengineering.com/phptalk/quickform-autosuggest.html&amp;t=QuickForm+and+AutoSuggest&amp;s=normal' height='80' width='52' frameborder='0' scrolling='no'></iframe></td></table></div><p>The best example of auttosuggest filed I can instantly think of is <a href="http://google.com" target="_blank">Google</a>. While designing dynamic forms I felt the requirement of such field. As I mostly use <a href="http://pear.php.net/" target="_blank">PEAR</a> class and <a href="http://pear.php.net/package/HTML_QuickForm" target="_blank">HTML Quickform</a> to design dynamic forms in php. However in HTML Quickform there is autocomplete type but still there is no support for autosuggest. I googled a lot to get such support, but found it out in RFC of HTML Quickform. So I started working upon it. My first job was to found out a autosuggest Javascript code suitable for integration. I searched out an autocomplete javascript code by <a href="http://www.beauscott.com" target="_blank">Beau D. Scott</a></p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-2303357471658970";
/* blog inside 071708 */
google_ad_slot = "2791882164";
google_ad_width = 460;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>The reasons why I selected Beau’s code is :<br />
The code is simple to use but robust and has good documentation.<br />
It uses standard JS library like prototype and scriptaculous.</p>
<p>Now having previous knowledge of integration of <a title="QuickForm and Jscalender" href="http://blog.webconsultingengineering.com/phptalk/quickform-jscalendar.html">QuickForm and Jscalender</a> I created the code for autosuggest class. This autosuggest class file contains constructor function, toHtml function which generates the HTML code for the field, getFrozenHtml function to return the autosuggest content in HTML and finally the registering process of the autosuggest type with HTML QuickForm. I put this autosuggest class name as autosuggestwce. View this <a title="File - wceautosuggest.php" href="http://blog.webconsultingengineering.com/wp-content/uploads/wceautosuggest.php.txt">wceautosuggest.php</a> file.</p>
<p>To use this autosuggest field in HTML Quickform you need to have 3 javascript files as prototype.js, scriptaculous.js and autocomplete.js. Prototype Javascript is used for javascript framework, Scriptaculous for show and hide effect and AutoComplete is the main javascript functionality file. Among them scriptaculous.js can be removed if you don’t like to show effects, but you need to modify certain section in the wceautosuggest.php file. You also need to declare <strong>$GLOBALS['_HTML_QUICKFORM_AUTOSUGGEST_BASEPATH']</strong> the global path defining variable for the javascript files path in the page where you will generate the form.</p>
<p>This autosuggest uses php script to populate values. The name of the php script has to be mentioned in the $attribute array for the key ‘fileref’.</p>
<p>If you are using DB_Table here is snippet of code</p>
<p class="code"><code>'user_name' =&gt; array(<br />
'type' =&gt; 'varchar',<br />
'size' =&gt; 255,<br />
'qf_type' =&gt; 'autosuggestwce',<br />
'qf_label'=&gt; 'UserName:',<br />
'require' =&gt; false,<br />
'qf_attrs' =&gt; array(<br />
'id' =&gt; 'user_name_autosuggest',<br />
'autocomplete' =&gt; 'off',<br />
'fileref' =&gt; 'getusersname.php',<br />
),<br />
),</code></p>
<p>If you are using QuickForm directly then here is the code snippet</p>
<p class="code"><code>$form = new HTML_QuickForm('someTest', 'get');<br />
$form-&gt;addElement('autosuggestwce', 'username', 'UserName:', "array('id' =&gt; 'user_name_autosuggest', 'autocomplete' =&gt; 'off', 'fileref' =&gt; 'getusersname.php')");<br />
$form-&gt;display();</code></p>
<p>Here is the code segment of php script</p>
<p class="code"><code>&lt;?php<br />
$UsrObj = new CLUsrChk($DBObj, 'hllqz_tblusers');<br />
$SqlStatement = "SLECT user_name FROM ".$UsrObj-&gt;table." WHERE user_name LIKE ('".$_GET['s']."%')";<br />
$UsrNameArray = $UsrObj-&gt;bd-&gt;query($SqlStatement);<br />
echo json_encode($UsrNameArray);<br />
?&gt;</code></p>
<p>Here is the screenshot</p>
<p style="text-align: center;"><img style="border: black 1px solid;" title="autosuggest_field" src="http://blog.webconsultingengineering.com/wp-content/uploads/autosuggest_field.gif" alt="autosuggest_field" width="307" height="104" /><br />
<img class="aligncenter size-full wp-image-73" style="border: black 1px solid;" title="autosuggest_filed_populated" src="http://blog.webconsultingengineering.com/wp-content/uploads/autosuggest_filed_populated.gif" alt="autosuggest_filed_populated" width="304" height="207" />
</p>
<p>However if you require the files for your reference please let me about that.</p>
<p>I was planning to do this post almost a month ago but I was busy with learning another Javascript framework <a title="jQuery" href="http://jquery.com" target="_blank">jQuery</a>. I am started loving it. Hope I will be able to post something about jQuery in near future.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.webconsultingengineering.com/phptalk/quickform-autosuggest.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web site hacked via HTACCESS</title>
		<link>http://blog.webconsultingengineering.com/phptalk/website-hacked.html</link>
		<comments>http://blog.webconsultingengineering.com/phptalk/website-hacked.html#comments</comments>
		<pubDate>Mon, 09 Nov 2009 13:17:01 +0000</pubDate>
		<dc:creator>Susenjit</dc:creator>
				<category><![CDATA[Php Talk]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[site hacked]]></category>
		<category><![CDATA[URL rewriting]]></category>

		<guid isPermaLink="false">http://blog.webconsultingengineering.com/?p=62</guid>
		<description><![CDATA[ Here is another example how your site got hacked. I found this instance very recently in Godaddy server. This type of site hacking is not very common. You may not be able to detect any specific web page infected if you search your site using Google Diagonestic tool for safe browsing mentioned in my [...]]]></description>
			<content:encoded><![CDATA[<!-- This is a HTML comment, it will not display in any page. Feel free to remove this comment if it cause any inconvenient to you.
	Thanks for using digg digg, please visit http://www.mkyong.com/blog/digg-digg-wordpress-plugin for any comments and ideas, 
	
    Author : Yong Mook Kim
    Website : http://www.mkyong.com
	--><div style='float:right'><table> <td><iframe src='http://digg.com/api/diggthis.php?w=new&amp;u=http://blog.webconsultingengineering.com/phptalk/website-hacked.html&amp;t=Web+site+hacked+via+HTACCESS&amp;s=normal' height='80' width='52' frameborder='0' scrolling='no'></iframe></td></table></div><p>Here is another example how your site got hacked. I found this instance very recently in Godaddy server. This type of site hacking is not very common. You may not be able to detect any specific web page infected if you search your site using Google Diagonestic tool for safe browsing mentioned in my earlier post &#8211; <a title="Iframe code injection" href="http://blog.webconsultingengineering.com/phptalk/iframe-code-injection.html">Iframe code injection</a>. In this kind of attack none of your web pages get infected but your .htaccess file gets modified and becomes the main source of redirection to malware containing site. Let me show you an infected .htaccess file for example. </p>
<div id="attachment_63" class="wp-caption aligncenter" style="width: 514px"><img class="size-full wp-image-63" title="hacked_htaccess" src="http://blog.webconsultingengineering.com/wp-content/uploads/hacked_htaccess.gif" alt="hacked_htaccess" width="504" height="178" /><p class="wp-caption-text">Modified HTACCESS file used for hacking</p></div>
<p>Experienced developer can understand why this is so dangerous. Let me explain a little for the newbies. In case of apache web server configuration directives are described in httpd.conf file. Many cases this file can&#8217;t be accessed or modified due to security reasons. So to change some configuration directives for a specific website or its sub directory best solution is to use .htaccess file. To know further about .htaccess file and its functionality you can read <a title=".HTACCESS file" href="http://httpd.apache.org/docs/1.3/howto/htaccess.html">.htaccess files</a>. However URL rewriting, URL redirection, authentication are the important functionality .htaccess file are used for.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-2303357471658970";
/* blog inside 071708 */
google_ad_slot = "2791882164";
google_ad_width = 460;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>In the example htaccess file there are 3 sections. First line is for instructing the apache web server to put the rewrite engine on. This is first section. Second section goes from line no. 2 to line no. 8. This section is basically for condition checking on URL. Its checking if the visitors are coming from a website or page with URL containing the following words like google, aol, msn, yahoo, yandex, rambler or ya. <strong>NC</strong> means pattern checking will be case insensitive. <strong>OR</strong> means combines with other rule. Third section is in line no. 9. It says if any of the above pattern checking become true then it will redirect to the specified URL. Here <strong>R</strong> means redirection. Normally this generates HTTP response code 302 means moved temporarily. <strong>L</strong> means this is the last rule.</p>
<p>So the result is that if some visitor coming to the site from above specified search engine, they will be simply redirected to the malware site without understanding whats happening. So be careful if you come to know your site gotta hacked and youre unable to find out why then take a look at your .htaccess file.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.webconsultingengineering.com/phptalk/website-hacked.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The KBM-09</title>
		<link>http://blog.webconsultingengineering.com/off-beat/kbm09.html</link>
		<comments>http://blog.webconsultingengineering.com/off-beat/kbm09.html#comments</comments>
		<pubDate>Mon, 10 Aug 2009 13:39:05 +0000</pubDate>
		<dc:creator>Susenjit</dc:creator>
				<category><![CDATA[Off Beat]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[bloggers meet]]></category>

		<guid isPermaLink="false">http://blog.webconsultingengineering.com/?p=57</guid>
		<description><![CDATA[ Hey, if you are thinking that I am going to talk about a application or software, then stop thinking. Its not a sofware/code/appliaction or somthing like that. Its all about a successful event happened last Saturday on 8th August 2009. Its Kolkata Bloggers Meet 2009 organised by Webreps in Cafe Coffee Day, RDB Adlabs [...]]]></description>
			<content:encoded><![CDATA[<!-- This is a HTML comment, it will not display in any page. Feel free to remove this comment if it cause any inconvenient to you.
	Thanks for using digg digg, please visit http://www.mkyong.com/blog/digg-digg-wordpress-plugin for any comments and ideas, 
	
    Author : Yong Mook Kim
    Website : http://www.mkyong.com
	--><div style='float:right'><table> <td><iframe src='http://digg.com/api/diggthis.php?w=new&amp;u=http://blog.webconsultingengineering.com/off-beat/kbm09.html&amp;t=The+KBM-09&amp;s=normal' height='80' width='52' frameborder='0' scrolling='no'></iframe></td></table></div><p>Hey, if you are thinking that I am going to talk about a application or software, then stop thinking. Its not a sofware/code/appliaction or somthing like that. Its all about a successful event happened last Saturday on 8th August 2009. Its Kolkata Bloggers Meet 2009 organised by <a href="http://www.webreps.in/">Webreps</a> in Cafe Coffee Day, RDB Adlabs Sector V, Saltlake City.<br />
<div id="attachment_58" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.webconsultingengineering.com/wp-content/uploads/kbm1-01.jpg"><img src="http://blog.webconsultingengineering.com/wp-content/uploads/kbm1-01-300x224.jpg" alt="A cozy moment" title="KBM09" width="300" height="224" class="size-full wp-image-58" /></a><p class="wp-caption-text">A cozy moment</p></div></p>
<p>It was a wonderful evening with great atmosphere, good mass of perticipents, also good food and drink. I really enjoyed the evening and actually learnt a lot about blogging. Speeches from <a href="http://www.seoforclients.com/blog/">Aji Issac Mathew</a>, <a href="http://www.rentablogger.com/">Arun Agarwal</a>, Vikas Kedia, <a href="http://www.abhishekrungta.com/">Abhishek Rungta</a> and <a href="http://seo-kolkata.blogspot.com/">Saptarshi Roy Chaudhury</a> were really valuable inputs. Most interesting part was the interaction between bloggers. So many people exchanging ideas, thoughts upon such a topic called blogging. It is really unbelievable. I am damm sure that who ever wasn&#8217;t present over there missed a lot. More over I got chances to meet my old friends and colleagues specially <a href="http://www.iamanand.com/blog/">Anand</a> and Debasish. One thing I must say, I was almost spellbound when I saw <a href="http://pikachuz.net/">Soham&#8217;s</a> presentation.<br />
<div id="attachment_59" class="wp-caption aligncenter" style="width: 386px"><a href="http://blog.webconsultingengineering.com/wp-content/uploads/kbm1-02.jpg"><img src="http://blog.webconsultingengineering.com/wp-content/uploads/kbm1-02.jpg" alt="Our anchor" title="kbm1-02" width="376" height="282" class="size-full wp-image-59" /></a><p class="wp-caption-text">Our anchor</p></div><br />
<div id="attachment_60" class="wp-caption aligncenter" style="width: 377px"><a href="http://blog.webconsultingengineering.com/wp-content/uploads/kbm1-03.jpg"><img src="http://blog.webconsultingengineering.com/wp-content/uploads/kbm1-03.jpg" alt="Friends from Webreps" title="kbm1-03" width="367" height="242" class="size-full wp-image-60" /></a><p class="wp-caption-text">Friends from Webreps</p></div></p>
<p>I don&#8217;t have any dought upon the anchoring capabilities of <a href="http://www.oddseo.com/">Kamanashish</a> aka Mr. Doubt. Also I am very much sure that <a href="http://www.anirudhlohia.com/blog/">Anirudh</a>, <a href="http://webwings.blogspot.com/">Saikat</a>, <a href="http://www.smarthelpinghands.com/blog/">Simul</a> will be able to take the next meet in more bigger level. You guyes simply rocked. I like to thanks all the guyes and gals who were there and made the event successfull. Also thanks to <a href="http://www.cafecoffeeday.com/">Cafe Coffee Day</a> for creating such a cozy atmosphere.</p>
<p>The pictures taken by my <a href="http://www.nokia.co.in/find-products/products/nokia-e51">Nokia E51</a> are not so good, you should visit <a href="http://www.ygoel.com/2009/08/kolkata-bloggers-meet-2009-my-2nd.html">Yogesh&#8217;s post</a> for wonderfull pictures of Kolkata Bloggers Meet.</p>
<p>The meet gave a tremendous effect on me as a blogger (back banchers is approtiate for me). Surprisingly I am able to make this within few hours <img src='http://blog.webconsultingengineering.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' />  . I will surely going to spend more time for my blog and &#8230; wait and watch.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.webconsultingengineering.com/off-beat/kbm09.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Iframe code injection</title>
		<link>http://blog.webconsultingengineering.com/phptalk/iframe-code-injection.html</link>
		<comments>http://blog.webconsultingengineering.com/phptalk/iframe-code-injection.html#comments</comments>
		<pubDate>Thu, 30 Jul 2009 11:33:53 +0000</pubDate>
		<dc:creator>Susenjit</dc:creator>
				<category><![CDATA[Php Talk]]></category>
		<category><![CDATA[antivirus]]></category>
		<category><![CDATA[badware]]></category>
		<category><![CDATA[code injection]]></category>
		<category><![CDATA[Google warning]]></category>
		<category><![CDATA[hidden iframe]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Iframe]]></category>

		<guid isPermaLink="false">http://blog.webconsultingengineering.com/?p=50</guid>
		<description><![CDATA[ After a long days I am back for blog post. Last one month I was very much irritated with the problem occurred in some of my client website. In a Sunday morning while I was sleeping one of my client ranged me and asked me to check her website as she got a mail [...]]]></description>
			<content:encoded><![CDATA[<!-- This is a HTML comment, it will not display in any page. Feel free to remove this comment if it cause any inconvenient to you.
	Thanks for using digg digg, please visit http://www.mkyong.com/blog/digg-digg-wordpress-plugin for any comments and ideas, 
	
    Author : Yong Mook Kim
    Website : http://www.mkyong.com
	--><div style='float:right'><table> <td><iframe src='http://digg.com/api/diggthis.php?w=new&amp;u=http://blog.webconsultingengineering.com/phptalk/iframe-code-injection.html&amp;t=Iframe+code+injection&amp;s=normal' height='80' width='52' frameborder='0' scrolling='no'></iframe></td></table></div><p>After a long days I am back for blog post. Last one month I was very much irritated with the problem occurred in some of my client website. In a Sunday morning while I was sleeping one of my client ranged me and asked me to check her website as she got a mail from google that her website is spreading malware. I got confused as I had never faced this kind of problem. I started checking the website. But the antivirus in my Laptop didn&#8217;t allowed me to open the site at all. Then I decided to go to my office to check the situation.<br />
<!--adsense--><br />
In my office I checked the site thoroughly(OMG, I was able to open the site in my office). I found iframe code with hidden visibility was inserted in some pages. To be more specific index pages. I checked all the index pages in office PC, deleted the infected pages in the server and uploaded the pages from PC. Checked, cleaned all the html, php, temporary files. Almost near about afternoon I was back to my home while thinking how this happened.<br />
<div id="attachment_53" class="wp-caption aligncenter" style="width: 360px"><a href="http://blog.webconsultingengineering.com/wp-content/uploads/iframe_injected.gif"><img src="http://blog.webconsultingengineering.com/wp-content/uploads/iframe_injected.gif" alt="Iframe Injected" title="iframe_injected" width="350" height="256" class="size-full wp-image-53" /></a><p class="wp-caption-text">Iframe Injected</p></div></p>
<p>Next Morning after arriving in the office I started checking the website and I found it was again infected by the hidden iframe. Site url was different as earler it was .cn and next day it was .ru I was upset about how to fix the things. Believe me or not in the last one month this site got infected 27 times. Our team had experienced the same attack for 5 more site. It was a horrible experience for us. </p>
<p>We had done lot of googleing to find out the preventive measurement. We found out lots of information regarding this. Some of them are good and some of them are misleading too. So here I like to point out some effective ones only.</p>
<ol>
<li>You should have good antivirus installed in your system from where you access web. I am using <a href="http://www.avast.com">avast</a> free edition and it works fine for me.</li>
<li>Please check your websites on a regular basis. If you see if any web page with a blank section in the top them be almost sure that it is infected. Your antivirus should give you warning.</li>
<li>If you find any of your website get infected then start following the next steps.</li>
<li>First of all scan your machine with the antivirus. A boot time scan is more preferable.</li>
<li>Replace all the pages in the website using a local copy from your system. If the web site is too big to repalce then try to repalce all the pages with name index. Then check the site again.</li>
<li>Once the site is cleaned change the ftp details for the site and if possible do the same for the other sites whose details are kept in your ftp application.</li>
<li>Keep checking the site in a short span of interval.</li>
</ol>
<p>You should also check your site in google too. If google find out some problem with your site they may have shown a warning message like &#8220;This site may harm your computer&#8221;. Another way to check your site is </p>
<p>http://www.google.com/safebrowsing/diagnostic?site=http://www.yourdomain.tld</p>
<p>If you find that google is showing the warning message for your site you can request Google for a recheck via <a href="https://www.google.com/webmasters/tools/">Google Webmaster Tool</a>. But you should check the site twice after cleaning and then request for review.</p>
<p>However I have designed a code in php for checking mainly the index pages in the website. Here is the code.</p>
<p class="code"><code>&lt;?php<br />
// page-checker.php<br />
$path = ".";<br />
$baseDir = basename(dirname($_SERVER['PHP_SELF']));<br />
$WebPath = 'http://'.$_SERVER['HTTP_HOST'].'/'.$baseDir;<br />
$content_pattern = "iframe";<br />
echo "Checking files for IFRAME Infection&lt;br/&gt;";<br />
$dir_handle = @opendir($path) or die("Unable to open $path");<br />
echo "Directory Structure of $WebPath&lt;br/&gt;";<br />
navigate($dir_handle, $path, '');<br />
function navigate($dir_handle,$path, $WebPth)<br />
{<br />
   global $WebPath, $content_pattern;<br />
   echo "&lt;ul&gt;";<br />
   while (false !== ($file = readdir($dir_handle)))<br />
   {<br />
      $dir = $path.'/'.$file;<br />
      if(is_dir($dir) &amp;&amp; $file != '.' &#038;&#038; $file !='..' )<br />
      {<br />
         $handle = @opendir($dir) or die("undable to open file $file");<br />
         $WebRef = $file.'/';<br />
         navigate($handle, $dir, $WebRef);<br />
      }<br />
      elseif($file != '.' &amp;&amp; $file !='..')<br />
      {<br />
         if(preg_match('/^index+/',$file))<br />
         {<br />
            $ChcekFlag = FALSE;<br />
            echo "&lt;li&gt;";<br />
            echo "&lt;a href='".$WebPath.$WebPth.$file."'&gt;".$WebPth.$file."&lt;/a&gt;&lt;br /&gt;";<br />
            $handle = @fopen($dir, "r");<br />
            if ($handle)<br />
            {<br />
               while (!feof($handle))<br />
               {<br />
                  $content = fgets($handle);<br />
                  if(stristr($content, $content_pattern))<br />
                  {<br />
                     $test = stristr($content, $content_pattern);<br />
                     echo $test."&lt;br /&gt;";<br />
                     $ChcekFlag = TRUE;<br />
                  }<br />
               }<br />
            }<br />
            fclose($handle);<br />
            if($ChcekFlag)<br />
            {<br />
               echo "&lt;font color='red'&gt;Infected&lt;/font&gt;&lt;br /&gt;";<br />
            }<br />
            else<br />
            {<br />
               echo "&lt;font color='green'&gt;Clean&lt;/font&gt;&lt;br /&gt;";<br />
            }<br />
            echo "&lt;/li&gt;";<br />
         }<br />
      }<br />
   }<br />
   echo "&lt;/ul&gt;";<br />
}<br />
?&gt;</code></p>
<p>you can put this code in the root level of your website (in www or public_html or httpdocs). Browsing this page will show all the index pages with status of it. </p>
<p>Current I am working upon extending the code so that it can clean the infected pages automatically. Hopefully I will post it within few days.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.webconsultingengineering.com/phptalk/iframe-code-injection.html/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Tricky Sql Statements</title>
		<link>http://blog.webconsultingengineering.com/development/tricky-sql-statements.html</link>
		<comments>http://blog.webconsultingengineering.com/development/tricky-sql-statements.html#comments</comments>
		<pubDate>Thu, 30 Apr 2009 13:21:27 +0000</pubDate>
		<dc:creator>Susenjit</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[group by clause]]></category>
		<category><![CDATA[MySql]]></category>
		<category><![CDATA[select distinct]]></category>
		<category><![CDATA[sql replace function]]></category>
		<category><![CDATA[sql statement]]></category>
		<category><![CDATA[update statement]]></category>

		<guid isPermaLink="false">http://blog.webconsultingengineering.com/?p=48</guid>
		<description><![CDATA[ Here are some tricky Sql statements that can be used in some specific cases. I figured them out in certain cases where I needed to do data manipulation directly on the database instead of writing script to accomplish them. I will describe them in case study style.
Case 1:
In one of my project there is [...]]]></description>
			<content:encoded><![CDATA[<!-- This is a HTML comment, it will not display in any page. Feel free to remove this comment if it cause any inconvenient to you.
	Thanks for using digg digg, please visit http://www.mkyong.com/blog/digg-digg-wordpress-plugin for any comments and ideas, 
	
    Author : Yong Mook Kim
    Website : http://www.mkyong.com
	--><div style='float:right'><table> <td><iframe src='http://digg.com/api/diggthis.php?w=new&amp;u=http://blog.webconsultingengineering.com/development/tricky-sql-statements.html&amp;t=Tricky+Sql+Statements&amp;s=normal' height='80' width='52' frameborder='0' scrolling='no'></iframe></td></table></div><p>Here are some tricky Sql statements that can be used in some specific cases. I figured them out in certain cases where I needed to do data manipulation directly on the database instead of writing script to accomplish them. I will describe them in case study style.</p>
<p><strong>Case 1:</strong></p>
<p>In one of my project there is a user table containing fields like userId, UserName, UserLoginID, Password etc. The UserLoginID field is basically the email address. Almost 95% of the email addresses belongs to a specific domain that is the domain of the project. Let&#8217;s say testproject.com.  The table contains approx 12,000 records. In that project client decided to shift their main tld from .com to .org like testproject.com to testproject.org. Now they asked me to change the all the users&#8217; email from .com to .org. That means user1@testproject.com to user1@testproject.org I needed to do this job within a shortest span of time. So I decided to run a sql command directly in the database to do the modification. A simple UPDATE sql won&#8217;t work in that situation as I needed to change some part of a field and also update statement shouldn’t affect those rows which do not contain testproject.com. So I tried with different types of update sql to do the job but finally derived the following one :-</p>
<p class="code"><code>UPDATE tblUser SET UserLoginID = REPLACE(UserLoginID, ' testproject.org', ' testproject.com');</code></p>
<p>The beauty of this statement lies in the usage of replace function. This replace function will synchronously select records having &#8216;testproject.com&#8217; implementing functionality of the Where clause and generate the value to be set for the field UserLoginID as <somename>@testproject.org</p>
<p><strong>Case 2:</strong></p>
<p>This case was relatively easy. I need to find out unique entries from a table. It was not a hard job for me but still I googled a bit for this purpose. Now after some study I come to a position where I could do that using two different sql statements. They are :-</p>
<p class="code"><code>SELECT product_code FROM tblproductdetails GROUP BY product_code;</code></p>
<p>and</p>
<p class="code"><code>SELECT DISTINCT product_code FROM tblproductdetails;</code></p>
<p>While looking at the results I found both of them produces same result but the only differnce is Select DISTINCT does not sort the result set like GROUP BY does. So I wasn&#8217;t sure which one should used. <a href="http://groups.google.com/group/udbug/browse_thread/thread/9d660cbbd91a7d63" target="_blank">SELECT DISTINCT vs GROUP BY &#8211;   udbug |  Google Groups</a> helped me to chose the correct statement as Select DISTINCT. So I used the following :-</p>
<p class="code"><code>SELECT DISTINCT product_code FROM tblproductdetails ORDER BY product_code</code></p>
<p><strong>Case 3:</strong></p>
<p>This is also related with the earlier case of unique entries. This time I need to find out the ids which have duplicate entries. Almost the opposite job than the previous one. Well this statement also uses distinct but along with Group by clause gives the entries which have duplicates in the table. Here is the statement.</p>
<p class="code"><code>SELECT DISTINCT regn_id from tblstudentdetails group by regn_id HAVING count(regn_id) > 1;</code></p>
<p>This statement is very useful to find out entries which have duplicates in the tables.</p>
<p>Somebody asked me earlier how do I learn php and database? My answer was  &#8211; learn the basic, find some real-life project to work for, take the challenge to complete it. You would face lots and lots problem while doing that. Don&#8217;t try to get rid of them but try to solve them. When you would finish the job you will understand the difference in you in terms of practical knowledge. I hope you all agree with me. <img src='http://blog.webconsultingengineering.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.webconsultingengineering.com/development/tricky-sql-statements.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Picasa web album slideshow – Development guide</title>
		<link>http://blog.webconsultingengineering.com/phptalk/picasa-web-album-slideshow.html</link>
		<comments>http://blog.webconsultingengineering.com/phptalk/picasa-web-album-slideshow.html#comments</comments>
		<pubDate>Tue, 31 Mar 2009 13:28:54 +0000</pubDate>
		<dc:creator>Susenjit</dc:creator>
				<category><![CDATA[Php Talk]]></category>
		<category><![CDATA[album slideshow]]></category>
		<category><![CDATA[pear]]></category>
		<category><![CDATA[picasa]]></category>
		<category><![CDATA[picasa slideshow]]></category>
		<category><![CDATA[picasaweb]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[RSS Feed]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://blog.webconsultingengineering.com/?p=44</guid>
		<description><![CDATA[ I was looking for a application to embed slideshow using pictures from picase web album. I found some plugins which can be used in blog or myspace. Some of them uses the picasa slide show url opened in a iframe or div. Then you will have less control on the slideshow as it is [...]]]></description>
			<content:encoded><![CDATA[<!-- This is a HTML comment, it will not display in any page. Feel free to remove this comment if it cause any inconvenient to you.
	Thanks for using digg digg, please visit http://www.mkyong.com/blog/digg-digg-wordpress-plugin for any comments and ideas, 
	
    Author : Yong Mook Kim
    Website : http://www.mkyong.com
	--><div style='float:right'><table> <td><iframe src='http://digg.com/api/diggthis.php?w=new&amp;u=http://blog.webconsultingengineering.com/phptalk/picasa-web-album-slideshow.html&amp;t=Picasa+web+album+slideshow+-+Development+guide&amp;s=normal' height='80' width='52' frameborder='0' scrolling='no'></iframe></td></table></div><p>I was looking for a application to embed slideshow using pictures from <a title="picasa web" href="http://picasa.google.com/">picase web album</a>. I found some plugins which can be used in blog or myspace. Some of them uses the picasa slide show url opened in a iframe or div. Then you will have less control on the slideshow as it is controlled by the slideshow application of picasa. But I required more control on the images from picasa.</p>
<p>I was looking for some application which will fetch/store all the images for an album in picasa and create a slideshow with more control on the images. I found nothing thats suites my requirement. So I started to design an application of such kind. On the basis of functionality I sub devided it into two major part. First is fetch the image related information for an album and store it if required. Second is display the slideshow using those image information.</p>
<p>In picasa you can view the pictures as set or individual but you won&#8217;t get actual picture name or its location. So I found now simple way to get the pictures name and their location. While searching more for such option I found there is a RSS feed for each album. The RSS feed provides image names and its location details. It makes my job easier. Now objective became to process the RSS feed to get the image related information. For this purpose I used XML-RSS package from <a href="http://pear.php.net">PEAR</a>. Here is snapshot of the code I wrote to process the feed:</p>
<p class="code"><code><br />
&lt;?php<br />
require_once "XML/RSS.php";<br />
//$FeedURL is the URL of the rss feed of an album in picasa<br />
$FeedURL = "http://picasaweb.google.com/data/feed/base/user/wce/albumid/5331321673727336541?alt=rss&#038;kind=photo&#038;hl=en_GB";<br />
$rss =&#038; new XML_RSS($FeedURL);<br />
$rss-&gt;parse();<br />
$rssArray = $rss-&gt;getStructure();<br />
$PicasaDataArray = array();<br />
$InfoArray = array();<br />
for($C=0; $C&lt;count($rssArray); $C++)<br />
{<br />
    if($rssArray[$C]['type'] == 'item')<br />
    {<br />
        $PicasaDataArray[] = array(<br />
                                         'title' =&gt; $rssArray[$C]['title'],<br />
                                         'image' =&gt; $rssArray[$C]['enclosures'][0]['url'],<br />
                                         'link' =&gt; $rssArray[$C]['link'],<br />
                                         'description' =&gt; $rssArray[$C]['description'],<br />
                                          );<br />
    }<br />
    elseif($rssArray[$C]['type'] == 'image')<br />
    {<br />
        $AlbumTitle =  $rssArray[$C]['title'];<br />
        $AlbumPicture =  $rssArray[$C]['url'];<br />
        $CreateDate =  $MetaInfo['lastbuilddate'];<br />
    }<br />
}<br />
// this $PicasaDataArray contains all the picture related information of an album from picasa web.<br />
?&gt;<br />
</code></p>
<p>Now this $PicasaDataArray can be stored in files/database or can be directly used for the slideshow. While processing the feed by this I found the feed contain other information like title, description, link of the album, its last build date etc. So I modified the code a little more to store these information too. So the first part of my application is complete.</p>
<p>Now the second part &#8211; slideshow using $PicasaDataArray. For this section I didn&#8217;t tried to put my head to develop slide show application as I had already seen some very nice attractive slideshow application. They are also easy to use and configure. One of my favourite is <a href="http://www.lokeshdhakar.com/projects/lightbox2/">Lightbox JS</a>. Another good slideshow script is <a href="http://highslide.com/">Highslide</a>. Both of them are very nice and easy to configure. So I used one of them for my purpose. Here is another snapshot of code</p>
<p class="code"><code><br />
&lt;?php<br />
require_once "XML/RSS.php";<br />
//$FeedURL is the URL of the rss feed of an album in picasa<br />
$FeedURL = "http://picasaweb.google.com/data/feed/base/user/wce/albumid/5331321673727336541?alt=rss&#038;kind=photo&#038;hl=en_GB";<br />
$rss =&#038; new XML_RSS($FeedURL);<br />
$rss-&gt;parse();<br />
$rssArray = $rss-&gt;getStructure();<br />
$PicasaDataArray = array();<br />
$InfoArray = array();<br />
for($C=0; $C&lt;count($rssArray); $C++)<br />
{<br />
    if($rssArray[$C]['type'] == 'item')<br />
    {<br />
        $PicasaDataArray[] = array(<br />
                                         'title' =&gt; $rssArray[$C]['title'],<br />
                                         'image' =&gt; $rssArray[$C]['enclosures'][0]['url'],<br />
                                         'link' =&gt; $rssArray[$C]['link'],<br />
                                         'description' =&gt; $rssArray[$C]['description'],<br />
                                          );<br />
    }<br />
    elseif($rssArray[$C]['type'] == 'image')<br />
    {<br />
        $AlbumTitle =  $rssArray[$C]['title'];<br />
        $AlbumPicture =  $rssArray[$C]['url'];<br />
        $CreateDate =  $MetaInfo['lastbuilddate'];<br />
    }<br />
}<br />
?&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;title&gt;Slide Show :: &lt;?php echo  $AlbumTitle;?&gt;&lt;/title&gt;<br />
&lt;script type="text/javascript" src="js/prototype.js"&gt;&lt;/script&gt;<br />
&lt;script type="text/javascript" src="js/scriptaculous.js?load=effects,builder"&gt;&lt;/script&gt;<br />
&lt;script type="text/javascript" src="js/lightbox.js"&gt;&lt;/script&gt;<br />
&lt;link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" /&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;a href="&lt;?php echo  $AlbumPicture;?&gt;" rel="lightbox[picasa]"&gt;&lt;img src="&lt;?php echo  $AlbumPicture;?&gt;" /&gt;&lt;/a&gt;<br />
&lt;div style="display:box;"&gt;<br />
&lt;?php<br />
foreach($PicasaDataArray as $ImageInfo)<br />
{<br />
      echo '&lt;a href="'.$ImageInfo['image'].'"' rel="lightbox[picasa]"&gt;'.$ImageInfo['title'].'&lt;/a&gt;&lt;br&gt; ';<br />
}<br />
?&gt;<br />
&lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</code></p>
<p>I made this  code simple and easy to use. Though I have used xml-rss class from pear but it can be repalced by and standard xml-rss parser class. Experienced developer can modify this code or enhance its feature much more as per their requirement. If like to use this code or if you have any suggestion let me know about it via your comment. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.webconsultingengineering.com/phptalk/picasa-web-album-slideshow.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Liquid Column Display Layout – Part II</title>
		<link>http://blog.webconsultingengineering.com/development/liquid-column-display-layout-part2.html</link>
		<comments>http://blog.webconsultingengineering.com/development/liquid-column-display-layout-part2.html#comments</comments>
		<pubDate>Mon, 09 Feb 2009 07:08:00 +0000</pubDate>
		<dc:creator>Susenjit</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[DHTML]]></category>
		<category><![CDATA[div tags]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[DOM Level 2 specification]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[liquid column layout]]></category>
		<category><![CDATA[table less structure]]></category>
		<category><![CDATA[web client side script]]></category>
		<category><![CDATA[web page design]]></category>

		<guid isPermaLink="false">http://blog.webconsultingengineering.com/?p=39</guid>
		<description><![CDATA[ In my earlier post I had discussed about the designing the liquid 3 column display layout. While developing the structure I had some problem with the column heights. Depending upon the contents length of those columns varies. I have declared the height property as auto in the css. I could have declared them with [...]]]></description>
			<content:encoded><![CDATA[<!-- This is a HTML comment, it will not display in any page. Feel free to remove this comment if it cause any inconvenient to you.
	Thanks for using digg digg, please visit http://www.mkyong.com/blog/digg-digg-wordpress-plugin for any comments and ideas, 
	
    Author : Yong Mook Kim
    Website : http://www.mkyong.com
	--><div style='float:right'><table> <td><iframe src='http://digg.com/api/diggthis.php?w=new&amp;u=http://blog.webconsultingengineering.com/development/liquid-column-display-layout-part2.html&amp;t=Liquid+Column+Display+Layout+-+Part+II&amp;s=normal' height='80' width='52' frameborder='0' scrolling='no'></iframe></td></table></div><p>In my earlier post I had discussed about the designing the <a href="http://blog.webconsultingengineering.com/development/liquid-column-display-layout.html">liquid 3 column display layout</a>. While developing the structure I had some problem with the column heights. Depending upon the contents length of those columns varies. I have declared the height property as auto in the css. I could have declared them with some specific pixel value to make the columns of equal length. But if you consider your pages to contain dynamic content generated by server side scripting then this technique may fail. Particularly in Internet Explorer the data part may be extended beyond the columns, which could make the structure awful. So I was in need to find some other solutions for that purpose.</p>
<p>I thought of using some JavaScript to make all the columns height equal. The algorithm to do this is very simple. Calculate the max height among three columns and assign it for all the columns. So first I introduced three different IDs for these three columns to access the properties of those columns using Javascript document.getElementById() method. So I changed the HTML code as follows:</p>
<p class="code"><code><br />
&lt;div class="container"&gt;<br />
&lt;div class="contentDiv" id="contentDiv"&gt;<br />
&lt;div class="contentDiv_left" id="contentDiv_left"&gt;&lt;img class="LcolImgDiv" src="../images/c2.jpg" border="0" alt="" /&gt;&lt;/div&gt;<br />
&lt;div class="contentDiv_mid" id="contentDiv_mid"&gt;<br />
&lt;div class="hD1"&gt;Header Text&lt;/div&gt;<br />
&lt;div class="hD2"&gt;Header text 2&lt;/div&gt;<br />
&lt;p class="hD3"&gt;The text….&lt;/p&gt;<br />
&lt;/div&gt;<br />
&lt;div class="contentDiv_right" id="contentDiv_right"&gt;<br />
&lt;ul&gt;<br />
&lt;li&gt;&lt;a class="item1" href="director/index.html"&gt;DIRECTOR SPEAKS &lt;/a&gt; &lt;img src="../images/bullet1.gif" alt="" vspace="0" /&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;a class="item1" href="students/index.html"&gt;STUDENTS &lt;/a&gt; &lt;img src="../images/bullet1.gif" alt="" vspace="2" /&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;a class="item1" href="alumni/index.html"&gt;ALUMNI &lt;/a&gt; &lt;img src="../images/bullet1.gif" alt="" vspace="2" /&gt;&lt;/li&gt;<br />
&lt;/ul&gt;<br />
&lt;/div&gt;<br />
&lt;/div&gt;<br />
&lt;div class="footerDiv"&gt;<br />
&lt;div class="footerDivText"&gt;Copyright text&lt;/div&gt;<br />
&lt;/div&gt;<br />
&lt;/div&gt;<br />
</code></p>
<p>contentDiv_left for the left column, contentDiv_mid for the middle column and contentDiv_right for the right one. contentDiv ID for the container div for these 3 columns.</p>
<p>Then my job was to find out the maximum height of these 3 columns. First I used <strong>offsetHeight</strong> property for this purpose. Calculate the max height and assign it to all the 3 columns style.height property. While testing the code I found it was working fine with Internet Explorer. In case of FireFox or Opera or Netscape browsers the code was malfunctioning, more specifically it was unable to find out the height of those columns using offsetHeight property. So I started looking for bug. While doing that I found out offsetHeight is a readonly property of the DHTML Object model introduced by MSIE. But is not part of any W3C specification or technical recommendation. So incase of browsers like FF or Opera it won&#8217;t work. So I started looking for some alternate property to find out the heights of those columns. There are some properties which didn&#8217;t worked for me are element.style.height, element.style.max-height etc. I tried with <br /> <strong>window.getComputedStyle(element,null).getPropertyValue(&#8220;height&#8221;)</strong>.<br /> As window.getComputedStyle method can be used to get the styles of an element that are not set using the style attribute or with JavaScript. But it didn&#8217;t work too. Finally I worked out with this method : <br /><strong>document.defaultView.getComputedStyle(element, null).getPropertyValue(&#8220;height&#8221;)</strong>.<br /> The document.defaultView returns a reference to the default AbstractView for the document. This document.defaultView is part of the DOM Level 2 DocumentView interface. This interface is not a mandatory part of Document Object Model Level 2 Core specification. DOM of IE doesn&#8217;t implement this but DOM in mozilla supports this. So I put a browser check and utilized the above method for browser like FF, Opera and offsetHeight propery for IE. Hence my code looks like this :</p>
<p class="code"><code><br />
function checkBrowserComponent() {<br />
var ua = navigator.userAgent.toLowerCase();<br />
if(ua.indexOf('msie')!=-1) {<br />
return "ie";<br />
}<br />
else if(ua.indexOf('firefox')!=-1) {<br />
return "ff";<br />
}<br />
return "oth";<br />
}<br />
function maintainMaxColHeight() {<br />
var defMaxHeight = 400;<br />
var elmMain = document.getElementById("contentDiv");<br />
var elmLS = document.getElementById("contentDiv_leftSingle");<br />
var elmL = document.getElementById("contentDiv_left");<br />
var elmM = document.getElementById("contentDiv_mid");<br />
var elmR = document.getElementById("contentDiv_right");<br />
var ua = checkBrowserComponent();<br />
if(ua == 'ff') {<br />
if(elmLS != null) {<br />
var lh = document.defaultView.getComputedStyle(elmLS, null).getPropertyValue("height");<br />
lh = parseInt(lh);<br />
if(lh &gt; defMaxHeight) {<br />
defMaxHeight = lh;<br />
}<br />
}<br />
else {<br />
var lh = document.defaultView.getComputedStyle(elmL, null).getPropertyValue("height");<br />
lh = parseInt(lh);<br />
if(lh &gt; defMaxHeight) {<br />
defMaxHeight = lh;<br />
}<br />
var mh = document.defaultView.getComputedStyle(elmM, null).getPropertyValue("height");<br />
mh = parseInt(mh);<br />
if(mh &gt; defMaxHeight) {<br />
defMaxHeight = mh;<br />
}<br />
}<br />
var rh = document.defaultView.getComputedStyle(elmR, null).getPropertyValue("height");<br />
rh = parseInt(rh);<br />
if(rh &gt; defMaxHeight) {<br />
defMaxHeight = rh;<br />
}<br />
}<br />
else if(ua == 'ie') {<br />
if(elmLS != null) {<br />
var lh = elmLS.offsetHeight;<br />
if(lh &gt; defMaxHeight) {<br />
defMaxHeight = lh;<br />
}<br />
}<br />
else {<br />
var lh = elmL.offsetHeight;<br />
if(lh &gt; defMaxHeight) {<br />
defMaxHeight = lh;<br />
}<br />
var mh = elmM.offsetHeight;<br />
if(mh &gt; defMaxHeight) {<br />
defMaxHeight = mh;<br />
}<br />
}<br />
var rh = elmR.offsetHeight;<br />
if(rh &gt; defMaxHeight) {<br />
defMaxHeight = rh;<br />
}<br />
}<br />
if(elmLS != null) {<br />
elmLS.style.height = defMaxHeight+"px";<br />
}<br />
else {<br />
elmL.style.height = defMaxHeight+"px";<br />
elmM.style.height = defMaxHeight+"px";<br />
}<br />
elmR.style.height = defMaxHeight+"px";<br />
elmMain.style.height = defMaxHeight+"px";<br />
}<br />
</code></p>
<p>I called this function <strong>maintainMaxColHeight()</strong> in onLoad within body tag.</p>
<p>After adding this script the page now looks like :</p>
<p style="text-align: center;"><a href="http://blog.webconsultingengineering.com/wp-content/uploads/col2_layout.jpg"><img class="aligncenter size-full wp-image-42" style="border: black 1px solid;" title="3 equal cols liquid layout" src="http://blog.webconsultingengineering.com/wp-content/uploads/col2_layout.jpg" alt="3 equal cols liquid layout" width="500" height="294" /></a></p>
<p>Now what&#8217;s the conclusion? I think in case of maintaining the equal height for the columns there are 2 options. First one is to put a fixed pixel value as height property in css for all the columns. Next one is implementing this JavaScript code. For this second option browser should support JavaScript (I believe most of the current browsers do so). In my opinion if a website is designed using liquid column display layout where all pages contain static information, first option will the best for that case. I always prefer to avoid unnecessary script execution for web pages as it reduces the page download and display time. The second option is best for websites containing dynamic information (like my project).</p>
<p>The project where I have implemented this layout is near to completion. Still it is not fully online I won’t be able to show you. I need to wait a little more to show you the live example.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.webconsultingengineering.com/development/liquid-column-display-layout-part2.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coffee experience</title>
		<link>http://blog.webconsultingengineering.com/off-beat/coffee-experience.html</link>
		<comments>http://blog.webconsultingengineering.com/off-beat/coffee-experience.html#comments</comments>
		<pubDate>Thu, 15 Jan 2009 13:35:38 +0000</pubDate>
		<dc:creator>Susenjit</dc:creator>
				<category><![CDATA[Off Beat]]></category>
		<category><![CDATA[coffee]]></category>
		<category><![CDATA[coffee experience]]></category>
		<category><![CDATA[coffee shop]]></category>
		<category><![CDATA[espresso]]></category>

		<guid isPermaLink="false">http://blog.webconsultingengineering.com/?p=34</guid>
		<description><![CDATA[ I used to think myself as a coffee lover. I like tea and coffee either with or without milk. But my favorite is black coffee. Many people don&#8217;t like black coffee due to its bitter taste and I liked it for the same reason. Due to the reason easy to prepare, I take most [...]]]></description>
			<content:encoded><![CDATA[<!-- This is a HTML comment, it will not display in any page. Feel free to remove this comment if it cause any inconvenient to you.
	Thanks for using digg digg, please visit http://www.mkyong.com/blog/digg-digg-wordpress-plugin for any comments and ideas, 
	
    Author : Yong Mook Kim
    Website : http://www.mkyong.com
	--><div style='float:right'><table> <td><iframe src='http://digg.com/api/diggthis.php?w=new&amp;u=http://blog.webconsultingengineering.com/off-beat/coffee-experience.html&amp;t=Coffee+experience&amp;s=normal' height='80' width='52' frameborder='0' scrolling='no'></iframe></td></table></div><p>I used to think myself as a coffee lover. I like tea and coffee either with or without milk. But my favorite is black coffee. Many people don&#8217;t like black coffee due to its bitter taste and I liked it for the same reason. Due to the reason easy to prepare, I take most of the branded instant coffee. Last week I had gone to a well known branded coffee shop in shopping mall with my friend. We were coming back to office after a client meeting and my friend suggested me to have a good coffee treat after the meeting. There we had a tempting experience which put me in a dilemma of continuing my love for coffee.</p>
<p>After we entered into the coffee shop waiter showed us a table to seat and presented the menu (like a weekly magazine). Without wasting our time by going through it we ordered two Espresso for us. I had Americano earlier and so I thought Espresso is something like that. After few minutes waiter served us our order. I  was little curious while looking at the items, 2 small cups containing 4-5 sips of dark black concentrated coffee along with small paper packs of sugar and few cookies. The quantity of coffee was quite low but I was impressed with the aroma coming from them. So I put little sugar which was colored brown from the pack, mixed it with a spoon and made myself prepared to have a great experience of coffee. I just sipped a little and spontaneously OMG came out from my mouth. It was so concentrated and so bitter I ever had. It seemed to me like I some horrible medicine. I was trying to have it as quickly as possible but it seemed to like one of the toughest jobs I ever had. Both of us were almost speechless while completing our cups. We paid the bill, came out of the shop. Form a nearby grocery shop we bought bottle of drinking water and almost emptied them. Then we took a car and rush back to our office. Rest of the day we were cherishing about the coffee we had.</p>
<div class="wp-caption aligncenter" style="width: 460px"><a href="http://www.hungarian-connections.com/Articles/Coffee/Coffee.htm"><img class=" " title="Espresso" src="http://www.hungarian-connections.com/Articles/Coffee/coffee_cup.jpg" alt="Coffee - Espresso" width="450" height="307" /></a><p class="wp-caption-text">Coffee - Espresso</p></div>
<p>Today I find out some good resource about coffee. I learned a lot about coffee and it&#8217;s ordering options. Now I am sure I won&#8217;t order Espresso, may be I will go for Espresso Macchiato or Flat White or Cappuccino or may be Caffé Mocha. I request to all the reader who likes coffee but have less knowledge about it please read <a title="Coffee Drinks Illustrated" href="http://www.lokeshdhakar.com/2007/08/20/an-illustrated-coffee-guide/" target="_blank">Coffee Drinks Illustrated</a> or similar kind of stuffs before you go for a coffee break.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.webconsultingengineering.com/off-beat/coffee-experience.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Liquid Column Display Layout</title>
		<link>http://blog.webconsultingengineering.com/development/liquid-column-display-layout.html</link>
		<comments>http://blog.webconsultingengineering.com/development/liquid-column-display-layout.html#comments</comments>
		<pubDate>Wed, 07 Jan 2009 08:48:25 +0000</pubDate>
		<dc:creator>Susenjit</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[Add new tag]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[div tags]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[liquid column layout]]></category>
		<category><![CDATA[table less structure]]></category>
		<category><![CDATA[web page design]]></category>

		<guid isPermaLink="false">http://blog.webconsultingengineering.com/?p=28</guid>
		<description><![CDATA[ I was busy with some of my projects. Few months back I was interested in liquid column layout structure. I had used this kind of layout in one of my project. This time I am going to discuss about the features of liquid column layout.
Earlier web page designing was highly dependent on HTML table [...]]]></description>
			<content:encoded><![CDATA[<!-- This is a HTML comment, it will not display in any page. Feel free to remove this comment if it cause any inconvenient to you.
	Thanks for using digg digg, please visit http://www.mkyong.com/blog/digg-digg-wordpress-plugin for any comments and ideas, 
	
    Author : Yong Mook Kim
    Website : http://www.mkyong.com
	--><div style='float:right'><table> <td><iframe src='http://digg.com/api/diggthis.php?w=new&amp;u=http://blog.webconsultingengineering.com/development/liquid-column-display-layout.html&amp;t=Liquid+Column+Display+Layout&amp;s=normal' height='80' width='52' frameborder='0' scrolling='no'></iframe></td></table></div><p>I was busy with some of my projects. Few months back I was interested in liquid column layout structure. I had used this kind of layout in one of my project. This time I am going to discuss about the features of liquid column layout.</p>
<p>Earlier web page designing was highly dependent on HTML table structure. Common practice was to design a web page using HTML tags like <strong>table</strong>, <strong>tr</strong>, <strong>th</strong>, <strong>td</strong>, <strong>tbody</strong> etc. Web page designer used to design a layout in a graphic editor like <a href="http://www.adobe.com/products/photoshop/family/">Adobe Photoshop</a> and slice the layout in small images in <i>gif</i> or <i>jpeg</i> format. Then create a table structure and insert those small images in different cells. This technique is very useful because putting those small rectangular images into different table cells, a web page can be designed having the same look and feel as layout image drawn in graphic editor. If not wrong till today this is the mostly used methodology to design web pages.</p>
<p>Let us review this designing procedure. I have described it in a very simplest way. Sometime designing a web page using the table structure based on graphical layout becomes a difficult job. If the graphical layout contains curves, color gradient then the complexity increases. I consider the most crucial part in this process is to design the table structure. Many times designer uses nested tables while designing the pages. Merging cells and rows are also widely used. Another important factor is how to put images in the table cells. Most of the cases <strong>img</strong> HTML tag is used, but sometimes inserting image as background works wonderfully.</p>
<p>So unless you don&#8217;t have a good knowledge of HTML table structure you won&#8217;t be able to work as professional web designer. In my early days in this profession I had to suffer with the complexity of nested table structure while designing pages.</p>
<p>In recent years I found there is a trend to avoid this procedure of designing web pages. There are certain reasons behind this change. First and foremost reason I think the size of the web page. Using nested table structure increases the file size of the web page, but many times it becomes unavoidable. I have also noticed a peculiar case of Internet Explorer while opening a page containing nested table. If the web page contains heavy images and huge text in nested tables, browser&#8217;s status will show &#8220;Done&#8221; while display of the page is not complete. IE shows &#8220;Done&#8221; status when display of the outermost table is complete. Another reason, editing the table structure in those web pages is quite difficult, that&#8217;s why people like to avoid this procedure. I found many times editing that kind of pages make the complex table structure incorrect. Support for other HTML tags having boxed or blocked like display such as <strong>div</strong>, <strong>layer</strong>, <strong>iframe</strong> etc by most of the browser is another important reason. Increasing use of CSS for applying style to provide a good look is also important. I found designer uses <strong>div</strong> tag supported with CSS instead of table to design web pages. They have produces pages which looks same as page designed using table structure and most importantly they have able to reduce the file size a bit.<br />
Layouts like liquid column display, clean structure are the outcome of this increasing usage of div like tag instead of table tags in HTML. Though this new methodology is not very easy but I found there is a rapid increase in number who follows this.</p>
<p>Now here are the reasons why I was interested to implement liquid column display layout in one of my project.</p>
<ul>
<li>If I need to design those web pages using table structure, I need to use one outermost table containing 3 columns. Now to display contents like (text, photographs), I need to use nested tables in those columns. I knew that I was going to suffer with that particular problem in IE. Also my file size will be higher.</li>
<li>There was another designing constrain that I can&#8217;t avoid using table structure. There was a background image that I had to display in the bottom portion of the page. Table structure wasn’t allowing me to do that.</li>
<li>The other reasons are basically the advantages of using liquid column display. I don&#8217;t like to discuss it here. You can always search to know about it. Let me discuss how do I designed the page layout.</li>
</ul>
<p style="text-align: center;"><a href="http://blog.webconsultingengineering.com/wp-content/uploads/layout.gif"><img class="size-full wp-image-29 aligncenter" title="draft graphic layout" src="http://blog.webconsultingengineering.com/wp-content/uploads/layout.gif" alt="" width="399" height="242" /></a></p>
<p>Here is a sketch diagram about the structure that I was going to implement. It contains three columns which aligned in center and below footer. The page should display centered align three columns along with white spaces in the left and right side of the page. To design this structure I have used mainly div tags along with proper styles defined in CSS.</p>
<p>Here is a structural overview of the HTML code in the web page.</p>
<p class="code"><code><br />
&lt;div class="container"&gt;<br />
&lt;div class="contentDiv"&gt;<br />
&lt;div class="contentDiv_left"&gt;&lt;img class="LcolImgDiv" src="../images/c2.jpg" border="0" alt="" /&gt;&lt;/div&gt;<br />
&lt;div class="contentDiv_mid"&gt;<br />
&lt;div class="hD1"&gt;Header Text&lt;/div&gt;<br />
&lt;div class="hD2"&gt;Header text 2&lt;/div&gt;<br />
&lt;p class="hD3"&gt;The text….&lt;/p&gt;<br />
&lt;/div&gt;<br />
&lt;div class="contentDiv_right"&gt;<br />
&lt;ul&gt;<br />
&lt;li&gt;&lt;a class="item1" href="director/index.html"&gt;DIRECTOR SPEAKS &lt;/a&gt; &lt;img src="../images/bullet1.gif" alt="" vspace="0" /&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;a class="item1" href="students/index.html"&gt;STUDENTS &lt;/a&gt; &lt;img src="../images/bullet1.gif" alt="" vspace="2" /&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;a class="item1" href="alumni/index.html"&gt;ALUMNI &lt;/a&gt; &lt;img src="../images/bullet1.gif" alt="" vspace="2" /&gt;&lt;/li&gt;<br />
&lt;/ul&gt;<br />
&lt;/div&gt;<br />
&lt;/div&gt;<br />
&lt;div class="footerDiv"&gt;<br />
&lt;div class="footerDivText"&gt;Copyright text&lt;/div&gt;<br />
&lt;/div&gt;<br />
&lt;/div&gt;<br />
</code></p>
<p>Here is styles defined in css</p>
<p class="code"><code><br />
.container {<br />
margin: 0px auto; width: 927px; padding:0px; border:0px;<br />
}<br />
.contentDiv {<br />
height: auto; width:925px; padding:2px 2px 2px 2px; margin-top:5px; background:#F9E6EC; border:0px;<br />
}<br />
.contentDiv_left {<br />
padding: 0px 0px 0px 0px; float: left; height: auto; width: 35%; background-image:url(../../images/column_bg.gif); background-repeat:repeat-y; border:0px;<br />
}<br />
.contentDiv_right {<br />
padding: 0px 0px 0px 0px; float: right; height: auto; width: 28%; background-image:url(../../images/right_column_bg.gif); background-repeat:repeat-y; border:0px;<br />
}<br />
.contentDiv_mid {<br />
padding: 0px 0px 0px 0px; float: left; height: auto; width: 35%; background:#FFC6E2; margin-left:10px; background-image:url(../../images/column_bg.gif); background-repeat:repeat-y; border:0px;<br />
}<br />
.footerDiv {<br />
height: 20px; width:925px; padding:0px 2px 2px 2px; margin-top:5px; margin-bottom:10px; background:#AD5B66; border:0px;<br />
}<br />
</code></p>
<p>Now here is outcome of the effort.</p>
<p style="text-align: center;"><a href="http://blog.webconsultingengineering.com/wp-content/uploads/col2_layout_first.jpg"><img class="aligncenter size-full wp-image-30" style="border: 1px solid black;" title="col2_layout_first" src="http://blog.webconsultingengineering.com/wp-content/uploads/col2_layout_first.jpg" alt="" width="500" height="294" /></a></p>
<p>A brief explanation about the structure.<br />
To design the 3 column structure I have used nested <strong>div</strong> tags with proper styles. There is a outermost div tag having class name <em>contentDiv</em>. Within that I have put 3 more divs with class names as <em>contentDiv_left</em>, <em>contentDiv_mid</em> and <em>contentDiv_right</em>. For these 3 divs I have defined <em>float property</em> in CSS and width in percentage value to achieve liquidity. For all those divs I have used height property as auto in CSS. This helps div to grow in lenght depending upon the content put in it.</p>
<p>Though I have implemented the 3 column liquid layout, there is a problem in it. If you look at the above picture you can spot out the problem. Yehh, the three columns are not of equal height. Depending upon the content added in those columns, their lengths will get adjusted. This is due to <em>height:auto;</em> in CSS for the 3 inner divs. One solution is to specify a big value as height in CSS. Pages will be unnecessarily long containing small content in those divs. Will create another problem.</p>
<p>I have used a technique to overcome this problem. I will be discussing it in my next post and this time next post I will do very soon. Till then comments, suggestions and queries are always welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.webconsultingengineering.com/development/liquid-column-display-layout.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Welcome 2009</title>
		<link>http://blog.webconsultingengineering.com/off-beat/welcome-2009.html</link>
		<comments>http://blog.webconsultingengineering.com/off-beat/welcome-2009.html#comments</comments>
		<pubDate>Thu, 01 Jan 2009 12:10:46 +0000</pubDate>
		<dc:creator>Susenjit</dc:creator>
				<category><![CDATA[Off Beat]]></category>
		<category><![CDATA[new year]]></category>
		<category><![CDATA[welcome]]></category>
		<category><![CDATA[year 2009]]></category>

		<guid isPermaLink="false">http://blog.webconsultingengineering.com/?p=24</guid>
		<description><![CDATA[ 
Warm session greeting to all my friends, family members, co-workers, well wishers, supporters and last but wish to be least &#8211; spammers. Wish you all a very Happy New Year 2009  
]]></description>
			<content:encoded><![CDATA[<!-- This is a HTML comment, it will not display in any page. Feel free to remove this comment if it cause any inconvenient to you.
	Thanks for using digg digg, please visit http://www.mkyong.com/blog/digg-digg-wordpress-plugin for any comments and ideas, 
	
    Author : Yong Mook Kim
    Website : http://www.mkyong.com
	--><div style='float:right'><table> <td><iframe src='http://digg.com/api/diggthis.php?w=new&amp;u=http://blog.webconsultingengineering.com/off-beat/welcome-2009.html&amp;t=Welcome+2009&amp;s=normal' height='80' width='52' frameborder='0' scrolling='no'></iframe></td></table></div><p style="text-align: center;"><a href="http://blog.webconsultingengineering.com/wp-content/uploads/greetings-09.jpg"><img class="size-medium wp-image-25 aligncenter" title="greetings-09" src="http://blog.webconsultingengineering.com/wp-content/uploads/greetings-09-300x245.jpg" alt="" width="300" height="245" /></a></p>
<p>Warm session greeting to all my friends, family members, co-workers, well wishers, supporters and last but wish to be least &#8211; spammers. Wish you all a very Happy New Year 2009 <img src='http://blog.webconsultingengineering.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.webconsultingengineering.com/off-beat/welcome-2009.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
