PHP Form Introduction Getting User Information Text Input.

Slides:



Advertisements
Similar presentations
Working with Forms. how are forms manipulated? the document object contains an array of forms objects, one for each form, in document order –forms[] any.
Advertisements

Samsung Smart TV is a web-based application running on an application engine installed on digital TVs connected to the Internet.
Dreamweaver Forms Overview. Forms – A Little Review Most user/webpage communication is one way, like this: Most user/webpage communication is one way,
HTML Form and PHP IST Review of Previous Class HTML table and PHP array Winner is chosen automatically using rand() function.
Supplement Creating Forms. Objectives Show how forms are used How to create the Form element HTML elements used for creating input fields.
Tutorial 6 Working with Web Forms
Computing Concepts Advanced HTML: Tables and Forms.
Create a Form in Dreamweaver Go to: Introduction Step 1 Step 2 Step 3 Step 4 Step 5 Step 6 Introduction Goals Purpose Scope Prerequisites Install (if needed)
JavaScript 101 Lesson 5: Introduction to Events. Lesson Topics Event driven programming Events and event handlers The onClick event handler for hyperlinks.
There is a certain way that an HTML file should be set up. The HTML section declares a beginning and an ending. Within the HTML, there should be a HEAD.
Tutorial 6 Working with Web Forms. XP Objectives Explore how Web forms interact with Web servers Create form elements Create field sets and legends Create.
JavaScript “Hello World” in Microsoft Visual Studio August 2012.
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
1 Events Lect 8. 2 Event-driven Pages one popular feature of the Web is its interactive nature e.g., you click on buttons to make windows appear e.g.,
PHP : Hypertext Preprocessor
HTML Forms What is a form.
XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 1 Creating Web Page Forms Designing a Product Registration Form Tutorial 6.
Jquery IS JQuery Jquery Example of mouseover event that shows a submenu when menu selected: $(‘#menu’).mouseover(function() { $(‘#submenu’).show();
Copyright © Texas Education Agency, All rights reserved. 1 Web Technologies Website Development with Dreamweaver.
Svetlin Nakov Telerik Corporation
Homework for October 2011 Nikolay Kostov Telerik Corporation
Web Technologies Website Development Trade & Industrial Education
Website Development with Dreamweaver
A little PHP. Enter the simple HTML code seen below.
PHP meets MySQL.
Tutorial 7 Creating Forms. Objectives Session 7.1 – Create an HTML form – Insert fields for text – Add labels for form elements – Create radio buttons.
 Whether using paper forms or forms on the web, forms are used for gathering information. User enter information into designated areas, or fields. Forms.
QUT Library EndNote : Managing images. Adding images to EndNote records With EndNote Version 7, images may be embedded within records The Figure, Chart.
HTML, Third Edition--Illustrated Introductory 1 HTML, Third Edition Illustrated Introductory Unit G Using Forms to Control Input.
USING XML AS A DATA SOURCE. Data binding is a process by which information in a data source is stored as an object in computer memory. In this presentation,
HTML and FORMS.  A form is an area that can contain form elements.  Form elements are elements that allow the user to enter information (like text fields,
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,
HTML Form and PHP IST Review of Previous Class HTML table and PHP array Winner is chosen randomly using rand() function.
Tutorial 6 Working with Web Forms. XP Objectives Explore how Web forms interact with Web servers Create form elements Create field sets and legends Create.
Tutorial 6 Working with Web Forms. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Explore how Web forms interact with.
Button and Textbox. Input  Input objects are used to obtain input from the user viewing the webpage. They allow the user to interact with the Web. 
Creating Web Page Forms. Introducing Web Forms Web forms collect information from users Web forms include different control elements including: –Input.
HTML Forms. Slide 2 Forms (Introduction) The purpose of input forms Organizing forms with a and Using different element types to get user input A brief.
1 CSC160 Chapter 7: Events and Event Handlers. 2 Outline Event and event handlers onClick event handler onMouseOver event handler onMouseOut event handler.
Starting BBEdit or Notepad and Opening the HTML File Start BBEdit or Notepad Select Open from the File Menu Open survey1.htm from the Public Folder.
JavaScript Challenges Answers for challenges
Event Handling. Objectives Using event handlers Simulating events Using event-related methods.
Tutorial 6 Working with Web Forms. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Explore how Web forms interact with.
HTML FORMS The TEXT Object Presented By: Ankit Gupta.
INTRODUCTION TO HTML5 New HTML5 User Interface and Attributes.
Document Object Model Nasrullah. DOM When a page is loaded,browser creates a Document Object Model of the Page.
Radio Buttons. Input/Form/Radio Group Use the dialog to enter label and values for the radio buttons.
LESSON : EVENTS AND FORM VALIDATION -JAVASCRIPT. EVENTS CLICK.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
JavaScript Events Java 4 Understanding Events Events add interactivity between the web page and the user You can think of an event as a trigger that.
CSD 340 (Blum)1 Introducing Text Input elements and Ifs.
HTML FORM AND PHP IST 210: Organization of Data IST210 1.
JavaScript Events. Understanding Events Events add interactivity between the web page and the user Events add interactivity between the web page and the.
HTML Tutorial. What is HTML HTML is a markup language for describing web documents (web pages) HTML documents are described by HTML tags Each HTML tag.
Lesson 5 Introduction to HTML Forms. Lesson 5 Forms A form is an area that can contain form elements. Form elements are elements that allow the user to.
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,
HTML Tables Tables are defined with the tag. A table is divided into rows (with the tag), and each row is divided into data cells (with the tag). td stands.
Client-side (JavaScript) Validation. Associating a function with a click event – Part 1 Use the input tag’s onclick attribute to associate a function.
A little PHP. Enter the simple HTML code seen below.
A little PHP.
Retrieving information from forms
HTML Forms and User Input
Unit I: Collecting Data with Forms
Event Driven Programming & User Defined Functions
In Class Programming BIS1523 – Lecture 11.
© 2015, Mike Murach & Associates, Inc.
Select tags CSD 340 (Blum).
Writing to the Page Formatting Forms
HTML Forms What are clients? What are servers?
This is an introduction to JavaScript using the examples found at the CIS17 website. In previous examples I specified language = Javascript, instead of.
Presentation transcript:

PHP Form Introduction Getting User Information Text Input

Handling User Input In this example we will have two files. –For simplicity sake the first one will be an HTML file known as a form (it will have no PHP code). –The second file will be a PHP file that has variables that get their values from data entered by the user on the first file.

Make an HTML file like that below.

The code behind so far

Add the tag with name, action and method attributes

Another approach: Insert/Form/Form

Supply action, method and name attributes

Any input element should be between the tags, so I moved the close form tag to the bottom of the page.

Highlight both cells in the seconds row and then go to Modify/Table/Merge cells

Enter Text in the table cells

Go to Insert/Form/Text Field

Supply an id and a tab index. (The label is for associated text, but we placed that in another table cell.) The tab index will allow the user to click the tab button to progress through the form without using a mouse.

Result (with size attribute) in code and design Note the name and id attributes are both set to txtFirstName. JavaScript usually uses id and PHP uses name.

Add another input text field, then place the cursor after the table but inside the form and go to Insert/Form/Button

Enter value for the type, name and value

Submit code in Code and Design

Adding some style to the button

Starting the PHP code that handles the form data This code takes the data associated with the form and its post method and assigns the values to the PHP variables $firstName and $lastName. Remember PHP variables start with a dollar sign.

Code to display user’s information This code uses the concatenation operator, which in PHP is a period.

Form and Form handler