Web Design and Development

Slides:



Advertisements
Similar presentations
JQuery MessageBoard. Lets use jQuery and AJAX in combination with a database to update and retrieve information without refreshing the page. Here we will.
Advertisements

PHP SQL. Connection code:- mysql_connect("server", "username", "password"); Connect to the Database Server with the authorised user and password. Eg $connect.
Lecture 6/2/12. Forms and PHP The PHP $_GET and $_POST variables are used to retrieve information from forms, like user input When dealing with HTML forms.
Lecture 3 – Data Storage with XML+AJAX and MySQL+socket.io
Deleting and Updating Records in MySQL using PHP Basharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan. 1.
© Yanbu University College YANBU UNIVERSITY COLLEGE Management Science Department © Yanbu University College Module 6:WEB SERVER AND SERVER SIDE SCRPTING,
1Computer Sciences Department Princess Nourah bint Abdulrahman University.
Session 5: Working with MySQL iNET Academy Open Source Web Development.
Create an online booking system (login/registration)
Lecture 7 Interaction. Topics Implementing data flows An internet solution Transactions in MySQL 4-tier systems – business rule/presentation separation.
PHP and MySQL for Client-Server Database Interaction Chapter 10.
© 2003 By Default! A Free sample background from Slide 1 Week 2  Free PHP Hosting Setup  PHP Backend  Backend Security 
SHOPPING CARTS CHAPTER 19. E-COMMERCE Typically, an e-commerce site will have public pages and admin pages.
Installing and Using MySQL and phpMyAdmin. Last Time... Installing Apache server Installing PHP Running basic PHP scripts on the server Not necessary.
MySQL Databases & PHP Integration Using PHP to write data to, and retrieve data from, a MySQL database.
SYST Web Technologies SYST Web Technologies Databases & MySQL.
Week 7. Lecture 2 Functions, Arrays, PHP&MySQL. Function with More than one argument and a return statement For a function to return a value, the return.
Nic Shulver, Introduction to Sessions in PHP Sessions What is a session? Example Software Software Organisation The login HTML.
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
Retrieving data from MySQL using PHP Basharat Mahmood, Department of Computer Science,CIIT,Islamabad, Pakistan. 1.
Case Study Dynamic Website - Three Tier Architecture
Web Database Programming Week 7 Session Management & Authentication.
Creating a simple database This shows you how to set up a database using PHPMyAdmin (installed with WAMP)
MySQL Importing and creating a database. CSV (Comma Separated Values) file CSV = Comma Separated Values – they are simple text files containing data which.
Setting up Dreamweaver to use your local WAMP testing Server
IS2803 Developing Multimedia Applications for Business (Part 2) Lecture 1: Introduction to IS2803 Rob Gleasure
Steps to Install VirtueMart 1. Setup Database 2. Download VirtueMart 3. Setup VirtueMart 4. Test installation Prerequisites: 1. XAMPP installation complete.
MySQL MySQL and PHP – interacting with a database.
1 PHP HTTP After this lecture, you should be able to know: How to create and process web forms with HTML and PHP. How to create and process web forms with.
Wordpress. What is Wordpress? Wordpress is a content management system. It is free and easy to use. It allows you to build dynamic websites It is built.
MySQL and PHPMyAdmin 1. Make sure your MySQL service is running. If using XAMPP, open the control panel. If the button for MySQL says Start, click it.
COM621: Advanced Interactive Web Development Lecture 10 PHP and MySQL.
PHP – Hypertext Preprocessor.
© Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● / www,histpk.org Hidaya Institute of Science & Technology
2nd year Computer Science & Engineer
Intro to WordPress (Using XAMPP)
Tonga Institute of Higher Education IT 141: Information Systems
CHAPTER 5 SERVER SIDE SCRIPTING
Selenium HP Web Test Tool Training
Introduction to Dynamic Web Programming
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
Selenium HP Web Test Tool Training
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
19.10 Using Cookies A cookie is a piece of information that’s stored by a server in a text file on a client’s computer to maintain information about.
Introduction to Web programming
Web Design and Development
Chapter 19 PHP Part III Credits: Parts of the slides are based on slides created by textbook authors, P.J. Deitel and H. M. Deitel by Prentice Hall ©
Web Design and Development
Web Design and Development
* Lecture # 7 Instructor: Rida Noor Department of Computer Science
Web Programming Language
Software Quality Assurance
Passing variables between pages
BASIC PHP and MYSQL Edward S. Flores.
Open Source Programming
MySQL and PHPMyAdmin.
Easy Way to Reset WordPress Admin Password on Localhost? Guided By: WPGLOBALSUPPORTWPGLOBALSUPPORT.
Password Reset Instructions
ISC440: Web Programming 2 Server-side Scripting PHP 3
Selenium HP Web Test Tool Training
Tonga Institute of Higher Education IT 141: Information Systems
Web Systems Development (CSC-215)
Title: Tech Training Certificate: Ace of Initiative Program
MySQL and PHPMyAdmin 1.
Building Web Applications
Tonga Institute of Higher Education IT 141: Information Systems
Web Programming Language
MySQL Web Application Connecting to a MySQL database
Web Programming Language
PHP-II.
Presentation transcript:

Web Design and Development Lecture # 11 Session And Login Instructor: Rida Noor Department of Computer Science

* 07/16/96 PHP Session (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

What is a PHP Session? * 07/16/96 A normal HTML website will not pass data from one page to another. In other words, all information is forgotten when a new page is loaded. This makes it quite a problem for tasks like a shopping cart, which requires data(the user's selected product) to be remembered from one page to the next. Session variables solve this problem by storing user information to be used across multiple pages (e.g. username, favorite color, etc). By default, session variables last until the user closes the browser. (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

* 07/16/96 Session Session variables hold information about one single user, and are available to all pages in one application. (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Start a PHP Session * 07/16/96 A session is started with the session_start() function. Session variables are set with the PHP global variable: $_SESSION. Now, let's create a new page called “startSession.php". In this page, we will start a new PHP session and set some session variables: (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Start a PHP Session Browser Result: * 07/16/96 (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Get PHP Session Variable Values * 07/16/96 Browser Result: (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Get PHP Session Variable Values * 07/16/96 We created another page called “getSessionValues.php". From this page, we accessed the session information we set on the first page (" startSession.php"). Notice that session variables are not passed individually to each new page, instead they are retrieved from the session we open at the beginning of each page (session_start()). Also notice that all session variable values are stored in the global $_SESSION variable: (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Destroy a PHP Session * 07/16/96 To remove all global session variables and destroy the session, use session_unset() and session_destroy(): Browser Result: (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Create Database and Table in WAMP or XAMPP * 07/16/96 Create Database and Table in WAMP or XAMPP (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Create a Database Start Apache and MySQL services on XAMPP. * 07/16/96 Start Apache and MySQL services on XAMPP. Press Admin as pointed in image to go to phpMyAdmin. (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Create a Database * 07/16/96 (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Create a Database * 07/16/96 Enter Database name ‘testdb’ and press create button. (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Create a Table * 07/16/96 Enter table name ‘tbl_registration’ , number of fields ‘6’ and press GO button to create table . (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Create a Table * 07/16/96 Enter following fields and their types. Enter length of each field except for fld_date. Select CURRENT_TIMESTAMP value for fld_date in Default column. (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Create a Table * 07/16/96 Check the checkbox of A_I that is auto-increament for fld_reg_id press SAVE button. (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Create a Table Here you can see the table you have created. * 07/16/96 (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

PHP Connect to MySQL * 07/16/96 (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Why to establish a connection? * 07/16/96 Why to establish a connection? You should establish a connection to the MySQL database. This is an extremely important step because if your script cannot connect to its database, your queries to the database will fail. (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

How to establish a connection? * 07/16/96 Create a new php file in Dreamweaver and save it as “connection.php”. Add following code in connection.php file. (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Check Connection * 07/16/96 Execute connection.php page in browser and check if it displays success message or not. (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

* 07/16/96 PHP Login (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

HTML Login Form Create a new html page. Save it as login.html. * 07/16/96 Create a new html page. Save it as login.html. Create login form in login.html as follow. (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

HTML Login Form * 07/16/96 Open the code view of login form and change followings: Browser Results: (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

PHP Login And Session (Start Session) * 07/16/96 Create a new php page, save it as login.php , add following: (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Welcome Page (Get Session Values) * 07/16/96 Create a new php page and save it as welcome.php. Add following Code: (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

PHP Session Destroy * 07/16/96 Create a new php page and save it as logout.php. Add following Code: (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

PHP LOGIN * 07/16/96 MySQL records: Enter Email and Password and press SIGN IN Button. (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

If Login Is Successful If Login Is Not Successful Sign Out * 07/16/96 If Login Is Not Successful Sign Out Click on Sign Out link welcome page will be redirected to login form page. (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*