>> PHP: JS Integration & Emails. function validate() { } Inserting / Uploading Items to DB Web-Based Systems - Misbhauddin <?php ?> type=“submit” 2 1.

Slides:



Advertisements
Similar presentations
MFA for Business Banking – Security Code Multifactor Authentication: Quick Tip Sheets Note to Financial Institutions: We are providing these QT sheets.
Advertisements

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?
JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
1.  Understanding about How to Working with Server Side Scripting using PHP Framework (CodeIgniter) 2.
1 Configuring Internet- related services (April 22, 2015) © Abdou Illia, Spring 2015.
SERVER web page repository WEB PAGE instructions stores information and instructions BROWSER retrieves web page and follows instructions Server Web Server.
XP Browser and Basics1. XP Browser and Basics2 Learn about Web browser software and Web pages The Web is a collection of files that reside.
Forms Review. 2 Using Forms tag  Contains the form elements on a web page  Container tag tag  Configures a variety of form elements including text.
Dynamic Web Pages. Web Programming  All our web pages so far have been static pages. 1. We create a web page 2. We upload it to the web server 3. People.
Implementing Application Protocols. Overview An application protocol facilitates communication between applications. For example, an client uses.
Browser and Basics Tutorial 1. Learn about Web browser software and Web pages The Web is a collection of files that reside on computers, called.
CSCI 6962: Server-side Design and Programming Server Created .
Uploading Files. Why? By giving a user the option to upload a file you are creating an interactive page You can enable users have a greater web experience.
Logins  You will need PHP to test this code, all modern web hosting companies will provide this, Lehigh does not.  I've given you an account on des170.com:
Logins  You will need PHP to test this code, all modern web hosting companies will provide this, Lehigh does not.  I've given you an account on des170.com:
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
JQuery CS 268. What is jQuery? From their web site:
1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.
Lecture 3 – Data Storage with XML+AJAX and MySQL+socket.io
Week 4  Using PHP with HTML forms  Form Validation  Create your own Contact form Please Visit:
4-Sep-15 HTML Forms Mrs. Goins Web Design Class. Parts of a Web Form A Form is an area that can contain Form Control/Elements. Each piece of information.
(c) Manzur Ashraf, Short course, KFUPM PHP & MySQL 1 Basic PHP Class 2.
HTML Forms What is a form.
Department of Information Technology e-Michigan Web Development 0 HTML Form Creation in the Vignette Content Management Application.
Slide 1 of 19 Welcome to GSA’s Vendor and Customer Self Service (VCSS) course Section 7: Correspondence Navigation This presentation is compliant with.
CSCI 6962: Server-side Design and Programming Introduction to AJAX.
ASP.NET + Ajax Jesper Tørresø ITNET2 F08. Ajax Ajax (Asynchronous JavaScript and XML) A group of interrelated web development techniques used for creating.
Day 17. » Client side and Server side » Since PHP is Server side and can output anything we want, we can output to JS. » With JS libraries, we can create.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
South Dakota Library Network ALEPH v21 Staff User Upgrade Information Circulation and ILL South Dakota Library Network 1200 University, Unit 9672 Spearfish,
Web Programming: Client/Server Applications Server sends the web pages to the client. –built into Visual Studio for development purposes Client displays.
A little PHP. Enter the simple HTML code seen below.
06/10/2015AJAX 1. 2 Introduction All material from AJAX – what is it? Traditional web pages and operation Examples of AJAX use Creating.
JavaScript – Quiz #9 Lecture Code:
JavaScript, Fourth Edition Chapter 5 Validating Form Data with JavaScript.
NMD202 Web Scripting Week3. What we will cover today Includes Exercises PHP Forms Exercises Server side validation Exercises.
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.
CSC 2720 Building Web Applications Server-side Scripting with PHP.
Concepts  messages are passed through the internet by using a protocol called simple mail transfer protocol.  The incoming messages are.
Web Programming Brian Toone 8/27/2014. Outline for today 1.Understanding the architecture of the web 2.Overview of programming languages – Client-side.
Topics Sending an Multipart message Storing images Getting confirmation Session tracking using PHP Graphics Input Validators Cookies.
Consolidating Gmail Accounts Jeff Rew, ITRT Richmond Public Schools.
 Registry itself is easy and straightforward in implementation  The objects of registry are actually complicated to store and manage  Objects of Registry.
Web Technology Introduction AJAXAJAX. AJAX Outline  What is AJAX?  Benefits  Real world examples  How it works  Code review  Samples.
>> PHP: Insert Query & Form Processing. Insert Query Step 1: Define Form Variables Step 2: Make DB Connection Step 3: Error Handling Step 4: Define the.
12/14/20151 Uniquescriptz Backend Support Document Ver 2.0.
Copyright © Texas Education Agency, All rights reserved.1 Web Technologies Website Forms / Data Acquisition.
AJAX Asynchronous JavaScript and XML 1. AJAX Outline What is AJAX? Benefits Real world examples How it works 2.
JQuery and AJAX WEB Technologies : PHP Programming Language.
Form Processing Week Four. Form Processing Concepts The principal tool used to process Web forms stored on UNIX servers is a CGI (Common Gateway Interface)
>> PHP: File Uploads. Pre-requisite Go Online – Download file modify-item.php – copy it to your root folder (D:\xampp\htdocs\Buy4mMe) Web-Based Systems.
Creativematch eCRM Creativematch has launched a new eCRM platform providing access to an marketing suite from your own desktop. Our eCRM platform.
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
ASSIGNMENT 2 Salim Malakouti. Ticketing Website  User submits tickets  Admins answer tickets or take appropriate actions.
ASSIGNMENT POINTS DUE DATE: Monday NOV 30 JAVASCRIPT, INPUT VALIDATION, REGEX See 2 nd slide for Form See 3 rd next slide for the required features.
AJAX CS456 Fall Examples Where is AJAX used? Why do we care?
Securing Web Applications Lesson 4B / Slide 1 of 34 J2EE Web Components Pre-assessment Questions 1. Identify the correct return type returned by the doStartTag()
1.Switch on the computer and wait for loading. 2.Select the Windows 7 OS at the end of the list. 3.Click on the link ‘Administrator’ 4.Enter the administrator.
Configuration File – ProdigyView. Overview Objective Learn how to configure the system through the xml file. Requirements Understanding of the Defines.
1.Switch on the computer and wait for loading. 2.Select the Windows 7 OS at the end of the list. 3.Click on the link ‘Administrator’ 4.Enter the administrator.
A little PHP. Enter the simple HTML code seen below.
ICE Integrated Cloud Environment Cloud Scanning and Mobile Printing
A little PHP.
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
Storing Images Connect to the server using the correct username and password. $conn = mysql_connect(“yourserver”, “joeuser”, “yourpass”); Create the database.
>> PHP: Form Processing
Welcome To Outlook Support Number
Database Driven Websites
Configuring Internet-related services
(Includes setup) FAQ ON DOCUMENTS (Includes setup)
Presentation transcript:

>> PHP: JS Integration & s

function validate() { } Inserting / Uploading Items to DB Web-Based Systems - Misbhauddin <?php ?> type=“submit” 2 1

1. Using the submit() in JS Steps – After successful validation in JavaScript, call the submit function Web-Based Systems - Misbhauddin 3 document.form-name.submit();

2. Using the onsubmit() attribute in form Steps – Include the onsubmit attribute in the form tag – In javaScript validation, return 'true' if everything's fine, or 'false' if not. Returning 'true' means continue with the submit process and send data over to the php code. Web-Based Systems - Misbhauddin 4

3. Using Ajax AJAX = Asynchronous JavaScript and XML. – Allows web pages to be updated asynchronous – Possible to update parts of a web page, without reloading the whole page Web-Based Systems - Misbhauddin 5 $(document).ready(function() { $("#login_form").submit(function() { $.post("login_verify.php",{userid:$('#userid').val(),password:$('#password').val()},function(data) { if(data=='yes') //if correct login detail { document.location='clientprofile.php'; } else { } ); }); Sample

S IN PHP PHPMailer

Using a Third-Party Library PHPMailer – Probably the world's most popular code for sending from PHP! – Integrated SMTP support Download – Web-Based Systems - Misbhauddin 7

Including PHPMailer Use the require_once() command – include() – [suppresses warnings if file does not exists] – require() – [warns if file does not exist] – require_once() – [similar to require but loads file once] The file of concern – class.phpmailer.php – class.smtp.php Web-Based Systems - Misbhauddin 8

Using PHPMailer Prerequisite Knowledge – PHPMailer uses Object-Oriented in PHP Steps – 1. Create a new Object $mail = new PHPMailer(); – 2. Access function for the newly created object using ‘->’ For example: $mail->ValidateAddress($ ); Web-Based Systems - Misbhauddin 9

Using PHPMailer – To/From $mail->From = $mail->FromName = 'Mailer'; Add a recipient - Name is optional 'Josh Adams'); 'Information'); Web-Based Systems - Misbhauddin 10

Using PHPMailer – Subject & Body $mail->Subject = 'Here is the subject'; $mail->Body = $message; If message is HTML $mail->IsHTML(true); // Set format to HTML $mail->MsgHTML($message); $mail->AltBody = 'This is the body in plain text for non- HTML mail clients'; Adding Attachments $mail->AddAttachment('/var/tmp/vcard.info'); Web-Based Systems - Misbhauddin 11

Using PHPMailer – Confirmation if(!$mail->Send()) { echo 'Message could not be sent.'; echo 'Mailer Error: '. $mail->ErrorInfo; exit; } echo 'Message has been sent'; Web-Based Systems - Misbhauddin 12

SMTP Server PHPMailer has its own SMTP Server which may not work on localhost but will work once deployed on a server Other options – Use a custom SMTP Server (Gmail) – Steps: Define Your Username & Passowrd – define('GUSER', // GMail username – define('GPWD', 'password'); // GMail password Functions – $mail->IsSMTP(); // enable SMTP – $mail->SMTPAuth = true; // authentication enabled – $mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for GMail – $mail->Host = 'smtp.gmail.com'; – $mail->Port = 465; – $mail->Username = GUSER; – $mail->Password = GPWD; Web-Based Systems - Misbhauddin 13

Web-Based Systems - Misbhauddin 14 Issue with using Gmail Address