04-09-2014, 02:44 PM
This reasearch and development in php language is solely based on the creation and connectivity of web pages or websites to the open sources. php is the web language used to creation of websites and web pages. other than php HTML,CSS,JAVA SCRIPT,JQUERY are some other ways to create and design a web page. these are the coding languages that helps in making of a page.
INTRODUCTION TO PHP PHP is “Hypertext Preprocessor". It is Web Development on LAMP (Linux Apache MySql& PHP) platform. We are also specialized in Open Source Content Management System and Scripts Installations and Customizations as per requirement at very competitive rate. Shaping Technologies provides expert offshore PHP development services from India, gaining its expertise from years of experience in PHP web development and PHP application development. PHP is a server-side scripting language designed for web development but also used as a general-purpose programming language. PHP is now installed on more than 244 million websites and 2.1 million web servers. Originally created by RasmusLerdorf in 1995, the reference implementation of PHP is now produced by The PHP Group. While PHP originally stood for Personal Home Page, it now stands for PHP: Hypertext Preprocessor, a recursive acronym. PHP code is interpreted by a web server with a PHP processor module, which generates the resulting web page: PHP commands can be embedded directly into an HTML source document rather than calling an external file to process data. It has also evolved to include a command-line interface capability and can be used in standalonegraphical applications. It is open source software, created in 1995 by RasmusLerdorf and its scripts are executed on the server. PHP files can contain text, HTML tags and scripts with a file extension of ".php". It can be used to create login pages, design a form, and create forums, surveys, dynamic and static websites and many more. 1.1.1 Features: • HTTP authentication with PHP • Cookies and Sessions • Dealing with XForms • Handling file uploads • Using remote files and Connection handling • Persistent Database Connections • Safe mode and Security. Addition of New Features • Support for namespaces has been added. • Support for Late Static Bindings has been added. • There are two new magic methods, __callStatic() and __invoke(). • Nowdoc syntax is now supported, similar to Heredoc syntax, but with single quotes. • Heredocs may now be declared using double quotes, complementing the Nowdoc syntax. • Constants can now be declared outside a class using the const keyword. • The ternary operator now has a shorthand form- “?:” 1.2. Introduction to open source Open source as a development model promotes a) universal access via free license to a product's design or blueprint, and b) universal redistribution of that design or blueprint, including subsequent improvements to it by anyone Generally, open source refers to a computer program in which the source code is available to the general public for use and/or modification from its original design. Open source code is typically created as a collaborative effort in which programmers improve upon the code and share the changes within the community. Open source sprouted in the technological community as a response to proprietary software owned by corporations. The open-source model includes the concept of concurrent yet different agendas and differing approaches in production, in contrast with more centralized models of development such as those typically used in commercial software companies [page needed] A main principle and practice of open-source software development is peer production by bartering and collaboration, with the end-product, source-material, "blueprints", and documentation available at no cost to the public. 1.2.1 Syntax of PHP ? PHP is denoted in the page with opening and closing tags, as follows: <?php ?> ? PHP lines end with a semicolon, generally speaking: <?php // First line of code goes here; // Second line of code goes here; // Third line of code goes here; ?> You can add comments in your program, as in the preceding code, through double slashes (//) for one-liners /* and */ for opening and closing comment tags that may extend over several lines of code. 1.2.2 PHP integrate with HTML 1. Modify the highlighted lines of firstprog.php: <html> <head> <title>My First PHP Program</title> </head> <body> <?php echo “this is my first page.”; ?> </body> </html> 1.2.3 VARIABLES Unlike constants, variables are obviously meant to be variable—they are meant to change or be changed at some point in your program. Using Variables In this exercise, you’ll add variables to your existing script. Open your text editor and make the following changes to your moviesite.php file (noted in highlighted lines) <html> <head> <title>My Movie Site</title> </head> <body> <?php $m="My favorite movie is"; echo "$m"; ?></br> <?php $movierate="RAMBO 4" ; echo "$movierate"; ?> </body> </html> 1.2.4 Advantages of PHP • Easy to learn: PHP has a short learning curve and programmers can quickly become productive. PHP was designed to appeal to Web designers and HTML coders, and they appreciate the ability to freely mix HTML and PHP. • Open Source: PHP is distributed under an Apache-style license that allows for both commercial and non-commercial use and development. This means that you can use it freely, without paying any licenses fees for machine, CPU, and so on. Also, there is a worldwide network of talented developers continuously improving and enhancing PHP. • Community: PHP has a large base of users and developers. It is easy to find programmers fluent in the language. Many online resources are dedicated to PHP (Web sites, mailing lists, and so on) that provide valuable information and support. • Database support: PHP provides extensive database support. It supports ODBC, open source databases such as MySQL and PostgreSQL, as well as commercial ones such as Microsoft SQL Server, Oracle, and Sybase. • Multiplatform support: PHP runs on a variety of platforms and Web servers. PHP runs in most flavors of Unix and Windows as well as other OS such as Mac OS, OS X, or OS/2. • Multiplatform support: PHP runs on a variety of platforms and Web servers. PHP runs in most flavors of UNIX and Windows as well as other OS such as Mac OS, OS X, or OS/2. • Safe mode: PHP allows execution of code in restricted environments. This option is very attractive to ISP and Application Server Providers, which can offer PHP to their clients without compromising security. These providers often want to serve multiple customers using a shared infrastructure. 1.3 HTML Hypertext Markup Language (HTML) is the predominant markup language for web pages. HTML elements are the basic building-blocks of web pages. HTML is written in the form of HTML elements consisting of tags, enclosed in angle brackets (like <html>), within the web page content. HTML tags most commonly come in pairs like <h1> and </h1>, although some tags, known as empty elements, are unpaired, for example <img>. The first tag in a pair is the start tag, the second tag is the end tag (they are also called opening tags and closing tags). In between these tags web designers can add text, tags, comments and other types of text-based content. The purpose of a web browser is to read HTML documents and compose them into visible or audible web pages. The browser does not display the HTML tags, but uses the tags to interpret the content of the page. HTML elements form the building blocks of all websites. HTML allows images and objects to be embedded and can be used to create interactive forms. It provides a means to create structured documents by denoting structural semantics for text such as headings, paragraphs, lists, links, quotes and other items. It can embed scripts in languages such as JavaScript which affect the behaviour of HTML web pages. Web browsers can also refer to Cascading Style Sheets (CSS) to define the appearance and layout of text and other material. The W3C, maintainer of both the HTML and the CSS standards, encourages the use of CSS over explicitly presentational HTML markup. HTML documents are composed entirely of HTML elements that, in their most general form have three components: a pair of tags, a "start tag" and "end tag"; some attributes within the start tag; and finally, any textual and graphical content between the start and end tags, perhaps including other nested elements. The HTML element is everything between and including the start and end tags. Each tag is enclosed in angle brackets. The general form of an HTML element is therefore: <tag attribute1="value1" attribute2="value2">content</tag>. Some HTML elements are defined as empty elements and take the form <tag attribute1="value1" attribute2="value2" >. Empty elements may enclose no content. The name of an HTML element is the name used in the tags. Note that the end tag's name is preceded by a slash character, "/", and that in empty elements the end tag is neither required nor allowed. If attributes are not mentioned, default values are used in each case. Most of the attributes of an element are name-value pairs, separated by "=" and written within the start tag of an element after the element's name. The value may be enclosed in single or double quotes, although values consisting of certain characters can be left unquoted in HTML. Leaving attribute values unquoted is considered unsafe.In contrast with name-value pair attributes, there are some attributes that affect the element simply by their presence in the start tag of the element, like the ismap attribute for the imgelement. There are several common attributes that may appear in many elements: • The id attribute provides a document-wide unique identifier for an element. This is used to identify the element so that style sheets can alter its presentational properties, and scripts may alter, animate or delete its contents or presentation. Appended to the URL of the page, it provides a globally unique identifier for the element, typically a sub-section of the page. • The class attribute provides a way of classifying similar elements. This can be used for semantic or presentation purposes. For example, an HTML document might semantically use the designation class="notation" to indicate that all elements with this class value are subordinate to the main text of the document. In presentation, such elements might be gathered together and presented as footnotes on a page instead of appearing in the place where they occur in the HTML source. Class attributes are used semantically in micro formats. Multiple class values may be specified; for example class="notation important" puts the element into both the 'notation' and the 'important' classes. • An author may use the style attribute to assign presentational properties to a particular element. It is considered better practice to use an element's id or class attributes to select the element from within a style sheet, though sometimes this can be too cumbersome for a simple, specific, or ad hoc styling. • The title attribute is used to attach sub textual explanation to an element. In most browsers this attribute is displayed as a tooltip. • The lang attribute identifies the natural language of the element's contents, which may be different from that of the rest of the document.HTML Application An HTML Application (HTA; file extension ".hta") is a Microsoft Windows application that uses HTML and Dynamic HTML in a browser to provide the application's graphical interface. A regular HTML file is confined to the security model of the web browser, communicating only to web servers and manipulating only webpage objects and site cookies. An HTA runs as a fully trusted application and therefore has more privileges, like creation/editing/removal of files and Windows Registry entries. Because they operate outside the browser's security model, HTAs cannot be executed via HTTP, but must be downloaded (just like an EXE file) and executed from local file system. 2.2.2 HTML Tags Used: Tag What it is When to use it <a> Anchor (most commonly a link) Vital. Use to create links in content. Use the title attribute whenever the contents of the <a>…</a> pair do not accurately describe what you’ll get from selecting the link. Title attribute often displays as a tooltip in visual browsers, which may be a helpful usability aid. <abbr> Defines an abbreviation Works in a similar way to <dfn> and <acronym>, using a title attribute (displays a tooltip in standard visual browsers). e.g. <abbr title=”Hypertext markup language”>HTML</abbr> <ACRONYM> Defines an acronym Works in a similar way to <abbr> and <dfn>, using a title attribute (displays a tooltip in standard visual browsers). <ADDRESS> Used for marking up a physical (e.g. mailing) address Not commonly used. Recommend looking into microformats, which allow for more detail and interoperability. <APPLET> Inserts a Java applet The old way to insert a Java app. Use <object> instead today. <AREA> Hotspot in image map Avoid image maps where possible. Occasionally necessary. <BASE> Specifies the base location of the document. Use only when necessary. Adjusts any relative links and paths within the document. <BASEFONT> Sets default font size Display info – never use it <BIG> Larger text Display info – never use it <BLINK> Makes text blink You go to hell if you use this <BLOCKQUOTE> Large quoted block of text Use for any quoted text that constitutes one or more paragraphs (note: should contain <p> tags as well). Use <q> for quotations within a paragraph. Often used in conjunction with <cite> to cite the quotation’s source. <BODY> Document body Essential (unless you’re using frames) <BR> Line break This is arguably display information. Still in common use, but use with restraint. <B> Bold text Display info – never use it <BUTTON> Used for a standard clickable button within a form Often better than <input type=”button” /> or <input type=”submit” />, as it allows you to assign different styles based on the HTML element alone, whereas differentiating style based on the type of input is less well supported. <CAPTION> Caption for a table: describes the table’s contents The correct way to assign a title to a table <CENTER> Centred block Display info – never use it. Use <div> or some other block-level tag with the style text-align:center instead <CITE> Defines a citation Defines the source of a quotation (in conjunction with content in <q> or <blockquote> pairs). <CODE> Defines an extract of code Not commonly used. Similar to <pre> tag, but collapses consecutive white spaces and line breaks in the source. <COL> Identifies a particular column in a table Can be very useful. e.g. <col class=”namecol”> can be applied to each first column in a series of tables, then the width of each column may be set to be equal in the stylesheet, overriding the table’s natural tendency to adjust its own column widths to fit its contents. <DFN> Definition of a term Works in a similar way to <abbr> and <acronym>, using a title attribute (displays a tooltip in standard visual browsers). <DIR> Directory list Now deprecated. Use a standard <ul> or other list instead. <DIV> Division Specifies a logical division within a document. Use it to separate or identify chunks of content that are not otherwise distinguished naturally using other tags. One of the most common HTML tags. <DL> Definition list Contains one or more definition-term / definition-description pairs. <DT> Definition term Used as part of a <dt></dt><dd></dd> pair within a definition list (<dl></dl>) <DD> Definition description <EM> Emphasis Commonly used in place of the old <i>(italics) tag to indicate emphasis (but less than <strong>) <FONT> Font settings Display info – never use it <FORM> Input form Essential for data input <H1> Level 1 header Aim to have one H1 on each page, containing a description of what the page is about. <H2> Level 2 header Defines a section of the page <H3> Level 3 header Defines a sub-section of the page (should always follow an H2 in the logical hierarchy) <H4> Level 4 header Etc. Less commonly used <H5> Level 5 header Less commonly used. Only complex academic documents will break down to this level of detail. <H6> Level 6 header Less commonly used <HEAD> Document head Essential. Contains information about a page that does not constitute content to be communicated as part of the page. <HR> Horizontal rule Display info with no semantic value – never use it. “Horizontal”, by definition, is a visual attribute. <HTML> Core element of every web page. <IMG > Show an image Vital. Always use the alt or longdesc attributes when the image has content value <INPUT> Input fields within forms Vital. (I prefer to use <button> for buttons and submit buttons though) <ISINDEX> Old type of search input Not really used any more. Use <form> instead. <I> Italicised text Display info – never use it <KBD> Keyboard input Display info – never use it <LINK> Defines a relationship to another document Commonly used to reference external stylesheets, but has other minor uses <LI> List item Specifies an item in an unordered or ordered list (<ul> or <ol>) <MAP> Client-side imagemap May have occasional value, but only use when absolutely necessary <MARQUEE> Makes text scroll across the screen See <blink> <MENU> Menu item list Deprecated. Do not use. Use other standard list types instead. <META> Meta-information Useful way to insert relevant information into the <head> section of the page that does not need to be displayed. <OL> Ordered list Type of list where the order of elements has some meaning. Generally rendered with item numbers (best managed with CSS). <OPTION> Selection list option Vital for options within a drop-down control. <PARAM> Parameter for Java applet Used in conjunction with an <object> or <applet> tag to pass additional setting information at runtime. <PRE> Preformatted text Renders text in a pre-formatted style, preserving line breaks and all spaces present in the source. May be useful. (This one’s a paradox, as it is strictly display info that applies only to visual browsing, but it’s still so commonly used and useful that I’m hesitant to advise against using it.) <P> Paragraph Only use to denote a paragraph of text. Never use for spacing alone. <Q> Short quotation Use for inline quotations (whereas <blockquote> should be used for quotations of a paragraph or more). Often used in conjunction with <cite> to cite the quotation’s source. <SAMP> Denotes sample output text Similar to the <code> tag. Rarely used. Avoid. <SCRIPT> Inline script (e.g. JavaScript) It’s better to have all scripts as separate files than to write inline or in the <head>section, however still has its uses. <SELECT> Selection list A drop-down selector for a form. <SMALL> Smaller text Display info – never use it <SPAN> An inline span within text Use to apply meaning (and style) to a span of text that goes with the flow of content (whereas a <div> tag is block-level and breaks the flow) <Strikeout> Display info – never use it <STRONG> Strong emphasis Use this instead of the old <b> tag. <STYLE> CSS style settings Normally used in <head> section of a page. Try to use external stylesheets, to enable you to apply different styles for different output media. <SUB> Subscript text Arguably display info – recommend using alternative tags (e.g. <cite>). May be required in some academic uses, e.g. Chemical formulas. <SUP> Superscript text <TABLE> Table Use for repeated data that has a naturally tabular form. Never use for layout purposes. <TD> Table data cell A cell containing actual data. If a cell actually contains a descriptor or identifier for a row or column, use a <th> (table header) tag, not a <td>. This usually applies to column headers (within a <thead>), column footers (within a <tfoot>), as well as row headers (usually the first cell in a row in the <tbody>). <TEXTAREA> Multi-line text input area in a form Essential <TH> Table column or row header cell May appear in a <thead> (to denote a column header cell), <tbody> (to denote a row header), and in <tfoot> (to denote a column foot cell, e.g. a total) <TBODY> Indicates the main body of a data table It is always worth using this tag, as well as using <thead> and <tfoot> where appropriate. Note that it is permissible to have more than one <tbody>, <thead>, and <tfoot> in the same table. <THEAD> The head section of a table The place to put column header cells (<th>) <TFOOT> The foot section of a table Good place to put e.g. summary data, such as totals. Note that it goes before the <tbody> tag! <TITLE> Document title Essential <TR> Table row Essential with tables <TT> “Teletype” - simulates typewriter output Similar to <pre>, except that it collapses white space like normal HTML (whereas <pre> leaves all consecutive white space intact). Avoid if possible <UL> Unordered list Essential. Use for lists where the order or items has no particular importance. <U> Underline text Display info – never use it 1.4 Cascading Style Sheets (CSS) Cascading Style Sheets (CSS) was introduced with HTML 4, to provide a common way to style HTML elements. There are three ways of inserting a style that are: • External Style Sheets • Internal Style Sheets • Inline Styles 1.4 .1 External Style Sheets: External Style Sheet is ideal when the style is applied to many pages. With an external style sheet, you can change the look of an entire website by changing one file. Each page must link to the style sheet using <link> tag. The <link> tag goes inside the <head> section. <html> <head> <link rel=”stylesheet” type=”text/css” href=”styles-css”/> </head> <body> <p>Hello! </p> </body> </html> 1.4 .2 Internal Style Sheets: Internal Style Sheets can be used if one single document has a unique style. Internal Style Sheets are defined in the <head> section of an HTML page, by using <style> tag, like this: <head> <styletype=”text/css”> body {background-color: yellow} p {color: blue} </style> </head> 1.4 .3 Inline Styles: Inline Styles can be used if a unique style is to be applied to one single occurrence of an element. Touse inline styles, use the style attribute in relevant way. The style attribute can contain any CSS property. The example shows how to change the text color and the left margin of paragraph. <p style=”color: blue; margin-left: dopx”> This is a paragraph. </p> 1.5 Database Management System (DBMS) An organised collection of related information is known as database. A database management system is the software system that allows users to define, create and maintain a database and provides controlled access to the data. A Database Management System is basically a collection of programs that enables users to store, modify, and extract information from a database as per the requirements. The database used in this project is MYSQL. 1.5.1 What is MySQL? MySQL is the most popular open-source database system. The data in MySQL is stored in database objects called tables. A table is a collection of related data entries and it consists of columns and rows. Databases are useful when storing information categorically. 1.5.2 SQL Server: • SQL Server is a data engine introduced by Microsoft. • Provides an environment used to create databases. • Allows secure and efficient storage and management of data.Provides other components and services that support the business intelligence platform to generate reports and help in data analysis. 1.5.2 Features of SQL Server: Built in support for XML: It allows you to store and manage XML data in variables and columns of XML datatype.XML data is stored in a structured format that can be used across different platform. Scalability: It allows partitioning of database tables to help in parallel processing of queries which help in improving performance. Support for Web Services: It allows you to data access from web service with HTTP endpoints. High Level of Security: It provides high security by enforcing policies for logon, password, and permission. High Availability: Available to all time with the help of database mirroring, failover clustering and database snapshots. Support for migration data and analysis: Provide support to migrate data from disparate data source to a common database. In addition it helps in building data warehouse. 1.5.3 Commands Used in MYSQL: 1. CREATE TABLE: The CREATE TABLE statement is used to create a table in MySQL. Syntax: CREATE TABLE table_name ( column_name1 data_type, column_name2 data_type, column_name3 data_type, .. ) 2. INSERT Command: The INSERT INTO statement is used to add new records to a database table. Syntax: It is possible to write the INSERT INTO statement in two forms. The first form doesn't specify the column names where the data will be inserted, only their values: INSERT INTOtable_name VALUES (value1, value2, value3...) The second form specifies both the column names and the values to be inserted: INSERT INTOtable_name (column1, column2, column3...) VALUES (value1, value2, value3,...) 3. DELETE Command: The DELETE statement is used to delete records in a table. The DELETE FROM statement is used to delete records from a database table. Syntax: DELETE FROMtable_name WHERE some_column = some_value 4. SELECT Command: The SELECT statement is used to select data from a database. Syntax: SELECT column_name(s) FROM table_name 5. UPDATE Command The UPDATE statement is used to update existing records in a table. Syntax UPDATE table_name SET column1=value, column2=value2,... WHERE some_column=some_value 1.6 INTRODUCTION OF WAMPSERVER WAMP is a form of mini-server that can run on almost any Windows Operating System. WAMP includes Apache 2, PHP 5 (SMTP ports are disabled), and MySQL (phpMyAdmin and SQLitemanager are installed to manage your databases) preinstalled. The acronym WAMP refers to a set of free (open source) applications, combined with Microsoft Windows, which are commonly used in Web server environments. The WAMP stack provides developers with the four key elements of a Web server: an operating system, database, Web server and Web scripting software. The combined usage of these programs is called a server stack. In this stack, Microsoft Windows is the operating system (OS), Apache is the Web server, MySQL handles the database components, while PHP, Python, or PERL represents the dynamic scripting languages.An icon on the taskbar tray displays the status of WAMP, letting you know if; a) WAMP is running but no services are opened (the icon will appear red), b) WAMP is running and one service is opened (the icon will appear yellow) or c) WAMP is running with all services opened (the icon will appear white). Apache and MySQL are considered to be services (they can be disabled by left-clicking on the taskbar icon, guiding your cursor over the service you wish to disable and selecting "Stop Service"). WAMPs are packages of independently-created programs installed on computers that use a Microsoft Windows operating system. WAMP is an acronym formed from the initials of the operating system Microsoft Windows and the principal components of the package: Apache, MySQL and one of PHP, Perl or Python. Apache is a web server. MySQL is an open-source database. PHP is a scripting language that can manipulate information held in a database and generate web pages dynamically each time content is requested by a browser. Other programs may also be included in a package, such as phpMyAdmin which provides a graphical user interface for the MySQL database manager, or the alternative scripting languages Python or Perl. CHAPTER-2 OBJECTIVES There are various perspectives why which we can create and manage web pages. One of the reasons is to simplify the difficult works. Other reasons are given below: • To provide registration for students done by themselves. • To show timer when the student starts the exam the timer start automatically and it provide information about how much time is left. • The question will be display randomly from question bank. • Specify a privilege for each person to allow each person use this system to create his own exam. And have a complete control on his exam. • The authority to modify the criteria is provided to the administrator. • Online crime report system is to registers the complaints from people through online and it will also helpful to police department in catching criminals. • They can submit or register their complaint online .one of the main advantage of this project is that peoples getting hesitate to go to police station. so this project help those people to submit or register their complaint or fir. • This system is time efficient and help people to register their complaint easily whereas it will be useful for police departments to catch the criminals . CHAPTER-3 SCOPE • Online exam system is designed for educational institutes (like schools, universities, training centers). • The system handles all the operations and generates reports as soon as the test is finish, that includes name, mark, time spent to solve the exam. • Verify a security, authority and safety. • It can be used anywhere anytime as it is a web based application. • It might not be difficult, but it is still time-consuming. • The PHP is stronger is the Effective Security it provides. Most of the programmers are conscious of what is in the open source furthermore therefore it is usual that a PHP developer will make all efforts probable to make sure that the application is protected. • You are easily able to code in the Easy Way. Frameworks as well as a variety of additional tools associated to PHP make coding actually painless. If in case you are stuck anywhere you are able to refer to code libraries to find reply to most of your queries. • It is very simple to learn, php syntax are very practicable to study. my scope of view, php is overtaking java. For my career php is very helpful. In addition to this, PHP is a renowned server side scripting language not many have been able to make use of the PHP development in India platform to the fullest. If you pursue harder subsequently there are all probability of you ruling the niche as a PHP developer in India. • One more advantage of PHP is the less expensive feature. Contrasting to other software development platforms PHP is open source as well as occupies no charge to the PHP developer. They merely have to download PHP frameworks as well as tools online and can start working on projects for PHP.