Dr. John P. Abraham Professor UTRGV eCommerce CSCI 6314

Slides:



Advertisements
Similar presentations
WEB DESIGN TABLES, PAGE LAYOUT AND FORMS. Page Layout Page Layout is an important part of web design Why do you think your page layout is important?
Advertisements

UFCE8V-20-3 Information Systems Development 3 (SHAPE HK) Lecture 3 PHP (2) : Functions, User Defined Functions & Environment Variables.
Lecture 14 HTML Forms CPE 401 / 601 Computer Network Systems slides are modified from Dave Hollinger.
1 Chapter 5 – Handling HTML Controls in Web Pages spring into PHP 5 by Steven Holzner Slides were developed by Jack Davis College of Information Science.
JavaScript Forms Form Validation Cookies. What JavaScript can do  Control document appearance and content  Control the browser  Interact with user.
Video, audio, embed, iframe, HTML Form
Supplement Creating Forms. Objectives Show how forms are used How to create the Form element HTML elements used for creating input fields.
JavaScript Forms Form Validation Cookies CGI Programs.
PHP Form Processing. Using Forms in PHP  Two steps to process  Display the form  Process the submitted data.
HTML Form Processing Learning Web Design – Chapter 9, pp Squirrel Book – Chapter 11, pp
USER INTERACTIONS: FORMS
PHP Forms. I. Using PHP with HTML Forms A very common application of PHP is to have an HTML form gather information from a website's visitor and then.
Forms. Form An HTML form is a section of a document containing normal content, special elements called controls (checkboxes, radio buttons, buttons, etc.),
Chapter 9 Collecting Data with Forms. A form on a web page consists of form objects such as text boxes or radio buttons into which users type information.
1 Homework / Exam Exam 3 –Solutions Posted –Questions? HW8 due next class Final Exam –See posted schedule Websites on UNIX systems Course Evaluations.
Advance Database Management Systems Lab no. 5 PHP Web Pages.
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.
Lecture 7 – Form processing (Part 2) SFDV3011 – Advanced Web Development 1.
CSE 382/ETE 334 Internet and Web Technology Presented By Dr. Shazzad Hosain Asst. Prof. EECS, NSU.
HTML - Forms By Joaquin Vila, Ph.D.. Form Tag The FORM tag specifies a fill-out form within an HTML document. More than one fill-out form can be in a.
Robinson_CIS_285_2005 HTML FORMS CIS 285 Winter_2005 Instructor: Mary Robinson.
CSC 2720 Building Web Applications HTML Forms. Introduction  HTML forms are used to collect user input.  The collected input is typically sent to a.
Copyright © 2004 ProsoftTraining, All Rights Reserved. Lesson 7: Web Forms © 2007 Prosoft Learning Corporation All rights reserved ITD 110 Web Page Design.
Website Development with PHP and MySQL Saving Data.
HTML Forms.
Forms and Server Side Includes. What are Forms? Forms are used to get user input We’ve all used them before. For example, ever had to sign up for courses.
LOGO FORMs in HTML CHAPTER 5 Eastern Mediterranean University School of Computing and Technology Department of Information Technology ITEC229 Client-Side.
1 © Netskills Quality Internet Training, University of Newcastle HTML Forms © Netskills, Quality Internet Training, University of Newcastle Netskills is.
HTML - Forms By Joaquin Vila, Ph.D.. Form Tag The FORM tag specifies a fill-out form within an HTML document. More than one fill-out form can be in a.
HTML, PHP, and MySQL: Putting It All Together. Making a Form Input tags Types: “text” “radio” “checkboxes” “submit”
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,
XHTML & Forms. PHP and the WWW PHP and HTML forms – Forms are the main way users can interact with your PHP scrip Typical usage of the form tag in HTML.
TJ 3043 – Web Application Development HTML Form. 2.0 Forms A form is the usual way to communicate information from a Web browser to a server HTML has.
Global Variables - Superglobals Several predefined variables in PHP are "superglobals", which means that they are always accessible, regardless of scope.
ITM © Port, Kazman1 ITM 352 More on Forms Processing.
Forms Collecting Data CSS Class 5. Forms Create a form Add text box Add labels Add check boxes and radio buttons Build a drop-down list Group drop-down.
TJ 3043 – Web Application Development HTML Form. 2.0 Forms - A form is the usual way information is gotten from a browser to a server - HTML has tags.
Web Technologies Lecture 3 Web forms. HTML5 forms A component of a webpage that has form controls – Text fields – Buttons – Checkboxes – Range controls.
Web Page Design Forms! Website Design. Objectives What forms can do The Attributes of the form tag Using Textboxes Textareas Checkboxes Radio buttons.
+ FORMS HTML forms are used to pass data to a server. begins and ends a form Forms are made up of input elements Every input element has a name and value.
Copyright © Texas Education Agency, All rights reserved.1 Web Technologies Website Forms / Data Acquisition.
©SoftMooreSlide 1 Introduction to HTML: Forms ©SoftMooreSlide 2 Forms Forms provide a simple mechanism for collecting user data and submitting it to.
Netprog CGI and Forms1 CGI and Forms A detailed look at HTML forms.
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.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
COSC 2328 – Web Programming.  PHP is a server scripting language  It’s widely-used and free  It’s an alternative to Microsoft’s ASP and Ruby  PHP.
INTERNET APPLICATIONS CPIT405 Forms, Internal links, meta tags, search engine friendly websites.
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,
PHP – Hypertext Preprocessor.
2440: 141 Web Site Administration Web Forms Instructor: Joseph Nattey.
CHAPTER 5 SERVER SIDE SCRIPTING
Receiving form Variables
ITM 352 HTML Forms, Basic Form Processing
How to Write Web Forms By Mimi Opkins.
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
Basic XHTML Tables XHTML tables—a frequently used feature that organizes data into rows and columns. Tables are defined with the table element. Table.
Passing variables between pages
PHP FORM HANDLING Post Method
Basic Contact Form user sends an
MIT GSL 2018 week 1 | day 4 Introduction to Web Development II.
Introducing Forms.
HTML Forms and User Input
CGI Programming Part II UNIX Security
Forms, cont’d.
PHP-II.
Web Forms.
Presentation transcript:

Dr. John P. Abraham Professor UTRGV eCommerce CSCI 6314 PHP Forms Dr. John P. Abraham Professor UTRGV eCommerce CSCI 6314

Begin with HTML <html> <head> </head> <body> <?php ?> <form> </form> </body> </html>

Now add form under html <form action = "<?php $_PHP_SELF ?>" method = "POST"> Your Name Please: <input type = "text" name = "name" /> <br/>Your Age Please : <input type = "text" name = "age" /> <br/>Email Address : <input type = "email" name ="email"/> <br/><input type = "submit" />

Discuss first line of the form <form action = "<?php $_PHP_SELF ?>" method = "POST"> The form tag requires two attributes: action and method. Action says to where the results will be sent to. You can include an url here or what I did, which will produce the current address. The results are stored in an Array with the name of $_POST[]; each element will have an identifier specified in the code. Method is either get or post. POST is used to send data to a server to create/update a resource. Get caches multiple get requests.

The GET method produces a long string that appears in your server logs, in the browser's Location: box. The GET method is restricted to send upto 1024 characters only. Never use GET method if you have password or other sensitive information to be sent to the server. GET can't be used to send binary data, like images or word documents, to the server. The data sent by GET method can be accessed using QUERY_STRING environment variable. The PHP provides $_GET associative array to access all the sent information using GET method. The POST method transfers information via HTTP headers. The information is encoded as described in case of GET method and put into a header called QUERY_STRING. The POST method does not have any restriction on data size to be sent. The POST method can be used to send ASCII as well as binary data. The data sent by POST method goes through HTTP header so security depends on HTTP protocol. By using Secure HTTP you can make sure that your information is secure. The PHP provides $_POST associative array to access all the sent information using POST method.

Second line of the form Reading objects Your Name Please: <input type = "text" name = "name" /> The input tag and the attribute text will create a textBox for us. The name is the most important, that will become the identifier in the #_POST[name] array. There are different types we can use, text, submit, reset, textarea, email, etc.

Retrieving data submitted Recall that the global array $_POST[] contains all data that was submitted. We can retrieve each data element by its name, for example $POST[age]; Let’s echo just one element: echo $_POST['name']; <?php echo $_POST['name']; ?>

Complete code <html> <head> </head> <body> <form action = "<?php $_PHP_SELF ?>" method = "POST"> Your Name Plase: <input type = "text" name = "name" /> <br/>Your Age Please : <input type = "text" name = "age" /> <br/>Email Address : <input type = "email" name ="email"/> <br/><input type = "submit" /> <?php //if (isset($_POST['submit])) { echo "<br/> <h1>You Entered: <br/></h1>"; echo ($_POST['name'] ); echo "<br/>"; echo $_POST['age']; echo $_POST['email']; ?></form> </body> </html>