<?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' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-9077795680690183847</id><updated>2011-11-27T16:55:36.898-08:00</updated><title type='text'>Genome Research Framework</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://inneslab.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9077795680690183847/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://inneslab.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Saurabh Ajmera</name><uri>http://www.blogger.com/profile/04995191326065157388</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='18' height='32' src='http://bp0.blogger.com/_JEzW7NJF5CA/R6gSJev95FI/AAAAAAAAAAU/eIno5LEjd5U/S220/IMG_0700.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>12</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-9077795680690183847.post-8574418917964167065</id><published>2008-04-20T12:34:00.000-07:00</published><updated>2008-04-20T13:19:02.129-07:00</updated><title type='text'>JavaScript to Detect Unsupported Browsers</title><content type='html'>Hi,&lt;br /&gt;&lt;br /&gt;I have made made a script to detect if our website is compatible with the user browser.&lt;br /&gt;&lt;br /&gt;I have pasted the script below..&lt;br /&gt;&lt;br /&gt;So it checks if the user browser is ie7+,firefox2+,safari3+ or opera8+, is not it redirects to another page.&lt;br /&gt;&lt;br /&gt;This script is included in two places:&lt;br /&gt;&lt;br /&gt;http://discern.uits.iu.edu:8490/UI/index.php&lt;br /&gt;http://discern.uits.iu.edu:8490/adminLogin.php&lt;br /&gt;&lt;br /&gt;This is cuz I believe that all our pages use the session check to redirect the user who has not logged in to the login page.&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;//JavaScript Document&lt;br /&gt;//Author: Saurabh Ajmera&lt;br /&gt;&lt;br /&gt; //test for MSIE x.x;&lt;br /&gt;if (/MSIE (\d+\.\d+);/.test(navigator.userAgent))&lt;br /&gt;{&lt;br /&gt; var ieversion=new Number(RegExp.$1) &lt;br /&gt; if (!(ieversion&gt;=7))&lt;br /&gt; window.location = "/UI/incompatible.html"&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;//test for Firefox/x.x or Firefox x.x (ignoring remaining digits);&lt;br /&gt;else if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent))&lt;br /&gt;{ &lt;br /&gt; var ffversion=new Number(RegExp.$1) &lt;br /&gt; if (!(ffversion&gt;=2))&lt;br /&gt; window.location = "/UI/incompatible.html"&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;//test for Opera/x.x or Opera x.x (ignoring remaining decimal places);&lt;br /&gt;else if (/Opera[\/\s](\d+\.\d+)/.test(navigator.userAgent))&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt; var oprversion=new Number(RegExp.$1)&lt;br /&gt; if (!(oprversion&gt;=8))&lt;br /&gt; window.location = "/UI/incompatible.html"&lt;br /&gt;}&lt;br /&gt;//this took me the longest..only cuz apple uses altogether different naming convention..BAD APPLE!!&lt;br /&gt;else if(/Mozilla[\/\s](\d+\.\d+)/.test(navigator.userAgent)) &lt;br /&gt;{&lt;br /&gt; var badapple=new Number(RegExp.$1)&lt;br /&gt; if (!(badapple&gt;=5))&lt;br /&gt; window.location = "/UI/incompatible.html"&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt; window.location = "/UI/incompatible.html"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9077795680690183847-8574418917964167065?l=inneslab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://inneslab.blogspot.com/feeds/8574418917964167065/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9077795680690183847&amp;postID=8574418917964167065' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9077795680690183847/posts/default/8574418917964167065'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9077795680690183847/posts/default/8574418917964167065'/><link rel='alternate' type='text/html' href='http://inneslab.blogspot.com/2008/04/javascript-to-detect-unsupported.html' title='JavaScript to Detect Unsupported Browsers'/><author><name>Saurabh Ajmera</name><uri>http://www.blogger.com/profile/04995191326065157388</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='18' height='32' src='http://bp0.blogger.com/_JEzW7NJF5CA/R6gSJev95FI/AAAAAAAAAAU/eIno5LEjd5U/S220/IMG_0700.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9077795680690183847.post-7325710683878537576</id><published>2008-04-16T14:45:00.000-07:00</published><updated>2008-04-26T14:49:11.039-07:00</updated><title type='text'>Help popup in JavaScript</title><content type='html'>I have made the help function in javascript.&lt;br /&gt;&lt;br /&gt;This function will, popup a help message whenever the user clicks on the help link.&lt;br /&gt;&lt;br /&gt;You need to include the file help.js which is present in the modules folder.&lt;br /&gt;Example:&lt;br /&gt;&amp;#60;script type="text/javascript" language="javascript" src="/modules/help.js"&gt;&amp;#60;/script&gt;&lt;br /&gt;&lt;br /&gt;Usage:&lt;br /&gt;&amp;#60;a href ="#" id=elementid onClick="helppopup('&amp;#60;elementid&amp;#62;,'the helptesting')"&gt;help&amp;#60;/a&amp;#62;&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&amp;#60;a href = "#" id="helpLink1" onclick="helppopup('helpLink1','the helptesting')"&amp;#62;help&amp;#60;/a&amp;#62;&lt;br /&gt;&lt;br /&gt;Source Code:&lt;br /&gt;//Javascript Document.&lt;br /&gt;//Author:Saurabh Ajmera&lt;br /&gt;function findPosition( oElement ) {&lt;br /&gt; if( typeof( oElement.offsetParent ) != 'undefined' ) {&lt;br /&gt;   for( var posX = 0, posY = 0; oElement; oElement = oElement.offsetParent ) {&lt;br /&gt;     posX += oElement.offsetLeft;&lt;br /&gt;     posY += oElement.offsetTop;&lt;br /&gt;   }&lt;br /&gt;   return [ posX, posY ];&lt;br /&gt; } else {&lt;br /&gt;   return [ oElement.x, oElement.y ];&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;function helppopup(id,text)&lt;br /&gt;{&lt;br /&gt; helpwindow = window.open (" ",&lt;br /&gt; "helpwindow","location=1,scrollbars=1,resizable=1,&lt;br /&gt;width=350,height=250");&lt;br /&gt; Element = document.getElementById(id);&lt;br /&gt; pos = findPosition(Element);&lt;br /&gt; helpwindow.moveTo(pos[0],pos[1]);&lt;br /&gt; helpwindow.document.write(text)&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9077795680690183847-7325710683878537576?l=inneslab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://inneslab.blogspot.com/feeds/7325710683878537576/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9077795680690183847&amp;postID=7325710683878537576' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9077795680690183847/posts/default/7325710683878537576'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9077795680690183847/posts/default/7325710683878537576'/><link rel='alternate' type='text/html' href='http://inneslab.blogspot.com/2008/04/help-popup-in-javascript.html' title='Help popup in JavaScript'/><author><name>Saurabh Ajmera</name><uri>http://www.blogger.com/profile/04995191326065157388</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='18' height='32' src='http://bp0.blogger.com/_JEzW7NJF5CA/R6gSJev95FI/AAAAAAAAAAU/eIno5LEjd5U/S220/IMG_0700.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9077795680690183847.post-6416148710965643448</id><published>2008-04-01T00:59:00.000-07:00</published><updated>2008-04-01T01:46:56.043-07:00</updated><title type='text'>JavaScript Code to protect against injection attacks</title><content type='html'>Description:&lt;br /&gt;&lt;br /&gt;This code uses a simple regular expression to check if the user input contains any characters which might enable SQL injection attacks or Cross Site scripting attacks.&lt;br /&gt;&lt;br /&gt;The code checks all the textarea and the input tags in the form tag and checks if the value entered by the user contains on of the special character matching the regular expression:&lt;br /&gt;[\^\$\(\)\&lt;\&gt;\|\\\}\{\]\[\*\?%&amp;amp;\+\'@]&lt;br /&gt;&lt;br /&gt;Usage:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Add the following line as the first line after beginning your form tag -                                                                        &lt;input name="regex" id="regex" value="" type="hidden"&gt; &amp;lt;INPUT TYPE="hidden" NAME="regex" id="regex" VALUE="[\^\$\(\)\&lt;\&gt;\|\\\}\{\]\[\*\?%&amp;amp;\+\'@]" SIZE=50&amp;gt;.                                            I could have declared this regular expression in the javascript itself, but for some reason, javascript could'nt find the any match if the match occurred at index 0, N This way seems to work for me.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Create an div element with id error -&lt;/li&gt;&lt;li&gt;&lt;div id="error" style="background-color: rgb(255, 0, 0); color: rgb(255, 255, 255); display: block; width: inherit;" align="center"&gt; &lt;/div&gt;&amp;lt;div id="error" align="center" style="background-color:#FF0000; color:#FFFFFF; display:block; width:inherit "&amp;gt; &amp;lt;/div&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;. You need this cas my script does getElementById('error').innerHTML to display the error message.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Call this script onSubmit. For example:                                                                                         &amp;lt;form method="post" name="frmEditAccount" action="../modules/processEditProfile.php" id="frmEditAccount" onSubmit="return inputValidation(frmEditAccount)"&amp;gt;&lt;form method="post" name="frmEditAccount" action="../modules/processEditProfile.php" id="frmEditAccount" onsubmit="return inputValidation(frmEditAccount)"&gt;Here the onSubmit event calls the function inputValidation(frmEditAccount), cas I have doing some more validation besides just the security check. Thus my defination of inputValidation will look like.&lt;br /&gt;&lt;/form&gt;&lt;/li&gt;            function inputValidation(frm)&lt;br /&gt;      {&lt;br /&gt;        if(!securityCheck())&lt;br /&gt;        {&lt;br /&gt;            return false;&lt;br /&gt;        }&lt;br /&gt;        else&lt;br /&gt;        {&lt;br /&gt;            return validateEditProfile(frm);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Include the javascript file -&lt;/li&gt;&lt;li&gt;&amp;lt;script language="javascript" type="text/javascript" src="/modules/securityCheck.js"&amp;gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt; &lt;script language="javascript" type="text/javascript" src="/modules/securityCheck.js"&gt;&lt;br /&gt;&lt;/script&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;The only way this code can fail is, if someone has javascript disabled, I didn't had much time to figure out, how to detect if javascript is enabled on a browser, but If I find something I will be adding it to this script.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;This code is working for the following forms:&lt;/li&gt;&lt;/ul&gt;           userRegistration, editProfile, projectCreate, and for the userHomePage, i.e. for the Search.&lt;br /&gt;&lt;br /&gt;I have pasted the code below. Please email me if you have any problems using the code.&lt;br /&gt;&lt;br /&gt;One more thing, debugging a JavaScript code is a developer's night mare, cas you have to completely depend on the browser. So if you are thinking of debugging a javascript code try using Firefox with a web developer extension, this will install a nice toolbar on firefox, n you can check various kind of errors, like JavaScript error, CSS error, etc...&lt;br /&gt;&lt;br /&gt;Please do not attempt to modify this code on the UITS server. If  you think it is an important modification let me know about it.&lt;br /&gt;&lt;br /&gt;//JavaScript Document&lt;br /&gt;/*#########################################&lt;br /&gt;Author:Saurabh Ajmera&lt;br /&gt;Date:02/16/2008&lt;br /&gt;Description:This function does some security check, no special characters allowed!!&lt;br /&gt;###########################################*/&lt;br /&gt;&lt;br /&gt;function isInputSecure(value)&lt;br /&gt;{&lt;br /&gt;//lets trim the extra space&lt;br /&gt;//alert('I am in..');&lt;br /&gt;var re;&lt;br /&gt;re = new RegExp(document.getElementById('regex').value);&lt;br /&gt;//alert(value.match(re))?0:1);&lt;br /&gt;return (value.match(re))?0:1&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function securityCheck()&lt;br /&gt;{&lt;br /&gt;//alert("checkin..");&lt;br /&gt;//alert(document.getElementById(id).value);&lt;br /&gt;//if(!isInputSecure(document.getElementById(id).value))&lt;br /&gt;//{&lt;br /&gt;//var inputCount = document.evaluate("count(//input)", document, null, XPathResult.ANY_TYPE, null).numberValue;&lt;br /&gt;//alert("This document contains " + inputCount + " input tags");&lt;br /&gt;&lt;br /&gt;var j = 0;&lt;br /&gt;&lt;br /&gt;while(document.getElementsByTagName('textarea')[j++])&lt;br /&gt;{&lt;br /&gt;//alert(document.getElementsByTagName('textarea')[j-1].value);&lt;br /&gt;if(!isInputSecure(document.getElementsByTagName('textarea')[j-1].value))&lt;br /&gt;{&lt;br /&gt;//document.getElementsByTagName('input')[i]&lt;br /&gt; //alert(document.getElementsByTagName('textarea')[0].value);&lt;br /&gt; document.getElementById('error').innerHTML = 'For security reasons, you cannot enter the following characters as input:\n ^ $ ( ) &lt; &gt; | \ } { ] [ * ? % &amp;amp; + \' @ ] ';&lt;br /&gt; //alert("For security seasons, you cannot the following characters as input:\n ^ $ ( ) &lt; &gt; | \ } { ] [ * ? % &amp;amp; + ' @ ] ");&lt;br /&gt; return false;&lt;br /&gt;}                                                                                                                                                                                                                   &lt;br /&gt;//j++;&lt;br /&gt;}&lt;br /&gt;var i = 0;&lt;br /&gt;while(document.getElementsByTagName('input')[i])&lt;br /&gt;{&lt;br /&gt;//for(var i=0;i&lt;=inputCount;i++)   //{    //alert(document.getElementsByTagName('input')[i].value);    if((!isInputSecure(document.getElementsByTagName('input')[i].value)) &amp;amp;&amp;amp; (document.getElementsByTagName('input')[i].type != 'hidden'))    {   //document.getElementsByTagName('input')[i]           document.getElementById('error').innerHTML = 'For security reasons, you cannot enter the following characters as input:\n ^ $ ( ) &lt; &gt; | \ } { ] [ * ? % &amp;amp; + \' @ ] ';&lt;br /&gt;//alert("For security seasons, you cannot the following characters as input:\n ^ $ ( ) &lt; &gt; | \ } { ] [ * ? % &amp;amp; + ' @ ] ");&lt;br /&gt;return false;&lt;br /&gt;}&lt;br /&gt;i++;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;return true;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}  &lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9077795680690183847-6416148710965643448?l=inneslab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://inneslab.blogspot.com/feeds/6416148710965643448/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9077795680690183847&amp;postID=6416148710965643448' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9077795680690183847/posts/default/6416148710965643448'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9077795680690183847/posts/default/6416148710965643448'/><link rel='alternate' type='text/html' href='http://inneslab.blogspot.com/2008/04/javascript-code-to-protect-against.html' title='JavaScript Code to protect against injection attacks'/><author><name>Saurabh Ajmera</name><uri>http://www.blogger.com/profile/04995191326065157388</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='18' height='32' src='http://bp0.blogger.com/_JEzW7NJF5CA/R6gSJev95FI/AAAAAAAAAAU/eIno5LEjd5U/S220/IMG_0700.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9077795680690183847.post-4469431572168609392</id><published>2008-03-12T23:37:00.001-07:00</published><updated>2008-03-13T00:05:44.223-07:00</updated><title type='text'>Notifications</title><content type='html'>Finally, the notification module is ready.&lt;br /&gt;&lt;br /&gt;But to make it work completely you have to call the addNotification function everytime you want to send a notification.&lt;br /&gt;&lt;br /&gt;Description about addNotification is as follows:&lt;br /&gt;&lt;br /&gt;addNotification($userID,$projectID,$fileID,$type);&lt;br /&gt;&lt;br /&gt;This function takes four arguments viz:$userID, $projectID, $fileID, $type&lt;br /&gt;&lt;br /&gt;There are four cases when a notification will be send:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;upload :(When a new file is uploaded a notification will be send to all the members of that project) So, Once a file is uploaded, you need to call addNotification.                                        Useage: addNotification($userID,$projectID,$fileID,"upload");&lt;/li&gt;&lt;br /&gt;&lt;li&gt;join: (When a new user has joined a project a notification will be send to all the members of that project) So, Once the user is approved by the system administrator, you need to call addNotification. Useage:addNotification($userID,$projectID,0,"join");&lt;/li&gt;&lt;br /&gt;&lt;li&gt;request: (When a user requests to join a project a notification will be send to the owner of the project) So, once a user submits the request to join the project, call addNotification. Useage:addNotification($userID,$projectID,0,"request");&lt;/li&gt;&lt;br /&gt;&lt;li&gt;invite: (When a user is invited to join a project) So, once a user is invited by the owner of the project to join the project call addNotification($userID,$projectID,0,"invite");&lt;/li&gt;&lt;/ol&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;    &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9077795680690183847-4469431572168609392?l=inneslab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://inneslab.blogspot.com/feeds/4469431572168609392/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9077795680690183847&amp;postID=4469431572168609392' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9077795680690183847/posts/default/4469431572168609392'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9077795680690183847/posts/default/4469431572168609392'/><link rel='alternate' type='text/html' href='http://inneslab.blogspot.com/2008/03/notifications.html' title='Notifications'/><author><name>Saurabh Ajmera</name><uri>http://www.blogger.com/profile/04995191326065157388</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='18' height='32' src='http://bp0.blogger.com/_JEzW7NJF5CA/R6gSJev95FI/AAAAAAAAAAU/eIno5LEjd5U/S220/IMG_0700.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9077795680690183847.post-5293171943734066449</id><published>2008-03-02T11:10:00.000-08:00</published><updated>2008-03-02T11:13:54.363-08:00</updated><title type='text'>Exception Handling</title><content type='html'>&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:times new roman;"&gt;Here is how you need to make exception handling on your pages.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;&lt;span style="font-weight: bold;"&gt;Displaying error message&lt;br /&gt;&lt;/span&gt;displayError("sorry there is an error in data");&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:times new roman;"&gt;result: &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;sorry there is an error in data&lt;/span&gt;&lt;span style="font-family:times new roman;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Query errors&lt;/span&gt;&lt;br /&gt;errorHandler("sorry error in query");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;Eg: $conn-&gt;query($query) or errorHandler("error message");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;result: &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);font-family:times new roman;" &gt;error message&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;&lt;span style="font-weight: bold;"&gt;Display success message&lt;/span&gt;&lt;br /&gt;displayMessage("success in uploading file");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;result : &lt;/span&gt;&lt;span style="color: rgb(0, 153, 0);font-family:times new roman;" &gt;success in uploading file&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9077795680690183847-5293171943734066449?l=inneslab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://inneslab.blogspot.com/feeds/5293171943734066449/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9077795680690183847&amp;postID=5293171943734066449' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9077795680690183847/posts/default/5293171943734066449'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9077795680690183847/posts/default/5293171943734066449'/><link rel='alternate' type='text/html' href='http://inneslab.blogspot.com/2008/03/exception-handling.html' title='Exception Handling'/><author><name>Rajesh</name><uri>http://www.blogger.com/profile/08863716275136482530</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='24' src='http://2.bp.blogspot.com/_Ww1evjMhvKo/SbPuel1ymQI/AAAAAAAAClw/BOemMPlr-Uc/S220/090.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9077795680690183847.post-354221439301727749</id><published>2008-02-20T20:17:00.000-08:00</published><updated>2008-02-20T20:28:24.020-08:00</updated><title type='text'>Handling Sessions</title><content type='html'>Everytime a genuine user logs into the website we create a session object, which stores his userID.&lt;br /&gt;&lt;br /&gt;Every page a user visits logging in to the wesite, should have a session check at the begining of each page. This is done by a function sessionExists().&lt;br /&gt;&lt;br /&gt;This function checks if the session object is created for the particular user. If the session is created it will return true, else it will just redirect the user to the home page of this website.&lt;br /&gt;&lt;br /&gt;Function: sessionExists()&lt;br /&gt;Defination:&lt;br /&gt; function sessionExists(){&lt;br /&gt;//start the session session_start();&lt;br /&gt; if(!session_is_registered('userID'))&lt;br /&gt;{&lt;br /&gt; //the session variable isn't registered, send them back to the login page&lt;br /&gt;header( "Location: &lt;a href="http://discern.uits.iu.edu:8490/UI/index.php"&gt;http://discern.uits.iu.edu:8490/UI/index.php&lt;/a&gt;" );&lt;br /&gt;}&lt;br /&gt; else {return true;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Usage:&lt;br /&gt;include("../modules/login_func.php");&lt;br /&gt;if (sessionExists())&lt;br /&gt;{&lt;br /&gt;   //your page&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9077795680690183847-354221439301727749?l=inneslab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://inneslab.blogspot.com/feeds/354221439301727749/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9077795680690183847&amp;postID=354221439301727749' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9077795680690183847/posts/default/354221439301727749'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9077795680690183847/posts/default/354221439301727749'/><link rel='alternate' type='text/html' href='http://inneslab.blogspot.com/2008/02/handling-sessions.html' title='Handling Sessions'/><author><name>Saurabh Ajmera</name><uri>http://www.blogger.com/profile/04995191326065157388</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='18' height='32' src='http://bp0.blogger.com/_JEzW7NJF5CA/R6gSJev95FI/AAAAAAAAAAU/eIno5LEjd5U/S220/IMG_0700.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9077795680690183847.post-7341794038340013393</id><published>2008-02-09T12:12:00.000-08:00</published><updated>2008-02-09T12:31:04.862-08:00</updated><title type='text'>Including a Java Script File</title><content type='html'>&amp;#60;html&amp;#62;&lt;br /&gt;  &amp;#60;head&amp;#62;&lt;br /&gt;    &amp;#60;script type="text/javascript" src="file.js"&amp;#62;&amp;#60;/script&amp;#62; &lt;br /&gt;&lt;br /&gt;  &amp;#60;/head&amp;#62;&lt;br /&gt;&amp;#60;/html&amp;#62;&lt;br /&gt;&lt;br /&gt;Please don't use the shortcut &amp;#60;script type="text/javascript" src="file.js" /&amp;#62;&lt;br /&gt;This causes problems with Internet Explorer 6, which doesn't load the JavaScript page.&lt;br /&gt;&lt;br /&gt;Once you include the javascript file, it executes automatically when you load the HTML file. You can also group the code in JavaScript functions, which only executes when called explicitly(This is what we will be doing most of the time).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9077795680690183847-7341794038340013393?l=inneslab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://inneslab.blogspot.com/feeds/7341794038340013393/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9077795680690183847&amp;postID=7341794038340013393' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9077795680690183847/posts/default/7341794038340013393'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9077795680690183847/posts/default/7341794038340013393'/><link rel='alternate' type='text/html' href='http://inneslab.blogspot.com/2008/02/including-java-script-file.html' title='Including a Java Script File'/><author><name>Saurabh Ajmera</name><uri>http://www.blogger.com/profile/04995191326065157388</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='18' height='32' src='http://bp0.blogger.com/_JEzW7NJF5CA/R6gSJev95FI/AAAAAAAAAAU/eIno5LEjd5U/S220/IMG_0700.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9077795680690183847.post-3172227959601186762</id><published>2008-02-08T23:03:00.000-08:00</published><updated>2008-02-08T23:15:29.381-08:00</updated><title type='text'>Structure of a Users Page</title><content type='html'>&amp;#60;?php &lt;br /&gt;include("unregistered/header1.php");&lt;br /&gt;?&amp;#62;&lt;br /&gt;&amp;#60;title&amp;#62;Innes Lab::(Name of the Page)&amp;#60;/title&amp;#62;&lt;br /&gt;&amp;#60;?php &lt;br /&gt;include("user/userheader2.php");&lt;br /&gt;?&amp;#62;&lt;br /&gt;&amp;#60;body&amp;#62;&lt;br /&gt;&amp;#60;?php&lt;br /&gt;include("user/userLinks.php");&lt;br /&gt;This file will change depending on the which link you want to be active. Make sure use change the hrefs appropriately.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;include("unregistered/banner.php");&lt;br /&gt;?&amp;#62;&lt;br /&gt;&lt;br /&gt;&amp;#60;div id="page"&amp;#62;&lt;br /&gt;&lt;br /&gt;This is where you will show, whatever you want to show to the user. &lt;br /&gt;&lt;br /&gt;An Example of this structure can be found at &lt;a href="http://discern.uits.iu.edu:8490/UI/userHomePage.php"&gt;http://discern.uits.iu.edu:8490/UI/userHomePage.php&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&amp;#60;/div&amp;#62;&lt;br /&gt;&amp;#60;?php &lt;br /&gt;include ("unregistered/footer.php");&lt;br /&gt;?&amp;#62;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9077795680690183847-3172227959601186762?l=inneslab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://inneslab.blogspot.com/feeds/3172227959601186762/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9077795680690183847&amp;postID=3172227959601186762' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9077795680690183847/posts/default/3172227959601186762'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9077795680690183847/posts/default/3172227959601186762'/><link rel='alternate' type='text/html' href='http://inneslab.blogspot.com/2008/02/structure-of-users-page.html' title='Structure of a Users Page'/><author><name>Saurabh Ajmera</name><uri>http://www.blogger.com/profile/04995191326065157388</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='18' height='32' src='http://bp0.blogger.com/_JEzW7NJF5CA/R6gSJev95FI/AAAAAAAAAAU/eIno5LEjd5U/S220/IMG_0700.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9077795680690183847.post-2131419277184885392</id><published>2008-02-08T19:14:00.000-08:00</published><updated>2008-02-08T20:40:30.170-08:00</updated><title type='text'>Structure of Administrator's page</title><content type='html'>The System administrator pages has slightly different page structure. &lt;br /&gt;&lt;br /&gt;&amp;#60;?php &lt;br /&gt;include("header1.php");&lt;br /&gt;?&amp;#62;&lt;br /&gt;&amp;#60;title&amp;#62;InnesLab::Administrator&amp;#60;/title&amp;#62;&lt;br /&gt;&amp;#60;?php &lt;br /&gt;include("admin/adminheader2.php");&lt;br /&gt;?&amp;#62;&lt;br /&gt;&lt;br /&gt;&amp;#60;body&amp;#62;&lt;br /&gt;&amp;#60;?php&lt;br /&gt;include("admin/adminBanner.php");&lt;br /&gt;include("admin/adminLinksUsersSelected.php");&lt;br /&gt;&lt;br /&gt;The link file are the navigation link for the administrator. The links are highlighted to indicate the current section the administrator is looking at.&lt;br /&gt;&lt;br /&gt;The example shown above will have the USER link highlighted. I have made separate include files for different links.&lt;br /&gt;&lt;br /&gt;So, for highlighting Admin Accounts, include adminLinksAdminAccountsSelected.php.  &lt;br /&gt;&lt;br /&gt;All the UI files for the administrator are grouped in to the UI/admin folder.&lt;br /&gt;&lt;br /&gt;An Example of such implementation is&lt;br /&gt;&lt;a href="http://discern.uits.iu.edu:8490/UI/adminEditUser.php"&gt;http://discern.uits.iu.edu:8490/UI/adminEditUser.php&lt;/a&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;?&amp;#62;&lt;br /&gt;&lt;br /&gt;&amp;#60;div id="page"&amp;#62;&lt;br /&gt;&lt;br /&gt;What ever you want to display comes here. Take help from my html pages the I have up uploaded in the UI section. These files have .html extension, but whatever you make should have an .php extension.&lt;br /&gt;&lt;br /&gt;&amp;#60;?php &lt;br /&gt;include ("footer.php");&lt;br /&gt;?&amp;#62;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9077795680690183847-2131419277184885392?l=inneslab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://inneslab.blogspot.com/feeds/2131419277184885392/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9077795680690183847&amp;postID=2131419277184885392' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9077795680690183847/posts/default/2131419277184885392'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9077795680690183847/posts/default/2131419277184885392'/><link rel='alternate' type='text/html' href='http://inneslab.blogspot.com/2008/02/structure-of-administrators-page.html' title='Structure of Administrator&apos;s page'/><author><name>Saurabh Ajmera</name><uri>http://www.blogger.com/profile/04995191326065157388</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='18' height='32' src='http://bp0.blogger.com/_JEzW7NJF5CA/R6gSJev95FI/AAAAAAAAAAU/eIno5LEjd5U/S220/IMG_0700.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9077795680690183847.post-2599352485994283680</id><published>2008-02-04T23:54:00.000-08:00</published><updated>2008-02-10T16:49:05.811-08:00</updated><title type='text'>Writing a function</title><content type='html'>Hi,&lt;br /&gt;&lt;br /&gt;I have created a function to display the list of all the projects in the system.&lt;br /&gt;This is the getAllProjects() function from our system architecture.&lt;br /&gt;&lt;br /&gt;Since it belongs to the "Project Browsing" module. I have created a folder called "project browsing" which has a file called functions.php. functions.php will defination for all the functions that belong to this module.&lt;br /&gt;&lt;br /&gt;Before we start any new function we can write a short description about the function. Example:&lt;br /&gt;/*#########################################&lt;br /&gt;Author:your name&lt;br /&gt;Date:02/04/2008&lt;br /&gt;Description:This functions displays the list of all the projects on the website.&lt;br /&gt;It is called by all the pages that need list of projects to be displayed. &lt;br /&gt;###########################################*/&lt;br /&gt;function getAllProjects()&lt;br /&gt;{&lt;br /&gt;....&lt;br /&gt;....&lt;br /&gt;....&lt;br /&gt;}&lt;br /&gt;We can copy paste the Description of a function from our excel sheet.&lt;br /&gt;&lt;br /&gt;The page that calls this function is viewListOfAllProjects.php&lt;a href="http://discern.uits.iu.edu:8490/viewListOfAllProjects.php"&gt;http://discern.uits.iu.edu:8490/viewListOfAllProjects.php&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Please, look at the code and tell me, if you like my coding style. If you don't like it then we can change it to something thats more easy to understand. But, Please do not change the php file. &lt;br /&gt;&lt;br /&gt;A common coding style will help our code to be consistent.&lt;br /&gt;&lt;br /&gt;I have not commented the code very well, but i guess, it should be easy to understand.&lt;br /&gt;&lt;br /&gt;Thank you,&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9077795680690183847-2599352485994283680?l=inneslab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://inneslab.blogspot.com/feeds/2599352485994283680/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9077795680690183847&amp;postID=2599352485994283680' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9077795680690183847/posts/default/2599352485994283680'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9077795680690183847/posts/default/2599352485994283680'/><link rel='alternate' type='text/html' href='http://inneslab.blogspot.com/2008/02/writing-function.html' title='Writing a function'/><author><name>Saurabh Ajmera</name><uri>http://www.blogger.com/profile/04995191326065157388</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='18' height='32' src='http://bp0.blogger.com/_JEzW7NJF5CA/R6gSJev95FI/AAAAAAAAAAU/eIno5LEjd5U/S220/IMG_0700.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9077795680690183847.post-9190079900252396668</id><published>2008-02-04T23:48:00.000-08:00</published><updated>2008-02-04T23:54:46.938-08:00</updated><title type='text'>MySQLi Problem</title><content type='html'>Hi,&lt;br /&gt;&lt;br /&gt;Rajesh has solved the database connection problem. Well, the reason why we were not able to connect to the database is that, the uits webserver has a new version of MySQL, that is MySQLi ('i' Stands for improved). The syntax of MySQLi and MySQL is slightly different so we need to make sure that we get the syntax right.&lt;br /&gt;&lt;br /&gt;more information about mysqli can be found at &lt;a href="http://us.php.net/mysqli"&gt;http://us.php.net/mysqli&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9077795680690183847-9190079900252396668?l=inneslab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://inneslab.blogspot.com/feeds/9190079900252396668/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9077795680690183847&amp;postID=9190079900252396668' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9077795680690183847/posts/default/9190079900252396668'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9077795680690183847/posts/default/9190079900252396668'/><link rel='alternate' type='text/html' href='http://inneslab.blogspot.com/2008/02/mysqli-problem.html' title='MySQLi Problem'/><author><name>Saurabh Ajmera</name><uri>http://www.blogger.com/profile/04995191326065157388</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='18' height='32' src='http://bp0.blogger.com/_JEzW7NJF5CA/R6gSJev95FI/AAAAAAAAAAU/eIno5LEjd5U/S220/IMG_0700.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9077795680690183847.post-6037355270977857908</id><published>2008-02-04T22:54:00.000-08:00</published><updated>2008-02-04T23:03:40.520-08:00</updated><title type='text'>Structure of the webpage</title><content type='html'>include ("header1.php");&lt;br /&gt;&lt;br /&gt;&amp;#60;title&amp;#62;Innes Lab::(name of the page)&amp;#60;/title&amp;#62;&lt;br /&gt;&lt;br /&gt;include ("header2.php");&lt;br /&gt;&lt;br /&gt;&amp;#60;body&amp;#62;&lt;br /&gt;&lt;br /&gt;include links.php&lt;br /&gt;&lt;br /&gt;(our web site has different set of links for different purpose. So make sure you include the correct link file. I will be making the link files for the possible links. Thus if you don't find link file for your module, then please contact me)&lt;br /&gt;&lt;br /&gt;include ("banner.php");&lt;br /&gt;&lt;br /&gt;&amp;#60;div id="page"&amp;#62;&lt;br /&gt;&lt;br /&gt;write what ever you want to display here.&lt;br /&gt;&lt;br /&gt;&amp;#60;/div&amp;#62;&lt;br /&gt;&lt;br /&gt;include ("footer.php");&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;An example of this structure is test.php(its on the web server). Please refer to this file, to understand the structure of the webpage.&lt;br /&gt;&lt;br /&gt;Administrator module will need a different banner, ..so I will send another banner for administrator pretty soon. &lt;br /&gt;Use the &amp;#60;div id="page"&amp;#62;&lt;br /&gt;....&lt;br /&gt; &amp;#60;/div&amp;#62; section to display all the information to the user.&lt;br /&gt;&lt;br /&gt;Please let me know if you have any problems with this.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9077795680690183847-6037355270977857908?l=inneslab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://inneslab.blogspot.com/feeds/6037355270977857908/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9077795680690183847&amp;postID=6037355270977857908' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9077795680690183847/posts/default/6037355270977857908'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9077795680690183847/posts/default/6037355270977857908'/><link rel='alternate' type='text/html' href='http://inneslab.blogspot.com/2008/02/structure-of-webpage.html' title='Structure of the webpage'/><author><name>Saurabh Ajmera</name><uri>http://www.blogger.com/profile/04995191326065157388</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='18' height='32' src='http://bp0.blogger.com/_JEzW7NJF5CA/R6gSJev95FI/AAAAAAAAAAU/eIno5LEjd5U/S220/IMG_0700.JPG'/></author><thr:total>0</thr:total></entry></feed>
