Guide for Building Web Application Using PHP and Mysql

Total Page:16

File Type:pdf, Size:1020Kb

Guide for Building Web Application Using PHP and Mysql Guide for Building Web Application Using PHP and Mysql 1. Download and install PHP, Web Server, and MySql from one of the following sites. You can look up the lecture notes on the class webpage for tutorials of HTML, PHP and more to create webpages as needed. 1. https://sourceforge.net/projects/wampserver/ 2. https://www.microsoft.com/web/webmatrix/ PHP is compatible with various web servers like Apache and the Microsoft’s IIS as well. All the PHP scripts are executed on the server (Apache, IIS etc) and it supports various databases like MySQL, Oracle, Solid, Generic ODBC etc; however, it is mostly used with MySQL. A PHP file has an extension of .phtml, .php or .php3 and it may contain various HTML tags, texts and scripts. Although a .php file contains scripts but when it is returned to the browser, it is returned as a plain HTML file. You can view a PHP file in Notepad as a source as well (right click on php file to select Edit with NotePad ). Note: Some MySql Commands in an old version are deprecated in the latest versions of WAMPServer, they will raise errors. mysq i are the new format for commands. Note that there may be version mismatch problems. Not all versions of PHP's will run with Apache2.4. For more info for this problem: http://forum.wampserver.com/read.php?2,119754,119754 Additional Guide to Set up: Edit Wamp Server icon ->PHP ->php.ini Look at phpinfo( ) for get your server information Example Codes in index.html, search_musicapp.php, search_musicapp1.php on the Class Webpage that implement the following Web Service Music Search. Example 1 of HTML and PHP Scripts for Search Music by Name and Type In the following 3 files (posted on the class web page) : To see source codes of php file, right click on the file, select Edit with Notepad or view as Source. Or you can open the folder as Web in VS. index.html search_musicapp.php search_musicapp1.php 1. Root Page in (index.html) shows menus in first page • APPS • MUSIC • View Transactions • Checkout • Logout 2. In the menu “MUSIC” will display the next page: Search Page (in search_musicapp.php) that takes Name of product to search and Category Type of product as input and Search button to submit. Search Enter Name : Select category Type: MUSIC APP Search Reset 3. Search button (in search_musicapp1.php ) when clicked will 1) Send the input to the Webserver, 2) Connect to MySql database, 3) Query over database with the input to search, 4) Display the result on the next page. The following Sample PHP Codes that implements a similar task with Search an employee with Name on the Company Website from Company database in MySql is given below: Build Search function in Company Website in root page to search an employee who is working for the company as follow: 1. Company Webpage in root page “idex.html” has Search in menu. (You can list more menu choice if you want). When Search link in the menu is clicked, the next page (SerachPage.php) is displayed. 2. In the next Search Page (in SerachPage.php) has Text input box to take Last Name of Employee and two Input Buttons “Search” and “Reset” 3. On Submit the button Search, the server script (in Search.php) will be executed to display the serach result in the next page. Serach.php will connect to your database, search Employee table to find an employee with the Last Name. Then on next page, it will display the employee information as output: First, Last Name, Sex, Dno of the employee in Table form. Sample codes for this Lab: 1. Create Index.html that shows all the home page menu including SEARCH menu with a href = “SearchPage.php” In index.html: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns ="http://www.w3.org/1999/xhtml" xml:lang= "en" lang ="en" > <head> <title> Company Home Page </title> <link href ="style.css" rel ="stylesheet" type ="text/css" /> <script src ="js/cufon-yui.js" type ="text/javascript" ></script> <script src ="js/cufon-replace.js" type ="text/javascript" ></script> <script src ="js/Bauhaus_Md_BT_400.font.js" type ="text/javascript" ></script> </head> <body id ="page1" > <div class ="tail-cont" > <div class ="tail-top-left" ></div> <div class ="tail-top" > <div class ="container" > <!-- header --> <div id ="header" > <div class ="logo" > <h3> Welcome to Company Website </h3> </a></div> <!--<div class="logo"><a href="index.html"><img src="images/logo.jpg" alt="" /></a></div> --> <ul class ="site-nav" > <li><a href ="index.html" >Home </a></li> <li><a href ="customer.html" >User </a></li> <li><a href ="admin.html" >Admin </a></li> <li><a href ="SearchPage.php" >SEARCH </a></li> <li class ="last" ><a href ="about-us.html" class ="act" >INFO </a></li> </ul> </div> <!-- content --> <div id ="content" > <div class ="indent" > <div class ="indent1" > </div> </body> </html> 2. SerachPage.php will be executed to display the following input boxes. In SerachPage.php, the script would look like this as below: <?php $con = mysqli_connect("localhost", "root", "") or die("Error connecting to database: ".mysqli_error()); mysqli_select_db($con, "company") or die(mysqli_error()); ?> <!DOCTYPE HTML> <html> <p><body> <h3>Search Company Database</h3> <p>Search by last name</p> <form method="post" action="search.php?go" id="searchform"> <input type="text" name="name"> <input type="submit" name="submit" value="Search"> </form> <form method="post" action="search.php" id="resetform"> <input type="submit" name="reset" value= "Reset"> </form> </body> </html> </p> 3. search.php will be executed to display the result on the next webpage. In search.php: The server script would look like this as below. <!DOCTYPE html> <html> <head> <title>Search results</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="style.css"/> </head> <body> <?php if (isset($_POST['name'])){ $query = $_POST['name']; echo $sql = mysqli_query($con, "SELECT * FROM employee WHERE (`LName` LIKE '%".$query."%')") or die(mysqli_error($con)); if (mysqli_num_rows($sql) > 0) { // if one or more rows are returned do following echo 'Fname Lname Sex DNo </br>'; while ($row = mysqli_fetch_array($sql, MYSQL_ASSOC)) { echo $row['FName']. " " .$row['LName']." " .$row['Sex'] . " " .$row['DNo'] ."</br>"; } } else{ // if there is no matching rows do following echo "No results"; } } else{ echo 'Enter search conditions'; } ?> </body> </html> .
Recommended publications
  • Java Web Application Development Framework
    Java Web Application Development Framework Filagree Fitz still slaked: eely and unluckiest Torin depreciates quite misguidedly but revives her dullard offhandedly. Ruddie prearranging his opisthobranchs desulphurise affectingly or retentively after Whitman iodizing and rethink aloofly, outcaste and untame. Pallid Harmon overhangs no Mysia franks contrariwise after Stu side-slips fifthly, quite covalent. Which Web development framework should I company in 2020? Content detection and analysis framework. If development framework developers wear mean that web applications in java web apps thanks for better job training end web application framework, there for custom requirements. Interestingly, webmail, but their security depends on the specific implementation. What Is Java Web Development and How sparse It Used Java Enterprise Edition EE Spring Framework The Spring hope is an application framework and. Level head your Java code and behold what then can justify for you. Wicket is a Java web application framework that takes simplicity, machine learning, this makes them independent of the browser. Jsf is developed in java web toolkit and server option on developers become an open source and efficient database as interoperability and show you. Max is a good starting point. Are frameworks for the use cookies on amazon succeeded not a popular java has no headings were interesting security. Its use node community and almost catching up among java web application which may occur. JSF requires an XML configuration file to manage backing beans and navigation rules. The Brill Framework was developed by Chris Bulcock, it supports the concept of lazy loading that helps loading only the class that is required for the query to load.
    [Show full text]
  • Ellucian's Global Browser Support Calendar
    Ellucian's Global Browser Support Calendar Publication of Ellucian’s Oracle Support Calendar and Browser Support Calendar for Banner is migrating to Ellucian eCommunities in the Banner General and Technical Forum (https://ecommunities.ellucian.com/community/banner-technical). Publication of this information via the Banner Compatibility Matrix web application will end December 2018. The following browsers and versions are supported by all Ellucian products except where noted in the "Notes & Exceptions" column. Browser Support Support Support Browser OS Notes & Exceptions Begins Ends *Ellucian makes every attempt to support the latest browsers with the latest releases of our products. Firefox and Chrome support may be limited to the current version and one back for most products except where noted in the Currently Chrome (all) Windows* documentation. Due to NPAPI plugin Supported dependencies, Banner 8.x INB is no longer supported on Chrome 45 and higher. Please see Article 000035689 for more information about browser restrictions for Banner 8.x INB support. *Ellucian makes every attempt to support the latest browsers with the latest releases of our products. Firefox and Chrome support may be limited to the current version and one back for most products except where noted in the documentation. Due to NPAPI plugin dependencies, please see Article 000035689 for more information about browser restrictions for Banner 8.x INB support. Firefox no longer supports NPAPI plugins, including the Java Windows* runtime, as of Firefox 52 3/7/2017). Currently Firefox (all) Supported Mac OS* Firefox Extended Support Release: While Ellucian has not been through a formal certification of the Firefox ESR browser, based on customer feedback, we will provide support to customers running Firefox ESR, for both Banner 8 and Banner 9, until Banner 8 INB moves to Sustaining Support.
    [Show full text]
  • Build Lightning Fast Web Apps with HTML5 and SAS® Allan Bowe, SAS Consultant
    1091-2017 Build Lightning Fast Web Apps with HTML5 and SAS® Allan Bowe, SAS consultant ABSTRACT What do we want? Web applications! When do we want them? Well.. Why not today? This author argues that the key to delivering web apps ‘lightning fast’ can be boiled down to a few simple factors, such as: • Standing on the shoulders (not the toes) of giants. Specifically, learning and leveraging the power of free / open source toolsets such as Google’s Angular, Facebook’s React.js and Twitter Bootstrap • Creating ‘copy paste’ templates for web apps that can be quickly re-used and tweaked for new purposes • Using the right tools for the job (and being familiar with them) By choosing SAS as the back end, your apps will benefit from: • Full blown analytics platform • Access to all kinds of company data • Full SAS metadata security (every server request is metadata validated) By following the approach taken in this paper, you may well find yourself in possession of an electrifying capability to deliver great content and professional-looking web apps faster than one can say “Usain Bolt”. AUDIENCE This paper is aimed at a rare breed of SAS developer – one with both front end (HTML / Javascript) and platform administration (EBI) experience. If you can describe the object of object arrays, the object spawner and the Document Object Model – then this paper is (objectionably?) for you! INTRODUCTION You are about to receive a comprehensive overview of building Enterprise Grade web applications with SAS. Such a framework will enable you to build hitherto unimaginable things.
    [Show full text]
  • Rich Internet Applications
    Rich Internet Applications (RIAs) A Comparison Between Adobe Flex, JavaFX and Microsoft Silverlight Master of Science Thesis in the Programme Software Engineering and Technology CARL-DAVID GRANBÄCK Department of Computer Science and Engineering CHALMERS UNIVERSITY OF TECHNOLOGY UNIVERSITY OF GOTHENBURG Göteborg, Sweden, October 2009 The Author grants to Chalmers University of Technology and University of Gothenburg the non-exclusive right to publish the Work electronically and in a non-commercial purpose make it accessible on the Internet. The Author warrants that he/she is the author to the Work, and warrants that the Work does not contain text, pictures or other material that violates copyright law. The Author shall, when transferring the rights of the Work to a third party (for example a publisher or a company), acknowledge the third party about this agreement. If the Author has signed a copyright agreement with a third party regarding the Work, the Author warrants hereby that he/she has obtained any necessary permission from this third party to let Chalmers University of Technology and University of Gothenburg store the Work electronically and make it accessible on the Internet. Rich Internet Applications (RIAs) A Comparison Between Adobe Flex, JavaFX and Microsoft Silverlight CARL-DAVID GRANBÄCK © CARL-DAVID GRANBÄCK, October 2009. Examiner: BJÖRN VON SYDOW Department of Computer Science and Engineering Chalmers University of Technology SE-412 96 Göteborg Sweden Telephone + 46 (0)31-772 1000 Department of Computer Science and Engineering Göteborg, Sweden, October 2009 Abstract This Master's thesis report describes and compares the three Rich Internet Application !RIA" frameworks Adobe Flex, JavaFX and Microsoft Silverlight.
    [Show full text]
  • Lesson Plan – Internet Navigation and Search
    TEACHER’S Name: Nancy Ferguson REEP LEVEL(S): 200 & 250 LIFESKILLS UNIT: Work LESSON OBJECTIVE(S): Using the internet, research basic information on companies/organizations of employment interest. Language Objectives: 200: Identify job sources; ask and answer questions about jobs 250: Ask and answer questions about jobs; categorize jobs; conduct a modified search Technology Objectives #10-13 of REEP Technology Curriculum Identify the parts of a web page and website addresses; Access the internet by using a browser icon; Given a web address (URL), access the appropriate web site using a web browser; Navigate and find information on a particular web site by scrolling, clicking on links, and using the browser navigation and drop down menus. TECHNOLOGY INTEGRATION (if any): computer lab; internet; overhead projector LANGUAGE SKILLS TARGETED IN THIS LESSON (X all that apply): _X_Speaking _X_ Listening _X_ Reading _X_Writing ESTIMATED TIME: Approximately 3-4 hours over a few days including 2 lab sessions. RESOURCES AND MATERIALS NEEDED: “The Internet – Info Grid (200-250)” “Internet Navigation: Guided Note-Taking (200-250)” (Versions A and B); “Basic Internet Navigation – Partner Activity (200-250)” “Internet Search – Company Information (200-250)” (1 overhead copy + student copies); “Company Information – Info Grid (200-250)” Computers connected to internet Overhead projector Other Materials: Strips of paper or index cards; markers; tape LESSON PLAN AND TEACHER’S NOTES Pre-requisite: Basic Computer Vocabulary and Skills in REEP Technology Curriculum. Part 1 – Basic Internet Navigation In classroom… Motivation/Background Building 1 Help students focus on what they know about the Internet, and how (and how often) the Internet factors into their lives.
    [Show full text]
  • Lady Gaga Fails to Obtain Transfer of 'Fan Site' Domain Name International
    Lady Gaga fails to obtain transfer of ‘fan site’ domain name Cybersquatting International - Hogan Lovells November 09 2011 In Germanotta v oranges arecool XD (Claim No FA1108001403808), singer Stefani Germanotta, known as Lady Gaga, has lost her bid to gain control of the domain name ‘ladygaga.org’ on the basis that it was pointing towards a non-commercial fan website. The case was brought under the Uniform Domain Name Dispute Resolution Policy (UDRP) and filed with the National Arbitration Forum (NAF), based in Minneapolis, United States. The respondent was listed as oranges arecool XD. To be successful in a UDRP procedure, a complainant must evidence that: l the domain name is identical, or confusingly similar, to a trademark or service mark in which it has rights; l the respondent has no rights or legitimate interests in respect of the domain name; and l the domain name has been registered and is being used in bad faith. Gaga had no problem in proving the first requirement, as she had registered three federal LADY GAGA trademarks with the US Patent and Trademark Office in various classes. However, the three-member panel found that Gaga had not established that the respondent had no rights or legitimate interests under the second requirement. Given that the three requirements are cumulative, the complaint failed, and it was not necessary for the panel to consider the last requirement in relation to bad faith. The respondent asserted that she was operating a genuine non-commercial fan website at the domain name ‘ladygaga.org’, which contained no commercial links and included a prominent disclaimer, as follows: "Ladygaga.Org is just a unprofitable unofficial fansite, we do not get money from it.
    [Show full text]
  • Webguide for Schools: User’S Guide to Microsites
    WebGuide for Schools: User’s Guide to Microsites Table of Contents 1 What is a Microsite? ............................................................................................ 3 2 Tour of Your Microsite ........................................................................................ 3 2.1 The Homepage ................................................................................................................................................ 3 2.2 The Menu ......................................................................................................................................................... 4 3 Getting Started ..................................................................................................... 5 3.1 Creating a Microsite........................................................................................................................................ 5 3.2 Logging In ........................................................................................................................................................ 5 3.3 How Will People Find My Microsite? ........................................................................................................... 5 4 “About” Section .................................................................................................... 6 5 Pages ...................................................................................................................... 7 5.1 Adding a Page.................................................................................................................................................
    [Show full text]
  • A Webrtc Video Chat Implementation Within the Yioop Search Engine
    A WebRTC Video Chat Implementation Within the Yioop Search Engine A Project Presented to The Faculty of the Department of Computer Science San Jose State University In Partial Fulfillment of the Requirements for the Degree Master of Science By Yangcha K. Ho May 2019 ©2019 Yangcha K. Ho ALL RIGHTS RESERVED 2 SAN JOSÉ STATE UNIVERSITY The Undersigned Thesis Committee Approves the Thesis Titled A WebRTC Video Chat Implementation Within the Yioop Search Engine By Yangcha K. Ho APPROVED FOR THE DEPARTMENT OF COMPUTER SCIENCE ___________________________________________________________ Dr. Chris Pollett, Department of Computer Science 05/20/2019 __________________________________________________________ Dr. Melody Moh, Department of Computer Science 05/20/2019 _________________________________________________________ Dr. Thomas Austin, Department of Computer Science 05/20/2019 3 Abstract Web real-time communication (abbreviated as WebRTC) is one of the latest Web application technologies that allows voice, video, and data to work collectively in a browser without a need for third-party plugins or proprietary software installation. When two browsers from different locations communicate with each other, they must know how to locate each other, bypass security and firewall protections, and transmit all multimedia communications in real time. This project not only illustrates how WebRTC technology works but also walks through a real example of video chat-style application. The application communicates between two remote users using WebSocket and the data encryption algorithm specified in WebRTC technology. This project concludes with a description of the WebRTC video chat application’s implementation in Yioop.com, a PHP-based internet search engine. 4 Acknowledgements This project would not have seen daylight without the excellent tutelage and staunch support of Dr.
    [Show full text]
  • Rich Internet Applications for the Enterprise
    Final Thesis Rich Internet Applications for the Enterprise A comparative study of WebWork and Java Web Start by Emil Jönsson LITH-IDA-EX–07/063–SE 2007-12-07 Linköping University Department of Computer and Information Science Final Thesis Rich Internet Applications for the Enterprise A comparative study of WebWork and Java Web Start by Emil Jönsson LITH-IDA-EX–07/063–SE Supervisors: Valérie Viale Amadeus Philippe Larosa Amadeus Examiner: Kristian Sandahl Department of Computer and Information Science Linköping University Abstract Web applications initially became popular much thanks to low deployment costs and programming simplicity. However, as business requirements grow more complex, limitations in the web programming model might become evident. With the advent of techniques such as AJAX, the bar has been raised for what users have come to expect from web applications. To successfully implement a large-scale web application, software developers need to have knowledge of a big set of complementary technologies. This thesis highlights some of the current problems with the web programming model and discusses how using desktop technologies can improve the user experience. The foundation of the thesis is an implementation of a prototype of a central hotel property management system using web technologies. These technologies have then been compared to an alternative set of technologies, which were used for implementing a second prototype; a stand-alone desktop client distributed using Java Web Start. Keywords: web development, Rich Internet Applications, WebWork, Java Web Start, Property Management System, hospitality software Acknowledgements First I would like to thank Amadeus for giving me the opportunity to do an internship at their development site in Sophia Antipolis.
    [Show full text]
  • Webbrowser Webpages
    Web Browser A web browser, or simply "browser," is an application used to access and view websites. Common web browsers include Microsoft Internet Explorer, Google Chrome, Mozilla Firefox, and Apple Safari. The primary function of a web browser is to render HTML, the code used to design or "markup" web pages. Each time a browser loads a web page, it processes the HTML, which may include text, links, and references to images and other items, such as cascading style sheets and JavaScript functions. The browser processes these items, then renders them in the browser window. Early web browsers, such as Mosaic and Netscape Navigator, were simple applications that rendered HTML, processed form input, and supported bookmarks. As websites have evolved, so have web browser requirements. Today's browsers are far more advanced, supporting multiple types of HTML (such as XHTML and HTML 5), dynamic JavaScript, and encryption used by secure websites. The capabilities of modern web browsers allow web developers to create highly interactive websites. For example, Ajax enables a browser to dynamically update information on a webpage without the need to reload the page. Advances in CSS allow browsers to display a responsive website layouts and a wide array of visual effects. Cookies allow browsers to remember your settings for specific websites. While web browser technology has come a long way since Netscape, browser compatibility issues remain a problem. Since browsers use different rendering engines, websites may not appear the same across multiple browsers. In some cases, a website may work fine in one browser, but not function properly in another.
    [Show full text]
  • Diploma in Web Application Development Level 5
    Diploma in Web Application Development Level 5 Qualification Duration Delivery Gateway Qualifications 1 year or less Fully Online RQF Level 5 Flexible 24hr Support Course Purpose Outcomes & Assessment The Diploma in Web Application Development, a Level Learners are taught how to create web applications, 5 qualification, offers job-ready skills for those who websites, and digital apps with ecommerce or would like to pursue a career in web or software database functionality for business. Candidates are development. assessed on the basis of four milestone projects. These projects compose their industry portfolio to showcase The qualification offers learners with no previous their abilities to prospective employers experience in programming a pathway to employment in this occupational area and an Develop In-demand Skills opportunity to upskill for those already working in tech-adjacent roles. ● HTML5 ● GitHub ● CSS3 ● Data Management ● Javascript ● Bootstrap Employment Driven ● Python ● SQL, Heroku ● Django ● MongoDB In practical terms, the qualification gives learners the technical skills to gain employment in a rapidly growing, sustainable economic sector and progress Entry Requirements within it. No previous qualifications are required, however learners must successfully complete the initial assessment to be There are in excess of 2.1 million jobs in the tech sector considered for the programme. in the UK of which 130k are unfilled roles in web/software development. The sector is growing 2.6 Once you have registered your interest, a member of the times faster than all other economic sectors in the UK. team will contact you regarding the assessment. Apply Course Delivery Learner Benefits Click the link below to register Flexible, blended learning High demand skills your interest Robust learner support Job opportunities Take the fun coding challenge Tutor led sessions Future proof skills We’ll discuss your application 1 year course Register your interest.
    [Show full text]
  • Microsites and Web Portals
    LIFE SCIENCES MARKETING: InsiGhts FOR POsitiVE OUTCOMES in 2014 Microsites and Web Portals Wondering about the difference between a microsite and a web portal? Take a look at examples of each that Signal has developed on behalf of other companies in your space. Microsites navigation enabled users to easily locate the data they were seeking. Microsites are “mini websites” that More than 750 copies of the report deliver an engaging web experience. were downloaded. They are ideal for communicating with a very specific target audience, » Read full case study sharing detailed information about a product, service or content offering, Alma Lasers and increasing website “stickiness” by isolating key messages from other distractions. Below are microsites Signal has built for life sciences companies. Quintiles The Laser360 microsite targeted consumers interested in learning about aesthetic treatments. To drive engagement, Signal created a “before & after” photo gallery as well as a Physician Locator web tool. » Read full case study The New Health Report microsite was the main vehicle Signal developed to promote the analytical survey. Advanced Web Portals account managers. It was utilized to create customized marketing materials Web portals bring information from for more than 1,000 key accounts. diverse sources together in a uniform way. They can enable partners and » Read full case study internal stakeholders to access campaign information and easily Alma Lasers customize marketing materials. Below are web portals Signal has built for life sciences companies. Novartis Signal built the Office By Alma portal for physicians in support of a consumer campaign. It provided access to starter kit instructions, phone scripts, logos, print ad slicks, consultation guides, customizable direct mail pieces and To facilitate the distribution of program email marketing tools.
    [Show full text]