PHP Form Processing * referenced from

Slides:



Advertisements
Similar presentations
PHP I.
Advertisements

KompoZer. This is what KompoZer will look like with a blank document open. As you can see, there are a lot of icons for beginning users. But don't be.
Introduction to PHP MIS 3501, Fall 2014 Jeremy Shafer
Hypertext Markup Language. Platform: - Independent  This means it can be interpreted on any computer regardless of the hardware or operating system.
Building Web Pages With Microsoft Office. Introduction This tutorial is for the beginning web builder. It utilizes software that you already have, Microsoft.
Website Tutorial. Administration  Log on by clicking Login on the footer of almost any page  Your Username is.
JAVASCRIPT HOW TO PROGRAM -2 DR. JOHN P. ABRAHAM UTPA.
PHP Tutorials 02 Olarik Surinta Management Information System Faculty of Informatics.
Advance Database Management Systems Lab no. 5 PHP Web Pages.
PHP : Hypertext Preprocessor
Week 4  Using PHP with HTML forms  Form Validation  Create your own Contact form Please Visit:
Reading Data in Web Pages tMyn1 Reading Data in Web Pages A very common application of PHP is to have an HTML form gather information from a website's.
INTERNET APPLICATION DEVELOPMENT For More visit:
PhoneGap Development How to make an app using PhoneGap Build ? Presentation By MobilePundits.
Create an online booking system (login/registration)
PHP. Why should we learn web programming? No need write socket programming. - You can forget TCP/IP & OSI layers. - Web server handles socket tasks for.
XHTML Introductory1 Forms Chapter 7. XHTML Introductory2 Objectives In this chapter, you will: Study elements Learn about input fields Use the element.
Repository/Site Upload Instructions By Elizabeth Liang Duke University, May 2009 Alice Project under Prof. Susan Rodger.
IDK0040 Võrgurakendused I harjutus 06: PHP: Introduction Deniss Kumlander.
INTERNET APPLICATION DEVELOPMENT For More visit:
Advanced Web Design Scripting Tutorial Chapters. Scripting Intro The scripting part of the forthcoming Advanced Web Design textbook introduces you to.
Nael Alian Introduction to PHP
Week 9 PHP Cookies and Session Introduction to JavaScript.
IST 210: PHP BASICS IST 210: Organization of Data IST210 1.
Search on the internet the different ways for building a website, and choose which one bests suits you for what website you are doing.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
Lecture # 6 Forms, Widgets and Event Handling. Today Questions: From notes/reading/life? Share Personal Web Page (if not too personal) 1.Introduce: How.
 Research on the best software that suits your preference. I recommend Adobe Dreamweaver as that is what I’m using to create my website.
Go to your school’s web locker site school name.schoolweblockers.com) Your user name is the first letter of your first name, the first 4.
Downloading and Installing Autodesk Revit 2016
HOW TO UPLOAD A WEBSITE BY KATIE HARDAKER.  SEARCH THE INTERNET THE VARIETY OF OPTIONS AVAILABLE FOR CONSTRUCTING A WEBSITE AND CHOOSE THE APPROPRIATE.
CSC 2720 Building Web Applications Server-side Scripting with PHP.
HTML FORMS GET/POST METHODS. HTML FORMS HTML Forms HTML forms are used to pass data to a server. A form can contain input elements like text fields, checkboxes,
Creating a Web Site Using 000webhost.com The 000webhost.com Site You will be required to create an account in order to use their host computer 000webhost.com.
Intro to PHP IST2101. Review: HTML & Tags 2IST210.
Hello! This presentation is designed to be used with your students to help them join your class and create unique usernames and passwords.
Downloading and Installing Autodesk Inventor Professional 2015 This is a 4 step process 1.Register with the Autodesk Student Community 2.Downloading the.
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
CSE 154 LECTURE 5: INTRO TO PHP. URLs and web servers usually when you type a URL in your browser: your computer looks up the.
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
Creating a simple database This shows you how to set up a database using PHPMyAdmin (installed with WAMP)
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
CIS Intro to JAVA Lecture Notes Set July-05 GUI Programming –TextField Action Listeners, JEditorPane action listeners, HTML in a JEditorPane,
1) PHP – Personal Home Page Scripting Language 2) JavaScript.
CST336, Dr. Krzysztof Pietroszek Week 2: PHP. 1.Introduction to PHP 2.Embed PHP code into an HTML web page 3.Generate (output HTML) web page using PHP.
So – You want to learn how to put an article onto the state website. (Note: If you have not done so, you will need to review the web training provided.
Basic ActionScript and PHP Cis 126. Getting Started set up a basic folder structure so we can keep our files organized. Mirror this structure on your.
Python Lesson 1 1. Starter Create the following Excel spreadsheet and complete the calculations using formulae: 2 Add A1 and B1 A2 minus B2 A3 times B3.
IS2803 Developing Multimedia Applications for Business (Part 2) Lecture 2: Introduction to IS2803 Rob Gleasure
HTML Introduction 2-1. Lecture 6 HTML - HyperText Markup Language  not a programming language  structure text into title, body, paragraphs, lists, links,
PHP Syntax You cannot view the PHP source code by selecting "View source" in the browser - you will only see the output from the PHP file, which is plain.
Learning PHP: Programming Review. PHP is one of many programming languages Different languages have their advantages and disadvantages and are therefore.
IST 210: PHP Basics IST 210: Organization of Data IST2101.
JavaScript Invented 1995 Steve, Tony & Sharon. A Scripting Language (A scripting language is a lightweight programming language that supports the writing.
Unit 4 Working with data. Form Element HTML forms are used to pass data to a server. A form can contain input elements like text fields, checkboxes, radio-buttons,
111 State Management Beginning ASP.NET in C# and VB Chapter 4 Pages
University of Kansas Department of Electrical Engineering and Computer Science Dr. Susan Gauch April 21, 2005 I T T C Introduction to Web Technologies.
JavaScript Part 1 Introduction to scripting The ‘alert’ function.
* Lecture # 7 Instructor: Rida Noor Department of Computer Science
PHP Introduction.
Intro to PHP & Variables
Title: Tech Training Certificate: Ace of Initiative Program
Hello! This presentation is designed to be used with your students to help them join your class and create unique usernames and passwords.
Introduction to TouchDevelop
Programming in JavaScript
Tutorial 10: Programming with javascript
Hello! This presentation is designed to be used with your students to help them join your class and create unique usernames and passwords.
Hello! This presentation is designed to be used with your students to help them join your class and create unique usernames and passwords.
Hello! This presentation is designed to be used with your students to help them join your class and create unique usernames and passwords.
Intro to Programming (in JavaScript)
Presentation transcript:

PHP Form Processing * referenced from

PHP Form Processing PHP is probably the most popular scripting language on the web. It is used to enhance web pages. With PHP, you can do things like create username and password login pages, check details from a form, create forums, picture galleries, surveys, and a whole lot more. If you've come across a web page that ends in PHP, then the author has written some programming code to liven up the plain, old HTML. PHP is known as a server-sided language. That's because the PHP doesn't get executed on your computer, but on the computer you requested the page from. The results are then handed over to you, and displayed in your browser.

Need A Server Before you can write and test your PHP scripts, there's one thing you'll need - a server! You can use your access to mrcomputers.info or you can set up and use portable web server that runs off your flash drive (may not work off your flash drives on the school computers)

Writing PHP Scripts These are written using simple text editors and saved with the extension.php

PHP Variables A variable is just a storage area. You put things into your storage areas (variables) so that you can use and manipulate them in your programs. Things you'll want to store are numbers and text. In php we declare a variable as follows: $name; That’s it!

Assigning Values to Variables Again, easy stuff here: $name=value; Example: $age=25; $name=“John”; $passed=true; Notice there’s no need to declare variables with type i.e. integers, doubles, strings etc...

Writing the Script To write a script, open your text editor and add the base block as follows: <?php //all code goes here ?>

Sample <?php $number1=5; $number2=10; $answer=$number1*$number2; echo “The product of “.$number1. “ and “.$number2. “ is “.$answer; ?>

Save the code you just wrote as test.php Upload to your server space Write the URL to the file in your web browser and see what happens! If all goes well you should see: The product of 5 and 10 is 50

Operators Symbols that perform actions on data In php we used the following so far: =, *,. = is the assignment operator * is the multiplication operator. is the concatenate operator

Process Forms Using PHP To process form data in php all we need are variables to hold the data and a way to gather the data We gather the data by referencing an array that is automatically passed to your script by the web server hosting it: $_POST["name"]

Example Create a very simple form that asks some for their name The user clicks a Submit button and the name is sent to the php script which turns greets the user

HTML Enter your name please: Save this file as greetings.html

PHP <?php $user=$_POST["person"]; echo "Hello there ".$user." "; ?> Save this file as greetings.php

Final Instructions Upload both files to a folder on your web server and then test by loading the web page first For example I put my sample in my ics4uScripts folder which is found on my root drive and so my path is:

Practice If you can install and use your own personal web server then I recommend this (ask your teacher for help with this): Each of the following 3 exercises must be included under the myWork section of Unit 1 in your class website. 1. Create a form that asks a user for their first and last names separately. When submitted have a php script greet the user with their name in the format: lastname, firstname Example: Hello Smith, John

2. Create a form that asks a user for two numbers. Create a php script that takes these numbers, adds them and then displays the result.

3. Create a form that asks a user for the radius of a circle. When submitted a php script will calculate the area of the circle and display this answer. Include a picture of a circle on the results page. Note, php can be combined with html. Just make sure the html is outside the php code block, either above or below.

4. List at least 4 sites with tutorials on using php. Include these as a list of links under the myWork section of your Unit 1 web page.

5. Update your class website as follows: In unit1, include links to all powerpoints that have been assigned to you. Include a link on your homepage named “Report Card Average”. When clicked take it to a page that has a form asking the user for the marks to their four report card classes. Upon submission calculate and display the average of those marks. Include a percentage sign at the end of the average.