30
Create an online booking system (login/registration) HTML/PHP/SQL CREATING AN ONLINE (WEB BASED) LOGIN SYSTEM USERS CAN REGISTER THEIR DETAILS STORAGE IN A SQL DATABASE CODING IN PHP LOGIN USING THE SAME REGISTRATION DETAILS – DISPLAY WELCOME PAGE. Purchase the full package of GCSE/A Level resources at www.teachingcomputing.com

Create an online booking system (login/registration) HTML/PHP/SQL CREATING AN ONLINE (WEB BASED) LOGIN SYSTEM USERS CAN REGISTER THEIR DETAILS STORAGE

Embed Size (px)

Citation preview

Mastering Loops

Create an online booking system (login/registration)HTML/PHP/SQLCreating an online (web based) login systemUsers can register their detailsStorage in a SQL databaseCoding in PHPLogin using the same registration details display Welcome page.

Purchase the full package of GCSE/A Level resources at www.teachingcomputing.com*contributed by Joss Bleach1

Want to be the next Mark Zuckerberg?Well, you may want to start by learning HTML, JavaScript and most importantly PHP. (the TeachingComputing series has tutorials that teach you the fundametnals) and w3schools.com is also very useful)Watch the video on the right to see what you will be creating in this session: Exciting!

The first steps in creating a Facebook type app1. A user enters registration information such as Name, Last name and Password.

2. This information is stored in a database and retrieved when a user logs in.And thats what you are going to do. 1. Create a Registration Screen. 2. Store this data 3. Let users log in!Set UpPurchase free web space (www.000webhost.com).Create a MySQL Database, storing the users details.CodingCreate a registration form using PHP and HTML.Connect to the MySQL Database and manipulate it using PHPs MySQL commands.Create a log in form using PHP and HTML.Respond to the users inputs correctly, either displaying their subject choices or an incorrect log in page.Steps involved in creating this systemHTML 5 a Hyper Text Markup Language used for structuring and presenting content for the World Wide Web.

It uses markers such as , , and to display content.HTML 5

PHP is a server-side scripting language designed for web development.It is usually mixed with HTML using the PHP tags:PHP

*contributed by Joss Bleach6For this tutorial youll have to purchase free web space that supports PHP and MySQL use. We have used www.000webhost.com in this tutorial.

Visit the website and follow the steps to create a website.Once youve activated your account via email, you must click refresh status once logged in until the status changes from building to active.

Set up: Task 1If you havent registered a domain name, decide what you want to call your website and write it here.

Set up: Task 1This is what we are calling our site decide on something equally interesting or do it exactly as shown to be on the safe side!Once youve created your website and logged in on the www.000webhost.com website, locate the cPanel and from there MySQL (in the software/services box).Were going to create a database in here. Call your database subject, your MySQL username root and set your MySQL password to tutorial1.Once youre finished, click Create database. This will bring you to another page that will allow you to go back to the cPanel. Once there, locate phpMyAdmin (in the software/services box).

Set up: Task 2Once youve located phpMyAdmin and opened it, create a table called userdata with 8 fields.Copy the information below into your database. Once youve finished, click save.

phpMyAdmin is a GUI for MySQL, making it easier to create databases (MySQL is usually a command line interface).

Set up: Task 3Open up Dreamweaver and create a PHP file called index.php.Were going to begin our document by declaring the variables needed for database connection later.Copy in the code below:

This section of code simply houses variables assigned to the values needed for connection later on, just making code more maintainable.

Declaring variables assigned to the values of the host name, MySQL username, MySQL password and Database name. Your username prefix will be different, so replace a8794820 with your MySQL username/database name, found in MySQL on the cPanel.In php, variables are created by writing $, proceeded by the identifier and then the value its equal to. Variables must begin with a letter or an underscore, they cannot begin with a number.E.g. $myname = dave. Coding Task 1Next were going to create an html heading for our form.Copy in the code below:

Register | Subject Choices Register Below: Already have an account? Log in here.Text in between the h1 tags will be displayed as a large heading.Text in between the paragraph tags becomes a new paragraph. The browser adds space between each tag.The tag gives a hyperlink that will later be used to connect to the login page.Coding Task 2Next we will be creating the HTML form within our PHP document.Copy in the code below: