Jitendra Kumar Agrawal Project

  • Upload
    m167

  • View
    223

  • Download
    0

Embed Size (px)

Citation preview

  • 8/7/2019 Jitendra Kumar Agrawal Project

    1/49

    An

    ELECTIVE PAPER REPORT

    ON

    PROTEINS&

    PROTEOMICS

    IN

    In Appearing M.Sc. Final Year (Bio-Tech.)2010-2011

    Submitted By-ARUN KUMAR POONIA

    M.Sc. Final Year(Bio-Tech) (2010-11)

  • 8/7/2019 Jitendra Kumar Agrawal Project

    2/49

    ACKNOWLEDGEMENTS

    First and foremost, I would like to thank my respected parents, whoalways encouraged me and taught me to think and workout

    innovatively whatsoever the field of life is. My sincere thanks goes to

    Mr.Subhanshu Mathur for his prudential suggestion throughout mysummer training schedule.

    I am greatly indebted to Mr. Vikram SinghMaam for her valuable

    suggestions without which the task of report making would have been

    really difficult. Last but not the least, my sincere thanks to all the staffmembers and friends for instilling in me a sense of self-confidence.

    Name :-VIKRAM SINGH

    Branch : Computer Engineering.Academic Year : 2010-2011

  • 8/7/2019 Jitendra Kumar Agrawal Project

    3/49

    INTRODUCTIONTO

    THE COMPANY

  • 8/7/2019 Jitendra Kumar Agrawal Project

    4/49

    SUMMITSOFTARCH (Estd.2005-06)

    SummitSoftArch is an organization engaged in the softwaredevelopment and trainings since inception in the year 2005. Since

    then, we are taking both Government and the private projects forsoftware development and training.

    We have organized number of staff trainings for various schools andprivate organizations.

    We are actively involved in,

    Software Development

    Medical Transcription

    Networking Solutions

    Application Development

    Company Profile

    DIRECTOR: ER. Himashu Gupta

    Technology A renowned name in the field of IT, and has

    been working in the field of softwaredevelopment from the last 5 years. In 2005,

    he laid the foundation of Summit Soft Archwith a small team. Since then, the company

    has undertaken many projects in government

    as well as private sector.

  • 8/7/2019 Jitendra Kumar Agrawal Project

    5/49

    Company Associates:-

    Mr.Rajendra Naruka

    Qualifications:

    MSc(Information Technology)

    Java Certified Professional

    Oracle Certified

    Mr. Vikas Dhoot

    Qualifications:

    A Level

    MBA(Finance)

    Projects Undertaken so far,

    Clinic Management SystemThe Customized Software for the clinic and for

    doctors practicing at private hospitals.

    Taxi Cab Management System

    Basic Accounting Software

    Website with E-Commerce

    Villa booking

    Surya Electrical project

  • 8/7/2019 Jitendra Kumar Agrawal Project

    6/49

    INTRODUCTIONTO

    Porkal industries

  • 8/7/2019 Jitendra Kumar Agrawal Project

    7/49

    Alumni portal is an internet based website that is being developed forJaipur Engineering College And Research Centre. This site will provide

    a common platform for to the graduates of this college where they canmeet virtually.

    Title of the project

    Development of a Repository and Search Engine for Alumni of College

    Abstract of the project

    This project is aimed at developing a repository for the alumni of the

    college, which is of importance to a college. The Repository and SearchEngine is an Internet based application that can be accessed

    throughout the World. Any one can access the search Engine to know

    about any Alumni of that college but cant able to add.

    Functional components of the project1. A person should be able to

    Click on a button or link to be taken to the specificapplication.

    The first page of the application should provide the user

    (student only) with the options of saving his/her details inthe database and searching for alumni.

    2. The page through which the student enter his/her details should

    allow saving of user details like name, year of passing, rollnumber, contact number, present address, permanent address,

    etc. The save page should have proper validation before allowingthe user to save user details into the database.

    3. The cancel button should take the user back to the home page

    (first page).

    4. The search page should allow search on the basis of name of theuser or roll number. Partial search should be allowed.

    5. Validation to be done on the front end save page i.e., the format

    of date to be entered and the roll number format, etc.

    Software Reqirements

    Front End:

    HTMLCSS

    Back End

    JSP

    Number Description

    1 Windows 95/98/XPwith MS-office

    2 MS Access 2003

    3 Apache Tomcat

    Server

    4 Web Designing

    Tools

  • 8/7/2019 Jitendra Kumar Agrawal Project

    8/49

    TECHNOLOGIES USED

  • 8/7/2019 Jitendra Kumar Agrawal Project

    9/49

    FRONT END

    HTML, short forHypertext Markup Language, is the predominant

    markup language for web pages. It provides a means to describe thestructure of text-based information in a document by denoting

    certain text as headings, paragraphs, lists, and so on and tosupplement that text with interactive forms, embedded images, and

    other objects. HTML is written in the form of labels (known as tags),surrounded by angle brackets. HTML can also describe, to some

    degree, the appearance and semantics of a document, and can include

    embedded scripting language code which can affect the behavior ofweb browsers and other HTML processors.

    1. Hypertextis ordinary text that has been dressed up with extrafeatures, such as formatting, images, multimedia, and links toother resources.

    2. Markup is the process of taking ordinary text and adding extra

    symbols. Each of the symbols used for markup in HTML is a

    command that tells a browser how to display the text.

    HTML versions

    July, 1993: Hypertext Markup Language, was published at IETF

    working draft (that is: not a standard yet).

    Nov, 1995: HTML 2.0 published as IETF Request for Comments:

    April 1995: An HTML 3.0 standard was proposed to the IETF by

    Dave Raggett

    Jan, 1997: HTML 3.2, published as a W3C Recommendation.

    Dec, 1997: HTML 4.0, published as a W3C Recommendation. It

    Offers three "flavors":

    Strict, in which deprecated elements are forbidden,

    Transitional, in which deprecated elements are allowed,

    Frameset, in which mostly only frame related elements are

    allowed;

  • 8/7/2019 Jitendra Kumar Agrawal Project

    10/49

    May 15, 2000: ISO HTML", based on HTML 4.01 Strict), published asan ISO/IEC international standard.

    HTML 5 is still an Editors Draft, and not endorsed by W3C yet.

    Elements

    Elements are the basic structure for HTML markup. Elements have two

    basic properties:

    1. Attributes2. Content.

    Each attribute and each element's content has certain restrictions thatmust be followed for an HTML document to be considered valid. An

    element usually has a start label (e.g. ) and an end label (e.g.). The element's attributes are contained in the start label and

    content is located between the labels.

    e.g. Content.

    Some elements, such as
    , do not have any content and so need

    no closing label.

    Attributes

    The attributes of an element are name-value pairs, separated by "=",

    and written within the start label of an element, after the element's

    name. The value should be enclosed in single or double quotes,although values consisting of certain characters can be left unquoted

    in HTML (but not XHTML)[ Leaving attribute values unquoted isconsidered unsafe. Most elements take any of several common

    attributes: id, class, style and title.

  • 8/7/2019 Jitendra Kumar Agrawal Project

    11/49

    Cascading Style Sheets (CSS)

    In web development, Cascading Style Sheets (CSS) is a style sheet

    language used to describe the presentation of a document written in a

    markup language. Its most common application is to style web pageswritten in HTML and XHTML, but the language can be applied to any

    kind of XML document, including SVG and XUL.

    CSS is used by both the authors and readers of web pages to definecolors, fonts, layout, and other aspects of document presentation. It is

    designed primarily to enable the separation of document content

    (written in HTML or a similar markup language) from document

    presentation (written in CSS). This separation can improve contentaccessibility, provide more flexibility and control in the specification ofpresentational characteristics, and reduce complexity and repetition in

    the structural content. CSS can also allow the same markup page to

    be presented in different styles for different rendering methods, suchas on-screen, in print, by voice and on Braille-based, tactile devices.

    CSS specifies a priority scheme to determine which style rules apply ifmore than one rule matches against a particular element. In this so-

    called cascade, priorities or weights are calculated and assigned to

    rules, so that the results are predictable.

    The CSS specifications are maintained by the World Wide WebConsortium (W3C). Internet media type (MIME type) text/css isregistered for use with CSS by RFC 2318 (March 1998).

    Use of CSS

    Prior to CSS, nearly all of the presentational attributes of HTML

    documents were contained within the HTML markup; all font colors,

    background styles, element alignments, borders and sizes had to beexplicitly described, often repeatedly, within the HTML. CSS allows

    authors to move much of that information to a separate style sheetresulting in considerably simpler HTML markup.

    Headings (h1 elements), sub-headings (h2), sub-sub-headings (h3)

    etc. are defined structurally using HTML. In print and on the screen,choice of font, size, color and emphasis for these elements is

    presentational.Prior to CSS, document authors who wanted to assign such

    typographic characteristics .The additional presentational markup in

  • 8/7/2019 Jitendra Kumar Agrawal Project

    12/49

    the HTML made documents more complex, and generally more difficultto maintain. To render all h2 tags in this manner, the markup had to

    be repeated for each heading. In CSS, presentation is separated fromstructure. In print, CSS can define color, font, text alignment, size,

    borders, spacing, layout and many other typographic characteristics. It

    can do so independently for on-screen and printed views. CSS alsodefines non-visual styles such as the speed and emphasis with which

    text is read out by aural text readers. The W3C now considers theadvantages of CSS for defining all aspects of the presentation of HTML

    pages to be superior to other methods. It has therefore deprecated the

    use of the entire original presentational HTML markup.

    Variations

    CSS has various levels and profiles. Each level of CSS builds upon the

    last, typically adding new features and are typically denoted as CSS1,CSS2, and CSS3. Profiles are typically a subset of one or more levelsof CSS built for a particular device or user interface. Currently there

    are profiles for mobile devices, printers, and television sets. Profiles

    should not be confused with media types which were added in CSS2.The first CSS specification to become an official W3C Recommendation

    isCSS level 1, published in December 1996. Among its capabilitiesare support for:

    1. Font properties such as typeface and emphasis

    2. Color of text, backgrounds, and other elements3. Text attributes such as spacing between words, letters, and lines

    of text4. Alignment of text, images, tables and other elements

    5. Margin, border, padding, and positioning for most elements6. Unique identification and generic classification of groups of

    attributes

    CSS level 2was developed by the W3C and published as a

    Recommendation in May 1998. A superset of CSS1, CSS2 includes anumber of new capabilities like

    1. Absolute, relative, and fixed positioning of elements,

    2. The concept of media types3. Support for aural style sheets and

    4. Bidirectional text

    5. New font properties such as shadows.

    CSS level 2 revisions 1 or CSS 2.1 fixes errors in CSS2, removes

    poorly-supported features and adds already-implemented browserextensions to the specification.

  • 8/7/2019 Jitendra Kumar Agrawal Project

    13/49

    CSS level 3 is currently under development. The W3C maintains a

    CSS3 progress report. As with the evolving XHTML specification, CSS3is modularized and will consist of several separate Recommendations.

    Limitations

    Different browsers will render CSS layout differently as a result of

    browser bugs or lack of support for CSS features. For example

    Microsoft Internet Explorer, whose older versions lacked many CSS 2.1properties, misinterpreted a significant number of important

    properties, such as "width", "height", and "float". Numerous so-calledCSS "hacks" must be implemented to achieve consistent layout among

    the most popular or commonly used user agents (browsers). Pixelprecise layouts can sometimes be impossible to achieve cross-browser.

    For larger sites, style sheets can grow to become extremely long and

    complex making editing and overall site management somewhat moredifficult and tedious than if a basic table layout were used.

    BACK END

    PHP is a server side scripting language. That means its processing happensin the server by consuming servers resources and sends only the output tothe client. In a client side scripting language like JavaScript, processinghappens in the clients computer consuming its resources.

    PHP can also be used as a language for Command line Scripting andDesktop applications. But its widely used for web applications.

    To understand the role of PHP, lets look at how a normal web request and aweb request that involves PHP happen. Please note that there can be manyintermediate steps involved but only the main and important ones have beenmentioned for understanding purposes.

    Cycle of a Normal Web Request

  • 8/7/2019 Jitendra Kumar Agrawal Project

    14/49

    Cycle of a Web Request That Involves PHP

    Dynamic Content

    You might have probably heard that using PHP you can create dynamicweb sites. To understand what dynamic means here, lets take a look atwelcome.html and welcome.php.

    Dont worry if you dont understand the code yet. Try to understandaccompanying explanations.

    welcome.html

    view sourceprint?01.02.03.Welcome to Our Web Site04.05.

    06.07.Welcome!

    08.09.

    Rest goes here...

    10.11.12.

    welcome.php

    view sourceprint?01.02.03.Welcome to Our Web Site04.

    http://www.phpknowhow.com/basics/role-of-php-in-web-applications/#viewSourcehttp://www.phpknowhow.com/basics/role-of-php-in-web-applications/#printSourcehttp://www.phpknowhow.com/basics/role-of-php-in-web-applications/#abouthttp://www.phpknowhow.com/basics/role-of-php-in-web-applications/#viewSourcehttp://www.phpknowhow.com/basics/role-of-php-in-web-applications/#printSourcehttp://www.phpknowhow.com/basics/role-of-php-in-web-applications/#abouthttp://www.phpknowhow.com/basics/role-of-php-in-web-applications/#viewSourcehttp://www.phpknowhow.com/basics/role-of-php-in-web-applications/#printSourcehttp://www.phpknowhow.com/basics/role-of-php-in-web-applications/#abouthttp://www.phpknowhow.com/basics/role-of-php-in-web-applications/#viewSourcehttp://www.phpknowhow.com/basics/role-of-php-in-web-applications/#printSourcehttp://www.phpknowhow.com/basics/role-of-php-in-web-applications/#about
  • 8/7/2019 Jitendra Kumar Agrawal Project

    15/49

    05.

    06.07.08.15.

    16.17.

    Rest goes here...

    18.

    19.20.

    No matter whats the current time of the day, if you request welcome.html,you would always see Welcome! as the heading. But if you requestwelcome.php before 12 oclock, you would see the heading as GoodMorning! and Welcome!, if it is after 12 (date() function uses servers timeand it may be different from your PCs time).

    Here welcome.html has a static behavior because it delivers same content

    always. But welcome.php has a dynamic behavior because the content itdelivers changes according to the time of the day. You can improve this fileand have different greetings for different time periods. As illustrated in thisexample, PHP can be used to build dynamic content that is based on thecontext. You would experience the real benefits of PHPs dynamic behaviorwhen you create database driven web applications.

    How PHP Engine Outputs Content

    When PHP interpreter reads a file, it only processes lines between tags. It outputs rest of the lines without any processing.

    For an example, in welcome.php, PHP interpreter outputs all the HTMLcontent till

  • 8/7/2019 Jitendra Kumar Agrawal Project

    16/49

    tag, it outputs rest of the lines without processing. Web server collects allthese outputs and sends to the client who made the request.

    As stated, only the output is sent to the client. So, no PHP content can beseen by viewing the source of PHP files in clients web browser.

    You can have more than one block of PHP content in a page and variablesyou define in these blocks are available to next blocks. For an example,

    below PHP file (welcome-new.php) behave as same as welcome.php.

    view sourceprint?01.

    08.09.10.11.Welcome to Our Web Site12.

    13.14.15.

    16.17.

    Rest goes here...

    18.19.20.

    Embedding PHP in HTML

    When we mix PHP and HTML content in a PHP file as we did inwelcome.php and welcome-new.php we call it as embedding PHP inHTML. We could achieve the same behavior with following PHP file(welcome-latest.php) which contains only PHP content.

    view source

    http://www.phpknowhow.com/basics/role-of-php-in-web-applications/#viewSourcehttp://www.phpknowhow.com/basics/role-of-php-in-web-applications/#printSourcehttp://www.phpknowhow.com/basics/role-of-php-in-web-applications/#abouthttp://www.phpknowhow.com/basics/role-of-php-in-web-applications/#viewSourcehttp://www.phpknowhow.com/basics/role-of-php-in-web-applications/#viewSourcehttp://www.phpknowhow.com/basics/role-of-php-in-web-applications/#printSourcehttp://www.phpknowhow.com/basics/role-of-php-in-web-applications/#abouthttp://www.phpknowhow.com/basics/role-of-php-in-web-applications/#viewSource
  • 8/7/2019 Jitendra Kumar Agrawal Project

    17/49

    print?01.

    Embedding PHP blocks in HTML let us get the help of PHP only where it isnecessary. As you can see in these welcome files, we only need PHP tooutput the correct greeting. We can add rest of the lines to the output by justkeeping them outside of PHP blocks instead of outputting each of those linesusing PHP. This saves PHP processing resources and lets us have clean andreadable files in our development.

    Forrunning PHP, you need a web server because PHP cant directly dealwith web requests. After installing, PHP acts as a sub-module of the web

    server which handles requests for PHP files.

    PHP is free and supported by almost all recognized operating systems andweb servers. Refer official documentation on how to configure PHP basedon the operating system and the web server.

    http://www.phpknowhow.com/basics/role-of-php-in-web-applications/#printSourcehttp://www.phpknowhow.com/basics/role-of-php-in-web-applications/#abouthttp://www.phpknowhow.com/basics/running-php-files/http://php.net/manual/en/install.phphttp://php.net/manual/en/install.phphttp://www.phpknowhow.com/basics/role-of-php-in-web-applications/#printSourcehttp://www.phpknowhow.com/basics/role-of-php-in-web-applications/#abouthttp://www.phpknowhow.com/basics/running-php-files/http://php.net/manual/en/install.phphttp://php.net/manual/en/install.php
  • 8/7/2019 Jitendra Kumar Agrawal Project

    18/49

    You need these installed in your computer to simulate a web server which isrequired for your PHP development. (WAMP)[Windows Apache, MySQL,PHP]

    For many PHP applications, Apache has been the desired web server andMySQL has been the desired database system. Being free and providingadvanced features are the main reasons for this popularity. AMP (Apache,MySQL, PHP) is a common abbreviation used for these three products.

    You might have seen the term LAMP which stands for Linux, Apache,MySQL and PHP (can also be Perl or Python) which has been a popularcombination for server environments.

    How to run

    If you double click on a HTML file (files with .html or.htm extension), itwould open on your web browser. But same wont happen if you doubleclicked on a PHP file (probably it would open in an editor). The reason isPHP files first should be processed in a web server before sending output tothe web browser.

    Therefore before running PHP files, they should be placed inside the webfolder of a web server and then make a request to desired PHP file by typingits URL in the web browser. If you installed a web server in your computer,

    usually the root of its web folder can be accessed by typing http://localhostin the web browser. So, if you placed a file called hello.php inside its webfolder, you can run that file by calling http://localhost/hello.php.

    Web folder can be changed based on your web host (if you hosted your website online) or the method you installed the web server in your computer. Ifyou used XAMPP to install Apache (web server) in your computer then theweb folder would be htdocs which is under the root directory of XAMPP.

    If you want to add anything from your PHP script to the output PHP enginegenerates which then would be sent to the client, you can use echo()language construct for that.

    http://www.apache.org/http://www.phpknowhow.com/basics/choosing-a-php-editor/http://www.phpknowhow.com/basics/role-of-php-in-web-applications/http://www.phpknowhow.com/basics/working-with-xampp/http://www.phpknowhow.com/basics/working-with-xampp/http://www.phpknowhow.com/basics/language-constructs-vs-built-in-functions/http://www.apache.org/http://www.phpknowhow.com/basics/choosing-a-php-editor/http://www.phpknowhow.com/basics/role-of-php-in-web-applications/http://www.phpknowhow.com/basics/working-with-xampp/http://www.phpknowhow.com/basics/working-with-xampp/http://www.phpknowhow.com/basics/language-constructs-vs-built-in-functions/
  • 8/7/2019 Jitendra Kumar Agrawal Project

    19/49

    view sourceprint?01.

    Copy above code and run it as greeting.php. You would see eitherGoodMorning orWelcome depending on current time (date() function usesservers time and it may be different from your PCs time). Now justcomment out echo statement like below and re-run the file.

    view sourceprint?1.//echo $greeting;

    You would see nothing. So, if you want anything to be added to the output,

    you should use echo() for that.

    Different Usage of echo()

    view sourceprint?1.echo$greeting;2.echo($greeting);

    Both of above statements produce same output. You can use echo() with or

    without brackets because its a language construct and not a function. Youwould commonly see echo() without brackets.

    view sourceprint?1.$myAge= 10;2.echo'My age is '.$myAge;

    http://www.phpknowhow.com/basics/printing-content-with-echo/#viewSourcehttp://www.phpknowhow.com/basics/printing-content-with-echo/#printSourcehttp://www.phpknowhow.com/basics/printing-content-with-echo/#abouthttp://www.phpknowhow.com/basics/running-php-files/http://www.phpknowhow.com/basics/printing-content-with-echo/#viewSourcehttp://www.phpknowhow.com/basics/printing-content-with-echo/#printSourcehttp://www.phpknowhow.com/basics/printing-content-with-echo/#abouthttp://www.phpknowhow.com/basics/printing-content-with-echo/#viewSourcehttp://www.phpknowhow.com/basics/printing-content-with-echo/#printSourcehttp://www.phpknowhow.com/basics/printing-content-with-echo/#abouthttp://www.phpknowhow.com/basics/language-constructs-vs-built-in-functions/http://www.phpknowhow.com/basics/functions/http://www.phpknowhow.com/basics/printing-content-with-echo/#viewSourcehttp://www.phpknowhow.com/basics/printing-content-with-echo/#printSourcehttp://www.phpknowhow.com/basics/printing-content-with-echo/#abouthttp://www.phpknowhow.com/basics/printing-content-with-echo/#viewSourcehttp://www.phpknowhow.com/basics/printing-content-with-echo/#printSourcehttp://www.phpknowhow.com/basics/printing-content-with-echo/#abouthttp://www.phpknowhow.com/basics/running-php-files/http://www.phpknowhow.com/basics/printing-content-with-echo/#viewSourcehttp://www.phpknowhow.com/basics/printing-content-with-echo/#printSourcehttp://www.phpknowhow.com/basics/printing-content-with-echo/#abouthttp://www.phpknowhow.com/basics/printing-content-with-echo/#viewSourcehttp://www.phpknowhow.com/basics/printing-content-with-echo/#printSourcehttp://www.phpknowhow.com/basics/printing-content-with-echo/#abouthttp://www.phpknowhow.com/basics/language-constructs-vs-built-in-functions/http://www.phpknowhow.com/basics/functions/http://www.phpknowhow.com/basics/printing-content-with-echo/#viewSourcehttp://www.phpknowhow.com/basics/printing-content-with-echo/#printSourcehttp://www.phpknowhow.com/basics/printing-content-with-echo/#about
  • 8/7/2019 Jitendra Kumar Agrawal Project

    20/49

    3.echo"My age is $myAge";

    Above also both statements produce same output. First one uses stringconcatenation while second one includes the variable within double quotes.ReferUsage of Quotes for more explanation on using variables insidequotes.

    view sourceprint?1.$intro= 'My age is ';2.$myAge= 10;

    3.4.echo$intro, $myAge;

    Above statement would output My age is 10. This is an example to showthat echo() can take more than one argument. However usage of this way isbit uncommon. Instead you would usually see string concatenation orvariables within double quotes when its required to output more than onevariable using a single echo() statement.

    Difference Between echo() and print()

    print() is also a language construct and behaves almost same as echo().Noticeable differences are print() cant take more than one argument and

    print() has a return value which is always 1.

    In PHP, single and double quotes are used to enclose strings. Following codewould throw you a PHP error since the string hasnt been enclosed byquotes.

    view sourceprint?

    1.$name= Robin Jackman;

    It has to be enclosed by quotes like below.

    view sourceprint?1.$name= 'Robin Jackman';

    http://www.phpknowhow.com/basics/operators/#string-concatenationhttp://www.phpknowhow.com/basics/operators/#string-concatenationhttp://www.phpknowhow.com/basics/usage-of-quotes/http://www.phpknowhow.com/basics/printing-content-with-echo/#viewSourcehttp://www.phpknowhow.com/basics/printing-content-with-echo/#printSourcehttp://www.phpknowhow.com/basics/printing-content-with-echo/#abouthttp://www.phpknowhow.com/basics/usage-of-quotes/#viewSourcehttp://www.phpknowhow.com/basics/usage-of-quotes/#printSourcehttp://www.phpknowhow.com/basics/usage-of-quotes/#abouthttp://www.phpknowhow.com/basics/usage-of-quotes/#viewSourcehttp://www.phpknowhow.com/basics/usage-of-quotes/#printSourcehttp://www.phpknowhow.com/basics/usage-of-quotes/#abouthttp://www.phpknowhow.com/basics/operators/#string-concatenationhttp://www.phpknowhow.com/basics/operators/#string-concatenationhttp://www.phpknowhow.com/basics/usage-of-quotes/http://www.phpknowhow.com/basics/printing-content-with-echo/#viewSourcehttp://www.phpknowhow.com/basics/printing-content-with-echo/#printSourcehttp://www.phpknowhow.com/basics/printing-content-with-echo/#abouthttp://www.phpknowhow.com/basics/usage-of-quotes/#viewSourcehttp://www.phpknowhow.com/basics/usage-of-quotes/#printSourcehttp://www.phpknowhow.com/basics/usage-of-quotes/#abouthttp://www.phpknowhow.com/basics/usage-of-quotes/#viewSourcehttp://www.phpknowhow.com/basics/usage-of-quotes/#printSourcehttp://www.phpknowhow.com/basics/usage-of-quotes/#about
  • 8/7/2019 Jitendra Kumar Agrawal Project

    21/49

    While both single and double quotes can be used to enclose strings, there isa difference in how PHP interprets two methods. If you used double quotesthen PHP would interpret variables and special characters (\t, \n etc) insidethe string but if you used single quotes PHP would consider only the literalvalues of the whole string.

    view sourceprint?1.$name= 'Robin Jackman';2.echo"Name is $name"; // Would print Name is RobinJackman3.echo'Name is $name'; // Would print Name is $name

    Its better that you use double quotes only when you want to pass variables

    and special characters and use single quotes when you only want to passpure strings like $name variable in above examples.

    The reason is having double quotes requires PHP interpreter to check forvariables and special characters inside the string which is an extra step. Eventhough time it takes for this is trivial, you should considerwritingoptimized code as much as possible.

    Variables and Constants

    In programming, a variable means a value holder. A variable can hold thesame value or the value it holds can get changed during the runtime of a

    program.

    view sourceprint?

  • 8/7/2019 Jitendra Kumar Agrawal Project

    22/49

    echo"$greeting $name";echo'
    ';

    $name= 'Edward';echo"$greeting $name";echo'
    ';

    ?>

    Run above script in web browser and you would see following three lines.

    Welcome Tom

    Welcome Jack

    Welcome Edward

    In this script both $greeting and $name are variables. You can see that$greeting holds the same value throughout the script while value of $namegets changed. We print
    tags just to have line breaks in the browser.

    Naming Variables

    In PHP, all variables should start with $ sign. The part after$ sign is calledvariable name.

    Variable names can only contain letters, numbers and underscores. A variable name should only start with a letter or an underscore. Variable names are case-sensitive. That means $Greeting and

    $greeting are two different variables.

    ReferPHP Coding Standards to see some good practices in variable naming.

    view sourceprint?1.$firstName// Correct

    2.$first_name// Correct3.$firstName1// Correct4.$_firstName// Correct5.$first-name // Wrong (Hyphen is not allowed)6.$4firstName// Wrong (Starts with a number)

    http://www.phpknowhow.com/basics/running-php-files/http://www.phpknowhow.com/basics/coding-standards/http://www.phpknowhow.com/basics/variables-and-constants/#viewSourcehttp://www.phpknowhow.com/basics/variables-and-constants/#printSourcehttp://www.phpknowhow.com/basics/variables-and-constants/#abouthttp://www.phpknowhow.com/basics/running-php-files/http://www.phpknowhow.com/basics/coding-standards/http://www.phpknowhow.com/basics/variables-and-constants/#viewSourcehttp://www.phpknowhow.com/basics/variables-and-constants/#printSourcehttp://www.phpknowhow.com/basics/variables-and-constants/#about
  • 8/7/2019 Jitendra Kumar Agrawal Project

    23/49

    Arrays

    All the variables considered so far could contain only one value at a time.Arrays provide a way to store a set of values under one variable. Refer thearticle Arrays to see how PHP provides arrays.

    Predefined Variables

    PHP provides a set of predefined variables. Most of them are arrays. Theiravailability and values are based on the context. For an example $_POSTcontains all the values submitted via a web form that used post method.Refer PHP manual for more information onpredefined variables.

    Constants

    As name describes, constants hold values that dont get changed during theruntime of a script. Same naming rules apply for constants except that $ signis not used when defining constants. To give an emphasis to constants, its acommon practice to define constant names in upper-case.

    view sourceprint?

    define('SITE_URL', 'http://www.example.com');echoSITE_URL; // Would print http://www.example.com

    Once defined, a new value cannot be assigned to a constant.

    view sourceprint?define('SITE_URL', 'http://www.google.com');echoSITE_URL; // Would still printhttp://www.example.com

    http://www.phpknowhow.com/basics/arrays/http://www.phpknowhow.com/basics/arrays/http://www.php.net/manual/en/reserved.variables.phphttp://www.phpknowhow.com/basics/variables-and-constants/#viewSourcehttp://www.phpknowhow.com/basics/variables-and-constants/#printSourcehttp://www.phpknowhow.com/basics/variables-and-constants/#abouthttp://www.example.com/http://www.example.com/http://www.phpknowhow.com/basics/variables-and-constants/#viewSourcehttp://www.phpknowhow.com/basics/variables-and-constants/#printSourcehttp://www.phpknowhow.com/basics/variables-and-constants/#abouthttp://www.google.com/http://www.example.com/http://www.phpknowhow.com/basics/arrays/http://www.phpknowhow.com/basics/arrays/http://www.php.net/manual/en/reserved.variables.phphttp://www.phpknowhow.com/basics/variables-and-constants/#viewSourcehttp://www.phpknowhow.com/basics/variables-and-constants/#printSourcehttp://www.phpknowhow.com/basics/variables-and-constants/#abouthttp://www.example.com/http://www.example.com/http://www.phpknowhow.com/basics/variables-and-constants/#viewSourcehttp://www.phpknowhow.com/basics/variables-and-constants/#printSourcehttp://www.phpknowhow.com/basics/variables-and-constants/#abouthttp://www.google.com/http://www.example.com/
  • 8/7/2019 Jitendra Kumar Agrawal Project

    24/49

    JAVADATABASE

    CONNECTIVITY

  • 8/7/2019 Jitendra Kumar Agrawal Project

    25/49

    JDBC (Java DataBase Connectivity)JDBC stands for java database connectivity that is used for connecting

    certain application a webpage or a form to the database.

    JDBC DriversThe connection to the database is handled by the JDBC Driver class.

    The Java SDK contains only one JDBC driver, a jdbc-odbc bridge that

    can communicate with an existing Open Database Conectivity (ODBC)driver. Other databases need a JDBC driver specific to that database.

    The JDBCConnectionDriver class implements the java.sql.Driver class

    and acts as a pass-through driver by forwarding JDBC requests to thereal database JDBC Driver. The JDBC driver class is loaded with a call

    to Class.forName(drivername).These next lines of code show how to load three different JDBC driver

    classes:

    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");Class.forName("postgresql.Driver");

    Class.forName("oracle.jdbc.driver.OracleDriver");

  • 8/7/2019 Jitendra Kumar Agrawal Project

    26/49

    Each JDBC driver is configured to understand a specific URL somultiple JDBC drivers can be loaded at any one time. When you

    specify a URL at connect time, the first matching JDBC driver isselected.

    The jdbc-odbc bridge accepts Uniform Resource Locators (URLs)

    starting with jdbc:odbc: and uses the next field in that URL to specifythe data source name. The data source name identifies the particular

    database scheme you wish to access. The URL can also include moredetails on how to contact the database and enter the account.

    JDBC drivers are divided into four types. Drivers may also becategorized as

    1. pure Java driversIf they are used for client applications

    2. thin drivers

    If they are used for applets

    The four types are as follows:1. Type 1 Drivers (JDBC-ODBC bridge and ODBC driver)

    Type 1 JDBC drivers are the bridge drivers such as the jdbc-odbcbridge. These drivers rely on an intermediary such as ODBC to transfer

    the SQL calls to the database. Bridge drivers often rely on native code,

    although the jdbc-odbc library native code is part of the Java1 2 virtualmachine.

  • 8/7/2019 Jitendra Kumar Agrawal Project

    27/49

    2. Type 2 Drivers (Native-API partly-Java driver)

    Type 2 Drivers use the existing database API to communicate with the

    database on the client. Although Type 2 drivers are faster than Type 1

    drivers, Type 2 drivers use native code and require additionalpermissions to work in an applet.A Type 2 driver might need client-side database code to connect over

    the network.

    3. Type 3 Drivers ( JDBC-Net pure Java driver)

    Type 3 Drivers call the database API on the server. JDBC requestsfrom the client are first proxied to the JDBC Driver on the server to

    run. Type 3 and 4 drivers can be used by thin clients as they need nonative code.

  • 8/7/2019 Jitendra Kumar Agrawal Project

    28/49

    4. Type 4 Drivers (Native-protocol pure Java driver)

    The highest level of driver reimplements the database network API in

    the Java language. Type 4 drivers can also be used on thin clients as

    they also have no native code.

    Database Connections

    A database connection can be established with a call to the

    DriverManager.getConnection method. The call takes a URL that

    identifies the database, and optionally, the database login user nameand password.

    Connection con = DriverManager.getConnection(url);Connection con = DriverManager.getConnection(url,

    "user", "password");After a connection is established, a statement can be run against thedatabase. The results of the statement can be retrieved and the

    connection closed.

    StatementsThere are three basic types of SQL statements used in the JDBC API:

    1. CallabelStatement

    2. Statement

    3. PreparedStatement

    CallabelStatementWhen a Statement or PreparedStatement is sent to the database, the

    database driver translates it into a format the underlying database can

    recognize.

  • 8/7/2019 Jitendra Kumar Agrawal Project

    29/49

    Once you have established a connection to a database, you can usethe Connection.prepareCall method to create a callable statement. A

    callable statement lets you execute SQL stored procedures.

    This next example creates a CallableStatement object with three

    parameters for storing account login information.

    CallableStatement cs = con.prepareCall("{call accountlogin(?,?,?)}");cs.setString(1,theuser);

    cs.setString(2,password);

    cs.registerOutParameter(3,Types.DATE);cs.executeQuery();

    Date lastLogin = cs.getDate(3);

    StatementsThe Statement interface lets you execute a simple SQL statement with

    no parameters. The SQL instructions are inserted into the Statementobject when the Statement.executeXXX method is called.

    I. Query Statement:

    This code segment creates a Statement object and calls the

    Statement.executeQuery method to select text from the dba database.The results of the query are returned in a ResultSet object.

    Statement stmt = con.createStatement();

    ResultSet results = stmt.executeQuery("SELECT TEXT FROM dba ");

    Update Statement:

    This code segment creates a Statement object and calls theStatement.executeUpdate method to add an email address to a table

    in the dba database.

    String updateString ="INSERT INTO dba VALUES (some text)";int count = stmt.executeUpdate(updateString);

    Prepared Statements

    The PreparedStatement interface descends from the Statementinterface and uses a template to create a SQL request. Use aPreparedStatement to send precompiled SQL statements with one or

    more parameters.Query PreparedStatement:

    You create a PreparedStatement object by specifying the templatedefinition and parameter placeholders. The parameter data is inserted

    into the PreparedStatement object by calling its setXXX methods and

  • 8/7/2019 Jitendra Kumar Agrawal Project

    30/49

    specifying the parameter and its data. The SQL instructions andparameters are sent to the database when the executeXXX method is

    called.This code segment creates a PreparedStatement object to select user

    data based on the user's email address. The question mark ("?")

    indicates this statement has one parameter.

    PreparedStatement pstmt = con.prepareStatement(select theuser from

    registration where

    emailaddress like ?");//Initialize first parameter with email address

    pstmt.setString(1, emailAddress);ResultSet results = ps.executeQuery();

    Once the PreparedStatement template is initialized, only the changedvalues are inserted for each call.

    pstmt.setString(1, anotherEmailAddress);

    Note: Not all database drivers compile prepared statements.

    Update PreparedStatement:

    This code segment creates a PreparedStatement object to update aseller's registration record. The template has five parameters, which

    are set with five calls to the apprpriate PreparedStatement.setXXXmethods.

    PreparedStatement ps = con.prepareStatement("insert into registration(theuser, password,

    emailaddress, creditcard,

    balance) values (?, ?, ?, ?, ?)");

    ps.setString(1, theuser);

    ps.setString(2, password);ps.setString(3, emailaddress);

    ps.setString(4, creditcard);ps.setDouble(5, balance);

    ps.executeUpdate();

    Caching Database results

    The PreparedStatement concept of reusing requests can be extended

    to caching the results of a JDBC call. For example, an auction itemdescription remains the same until the seller changes it. If the item

    receives thousands of requests, the results of the statement: query

  • 8/7/2019 Jitendra Kumar Agrawal Project

    31/49

    "select description from auctionitems where item_id='4000343'" mightbe stored more efficiently in a hash table.

    Storing results in a hash table requires the JDBC call be interceptedbefore creating a real statement to return the cached results, and the

    cache entry be cleared if there is a corresponding update to that

    item_id.Result Sets

    The ResultSet interface manages access to data returned from aquery. The data returned equals one row in a database table. Some

    queries return one row of data while many queries return multiple

    rows of data.You use getType methods to retrieve data from specific columns for

    each row returned by the query. This example retrieves the TEXTcolumn from all tables with a TEXT column in the dba database. The

    results.next method moves to the next retrieved row until all returnedrows are processed.

    Statement stmt = con.createStatement();

    ResultSet results = stmt.executeQuery("SELECT TEXT FROM dba ");while(results.next())

    {String s = results.getString("TEXT");

    displayText.append(s + "\n");

    }stmt.close();

    Generally JDBC enables an application to do three things

    1. Establish a connection with a database.2. Send SQL statements.

    3. Process the results.

  • 8/7/2019 Jitendra Kumar Agrawal Project

    32/49

    Scrolling Result Sets

    Before JDBC 2.0, JDBC drivers returned read-only result sets with

    cursors that moved in one direction, forwards. Each element wasretrieved by calling the next method on the result set.

    JDBC 2.0 introduces scrollable results sets whose values can be readand updated if reading and updating is supported by the underlyingdatabase. With scrollable result sets, any row can be selected at

    random, and the result set can be traversed forwards and backwards.One advantage to the new result set is you can update a set of

    matching rows without having to issue an additional executeUpdate

    call. The updates are made using JDBC calls and so no custom SQLcommands need to be generated. This improves the portability of the

    database code you create.Both Statements and PreparedStatements have an additional

    constructor that accepts a scroll type and an update type parameter.The scroll type value can be one of the following values:

    1. ResultSet.TYPE_FORWARD_ONLY

    Default behavior in JDBC 1.0, application can only call next() onthe result set.

    2. ResultSet.SCROLL_SENSITIVEResultSet is fully navigable and updates are reflected in the

    result set as they occur.

  • 8/7/2019 Jitendra Kumar Agrawal Project

    33/49

    3. ResultSet.SCROLL_INSENSITIVEResult set is fully navigable, but updates are only visible after

    the result set is closed. You need to create a new result set tosee the results.

    The update type parameter can be one of the following two values:

    1. ResultSet.CONCUR_READ_ONLYThe result set is read only.

    2. ResultSet.CONCUR_UPDATABLEThe result set can be updated.

    Navigating the ResultSetThe fully scrollable result set returns a cursor which can be moved

    using simple commands. By default the result set cursor points to therow before the first row of the result set. A call to next() retrieves the

    first result set row.

    The cursor can also be moved by calling one of the following ResultSetmethods:

    1. beforeFirst():Default position. Puts cursor before the first row of the result set.

    2. first():Puts cursor on the first row of the result set.

    3. last():

    Puts cursor before the last row of the result set.4. afterLast()

    Puts cursor beyond last row of the result set. Calls to previous movesbackwards through the ResultSet.

    5. absolute(pos):Puts cursor at the row number position where absolute(1) is the firstrow and absolute(-1) is the last row.

    6. relative(pos):Puts cursor at a row relative to its current position where relative(1)

    moves row cursor one row forward.

  • 8/7/2019 Jitendra Kumar Agrawal Project

    34/49

    SOFTWARESAND

    TOOLS USED

  • 8/7/2019 Jitendra Kumar Agrawal Project

    35/49

    For developing this Alumni website we have used various developingtools and softwares. Following is the list of tools according to their

    use:

    Front End:

    Microsoft Visual Interdev 6.0This particular tool is available in Microsoft Visual Studio 6.0package and is solely used for designing HTML pages, HTML

    forms, setting their alignment, and java script coding. This is

    very simple to handle and code in it. In this tool a programmerneed not be code geek if he has very intermediate knowledge of

    coding and alignment of the objects than he can very efficient incoding.

    Macromedia Dreamweaver

    This is an advanced tool for preparing the Graphical UserInterface of applications. We used this tool for designing HTMLpages because it gives us some more advanced options such as

    property pages, use of style CSS and more flexibility over the

    page design and layout. Styles can be handled more comfortablyin the macromedia dreamweaver. By using this tool programmer

    need not to learn the tags of HTML & CSS or any other webbased application development. This supports all possible

    frameworks of development and is been used in all professional

    market for development.

    Xara Webstyle 4This tool is again used for developing HTML pages and their

    objects such as animated texts, banners, 3D Headings, Logos,Themes, and Dividers. Predefined objects of XARA are very

    simply editable and are manageable according to the resolution

    of the image. Themes of xara can be directly used to create awhole website.

    BACK END :

    DataBase Created InMicrosoft Office Access 2003Is a relational database management system from

    Microsoft. It is a database manager tool that is used

    for creating database in the form of tables.Thisparticular tool is provided by Microsoft in the

    package MS Office 2003.

  • 8/7/2019 Jitendra Kumar Agrawal Project

    36/49

    DATABASEVIEW

  • 8/7/2019 Jitendra Kumar Agrawal Project

    37/49

    Tables and their view:-

    Login Table:-

    Login table has two columns as u can see and is used for storing theuser name and the passwords of the users.

    Primary keyUsername

    Login

    username password

    admin mjrp

    jitendra jitendra

    rahul rahul

    mahesh mahesh

    Contact_Us:-

    This table is made for storing the name, mailid, and phone, request ofany user or visitor. Contents of this table can be viewed by the

    administrator only.

    contact

    name mailid phone res

    devanshu [email protected] 98989898 add me

    avinash [email protected] 4456564 add me

    joby [email protected] 7878878 add me

    nakul [email protected] 78787787 add me

    rohit [email protected] 9414044644 add me

    Scrap:-

    This table is used to store the scraps that friends exchange. Along withthe scraps the receiver id and the sender id is also stored in this table.

  • 8/7/2019 Jitendra Kumar Agrawal Project

    38/49

    scrap

    recuidsendu

    idscrap date

    avinash admin hi avinash how r u . you areconfirmed as the part of thisassociation. thanks

    Tue Sep 1819:50:01GMT+05:30 2007

    avinash admin have a nice day Tue Sep 1819:50:31GMT+05:30 2007

    rohit avinash

    hi rohit how r u ..... Tue Sep 1819:51:09GMT+05:30 2007

    rohit avinash hey where r u yar.. Tue Sep 1819:51:25GMT+05:30 2007

    Profile Table:-

    This the main table of the website since it stored the complete profile

    of each and every pass out student of the college. This table isdepending on the login table by referential constraints .The username

    column in this table is a foreign key.

    Foreign keyusername

    profile

    name pass cpass radd oadd fname lname oeid aeid jprofile uniroll batch

    sh avinash avinash vaishali mumbai avinash mittal [email protected] [email protected] Birla softPvt. Ltd.

    04/11144 2008

    alumni alumni vaishali pune rohit mittal [email protected] [email protected] microsoft 04/11487 2008

    nshu ashu ashu khatipura delhi himanshu gupta [email protected] [email protected] Infosys 04/15485 2008

  • 8/7/2019 Jitendra Kumar Agrawal Project

    39/49

    CREATINGTHE

    DATA SOURCE

  • 8/7/2019 Jitendra Kumar Agrawal Project

    40/49

    CreatingDSNDouble click on theData Sources option ,ODBC Data Source

    Administrator dialogbox will appear on thescreen

  • 8/7/2019 Jitendra Kumar Agrawal Project

    41/49

    The Create New Data Sourcedialog box will appear on thescreen.It will list the driver which wewant to set up for the datasource.Driver will contains all thespecification for interacting withthe database.

    From the list of drivers , select theoption "Dirver do Microsoft

    Access(*.mdb)" , as we are creatingthe DSN to connect to theMicrosoft

    Access Database.

    Now, in this dialog boxwe have to specify thefollowing information,

    Data Source Name: It willbe the name given foryour DSN, which we willuse in our code tointeract with thedatabase.

  • 8/7/2019 Jitendra Kumar Agrawal Project

    42/49

    Now, our DSNlibdata willappear in the list

    of Users DSN

  • 8/7/2019 Jitendra Kumar Agrawal Project

    43/49

    ALUMNI WEBSITE.An Insight view

  • 8/7/2019 Jitendra Kumar Agrawal Project

    44/49

  • 8/7/2019 Jitendra Kumar Agrawal Project

    45/49

    Login Form :-

    This is the home page or we can say the index page of our website. Inthe right hand side of the page we have provided it with a form that islogin form wherein user has to enter the details to log in to the

    website.

    Edit Profile:-

    In this page named as profile .jsp we have given to user thefunctionality of modifying his or her profile. This page appears once log

    in the website and by clicking edit profile link. This page automatically

    loads the profile of user so that user can make any updations he wantsto. Some of the text fields have been made just read only by the

    admin in this page such as BRANCH, BATCH, and DOB.

    Contact Us:-

    This is the contact form which is used by any of the website viewerwho wants to contact the website administrator. He can post messages

    or any comments to the administrator.

  • 8/7/2019 Jitendra Kumar Agrawal Project

    46/49

    is is the search form for the website.In this form three search fields are provided

    which are

  • 8/7/2019 Jitendra Kumar Agrawal Project

    47/49

    Search Friends:

    1. Name2. Branch

    3. Year of passing

    This search page is so flexibly made that it can search the studentson the basis of any combination of fields values.So even if you nowhe year of passing and the branch you can very easily find the

    particular student.

  • 8/7/2019 Jitendra Kumar Agrawal Project

    48/49

    crap Me:-

  • 8/7/2019 Jitendra Kumar Agrawal Project

    49/49

    References and bibliography:1. http://www.jsptut.com/ (for JSP tutorial)

    2. http://www.cise.ufl.edu/~jhammer/classes/Oracle/Intro_JDBC.h

    tm (for JDBC tutorial)

    3. http://jakarta.apache.org/tomcat/tomcat-5.0-doc/building.html

    4. Alumni websites of many institutes(IIT,IIM)

    5. www.java2s.com

    6. www.Wikipedia.com

    http://www.java2s.com/http://www.java2s.com/