SlideShare a Scribd company logo
WEB TECHNOLOGIES-
PHP Programming
Dr R Jegadeesan Prof-CSE
Jyothishmathi Institute of Technology and Science,
karimnagar
Syllabus
PHP Programming
Introduction to PHP: Declaring variables, data
types, arrays, strings, operators, expressions,
control structures, functions, Reading data from
web form controls like text boxes, radio buttons,
lists etc., Handling File Uploads, Connecting to
database (MySQL as reference), executing simple
queries, handling results, Handling sessions and
cookies File Handling in PHP: File operations like
opening, closing, reading, writing, appending,
deleting etc. on text and binary files, listing
directories
2
UNIT 1 : PHP Programming
Aim & Objective :
➢ To introduce PHP language for Server Side scripting.
➢ PHP file upload features allows you to upload binary and text files both.
Moreover, you can have the full control over the file to be uploaded
through PHP authentication and file operation functions.
PHP File Uploads
3
UNIT 1 : PHP Programming
Principles of File Upload:
➢ PHP allows you to upload single and multiple files through few lines of
code only.
➢PHP file upload facilities allows you to upload both type of files : binary and
text files. Moreover, you can have the full control over the file to be uploaded
through PHP authentication and file operation functions.
PHP File Uploads
4
UNIT 1 : PHP Programming
PHP $_FILES
➢ The PHP global $_FILES contains all the information of file.
➢ $_FILES contains 5 elements. Each elements first dimension is name of the
upload control.
➢ By the help of $_ FILES global, we can get file name, file type, file size, temp
file name and errors associated with file.
PHP File Uploads
5
UNIT 1 : PHP Programming
PHP File Uploads
6
UNIT 1 : PHP Programming
Elements of $_FILES
we are assuming that file name is jits.
$_FILES[‘jits']['name']
returns file name.
$_FILES[‘jits’]['type']
returns MIME type of the file. Ex: application /pdf, image/jpg
$_FILES[‘jits']['size']
returns size of the file (in bytes).
$_FILES[‘jits']['tmp_name']
returns temporary file name of the file which was stored on the server.
$_FILES[‘jits']['error']
returns error code associated with this file.
PHP File Uploads
7
UNIT 1 : PHP Programming
is_uploaded_file() Function
➢By using this function, we can check whether the file is uploaded from client system to
server temporary location or not.
move_uploaded_file() function
➢The move_uploaded_file() function moves the uploaded file to a new location.
➢The move_uploaded_file() function checks internally if the file is uploaded through the
POST request. It moves the file if it is uploaded through the POST request.
PHP File Uploads
8
UNIT 1 : PHP Programming
Example :File Uploading
<html>
<body>
<form action="server_uploaded.php" method="POST" enctype= "multipart/form-data">
<input type="file" name="myfile" />
<input type="submit" value="Upload" />
</form>
</body>
</html>
PHP File Uploads
9
UNIT 1 : PHP Programming
<?php
if(is_uploaded_file($_FILES['myfile']['tmp_name']))
{
$fname=$_FILES['myfile']['name'];
if(move_uploaded_file($_FILES['myfile']['tmp_name'],"myfolder/$fname"))
{
echo "<b>$fname file is sucessfully uploaded <br><br>";
echo "Name of the Uploaded file is ". $_FILES['myfile']['name']. "<br>";
echo "Size of the file is :". $_FILES['myfile']['size']."<br>";
echo "tmp name of the file is :". $_FILES['myfile']['tmp_name']."<br>";
echo "Type of the file is :". $_FILES['myfile']['type'];
}
else
echo "file is not uploaded";
}
else
echo "not";
?>
PHP File Uploads
10
UNIT 1 : PHP Programming
PHP configuration init files
11
UNIT 1 : PHP Programming
PHP Configurations
12
UNIT 1 : PHP Programming
How PHP works
13
UNIT 1 : PHP Programming
PHP code
14
UNIT 1 : PHP Programming
PHP Text & Reference Books
15
Book Details :
TEXT BOOKS:
1. Web Technologies, Uttam K Roy, Oxford University Press
2. The Complete Reference PHP – Steven Holzner, Tata McGraw-Hill
REFERENCE BOOKS:
1.Web Programming, building internet applications, Chris Bates 2nd edition, Wiley Dreamtech
2. Java Server Pages –Hans Bergsten, SPD O’Reilly
3. Java Script, D. Flanagan, O’Reilly,SPD.
4. Beginning Web Programming-Jon Duckett WROX.
5. Programming World Wide Web, R. W. Sebesta, Fourth Edition, Pearson.
6. Internet and World Wide Web – How to program, Dietel and Nieto, Pearson.
UNIT 1 : PHP Programming
PHP Video reference
16
Video Link details (NPTEL, YOUTUBE Lectures and etc.)
https://nptel.ac.in/courses/106105084/
https://freevideolectures.com/course/3140/internet-technologies
https://www.btechguru.com/GATE--computer-science-and-engineering--web-technologies-
video-lecture--22--132.html
UNIT 1 : PHP Programming
PHP courses
17
courses available on <www.coursera.org>, and http://neat.aicte-india.org
https://www.coursera.org/
Course 1 : Web Applications for Everybody Specialization
Build dynamic database-backed web sites.. Use PHP, MySQL, jQuery, and Handlebars to build web
and database applications.
Course 2: Web Design for Everybody: Basics of Web Development & Coding Specialization
Learn to Design and Create Websites. Build a responsive and accessible web portfolio using
HTML5, CSS3, and JavaScript
UNIT 1 : PHP Programming
PHP Tutorials
18
Tutorial topic wise
➢https://www.w3schools.com/PHP/DEfaULT.asP
➢https://www.phptpoint.com/php-tutorial/
➢https://www.tutorialspoint.com/php/index.htm
UNIT 1 : PHP Programming
PHP MCQs
19
PHP – MCQs
1. What does PHP stand for?
i) Personal Home Page ii) Hypertext Preprocessor
iii) Pretext Hypertext Processor iv) Preprocessor Home Page
A. Both (i) and (ii) B. Both (ii) and (iv) C. Only (ii) D. Both (i) and (iii)
2. PHP files have a default file extension of.
A. .html B. .xml C. .php D. .ph
3. A PHP script should start with ---- and end with----:
A. < php > B. < ? php ?> C. < ? ? > D. < ?php ? >
4. Which of the looping statements is/are supported by PHP?
i) for loop ii) while loop iii) do-while loop iv) foreach loop
A. (i) and (ii) B. (i), (ii) and (iii)
C. All of the mentioned
D. None of the mentioned
UNIT 1 : PHP Programming
PHP Tutorial
20
PHP –Tutorial Problems:
1.Write a php program to read employee details
2.Write aphp program to uploads files to remote directory
UNIT 1 : PHP Programming
PHP Questions
21
PHP –universities & Important Questions:
1.What are the different types of errors in PHP?
2.What is the functionality of the function strstr and stristr?
3. Explain about various data types in PHP.
4. Explain about Arrays in PHP.
5. List and Explain the string functions in PHP.
6. List the statements that are used to connect PHP with MySQL.
7.How PHP is different from PHP Script? Explain.
8. Explain PHP form processing with an example.
9.How can I retrieve values from one database server and store them in other database server
using PHP?
10. What are the differences between Get and post methods in form submitting. Give the case
where we can use get and we can use post methods?
Thank you
22
Ad

More Related Content

What's hot (20)

Php Tutorials for Beginners
Php Tutorials for BeginnersPhp Tutorials for Beginners
Php Tutorials for Beginners
Vineet Kumar Saini
 
Lecture-1: Introduction to web engineering - course overview and grading scheme
Lecture-1: Introduction to web engineering - course overview and grading schemeLecture-1: Introduction to web engineering - course overview and grading scheme
Lecture-1: Introduction to web engineering - course overview and grading scheme
Mubashir Ali
 
PHP-MySQL Database Connectivity Using XAMPP Server
PHP-MySQL Database Connectivity Using XAMPP ServerPHP-MySQL Database Connectivity Using XAMPP Server
PHP-MySQL Database Connectivity Using XAMPP Server
Rajiv Bhatia
 
Web technology
Web technologyWeb technology
Web technology
Selvin Josy Bai Somu
 
Html JavaScript and CSS
Html JavaScript and CSSHtml JavaScript and CSS
Html JavaScript and CSS
Radhe Krishna Rajan
 
XML
XMLXML
XML
Avanitrambadiya
 
4.2 PHP Function
4.2 PHP Function4.2 PHP Function
4.2 PHP Function
Jalpesh Vasa
 
Database Management System
Database Management SystemDatabase Management System
Database Management System
SSN College of Engineering, Kalavakkam
 
Ppt of web development
Ppt of web developmentPpt of web development
Ppt of web development
bethanygfair
 
Php.ppt
Php.pptPhp.ppt
Php.ppt
Nidhi mishra
 
Introduction To CodeIgniter
Introduction To CodeIgniterIntroduction To CodeIgniter
Introduction To CodeIgniter
schwebbie
 
Introduction to ajax
Introduction  to  ajaxIntroduction  to  ajax
Introduction to ajax
Pihu Goel
 
PHP
PHPPHP
PHP
Steve Fort
 
Introduction to xampp
Introduction to xamppIntroduction to xampp
Introduction to xampp
Jin Castor
 
Basic concepts for python web development
Basic concepts for python web developmentBasic concepts for python web development
Basic concepts for python web development
NexSoftsys
 
Web Development Course: PHP lecture 1
Web Development Course: PHP lecture 1Web Development Course: PHP lecture 1
Web Development Course: PHP lecture 1
Gheyath M. Othman
 
Master page in Asp.net
Master page in Asp.netMaster page in Asp.net
Master page in Asp.net
RupinderjitKaur9
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
shanmukhareddy dasi
 
Ajax ppt
Ajax pptAjax ppt
Ajax ppt
OECLIB Odisha Electronics Control Library
 
Web servers
Web serversWeb servers
Web servers
webhostingguy
 

Similar to WEB TECHNOLOGIES- PHP Programming (20)

chapter 5 Server-Side Scripting (PHP).pdf
chapter 5 Server-Side Scripting (PHP).pdfchapter 5 Server-Side Scripting (PHP).pdf
chapter 5 Server-Side Scripting (PHP).pdf
burasyacob012
 
Chp 08 php (shared)
Chp 08   php  (shared) Chp 08   php  (shared)
Chp 08 php (shared)
YUSRA FERNANDO
 
Department information system
Department information systemDepartment information system
Department information system
SUMIT MIshra
 
Php Interview Questions
Php Interview QuestionsPhp Interview Questions
Php Interview Questions
UmeshSingh159
 
Federico Feroldi Php In Yahoo
Federico Feroldi Php In YahooFederico Feroldi Php In Yahoo
Federico Feroldi Php In Yahoo
Federico Feroldi
 
Introduction to web and php mysql
Introduction to web and php mysqlIntroduction to web and php mysql
Introduction to web and php mysql
Programmer Blog
 
main report on restaurant
main report on restaurantmain report on restaurant
main report on restaurant
Neeraj Kumar
 
How PHP works
How PHP works How PHP works
How PHP works
Atlogys Technical Consulting
 
Php Unit 1
Php Unit 1Php Unit 1
Php Unit 1
team11vgnt
 
PHP Basics
PHP BasicsPHP Basics
PHP Basics
Roohul Amin
 
Php intro
Php introPhp intro
Php intro
Jennie Gajjar
 
Php intro
Php introPhp intro
Php intro
Jennie Gajjar
 
Php intro
Php introPhp intro
Php intro
Jennie Gajjar
 
Php intro
Php introPhp intro
Php intro
sana mateen
 
PHP
PHPPHP
PHP
Potter
 
Php advance
Php advancePhp advance
Php advance
Rattanjeet Singh
 
Flyr PHP micro-framework
Flyr PHP micro-frameworkFlyr PHP micro-framework
Flyr PHP micro-framework
Siro Díaz Palazón
 
My self learing -Php
My self learing -PhpMy self learing -Php
My self learing -Php
laavanyaD2009
 
My self learn -Php
My self learn -PhpMy self learn -Php
My self learn -Php
laavanyaD2009
 
HEATH INSURANCE CLAIM MANAGEMENT SYSTEM PROJECT REPORT.
HEATH INSURANCE CLAIM MANAGEMENT SYSTEM PROJECT REPORT.HEATH INSURANCE CLAIM MANAGEMENT SYSTEM PROJECT REPORT.
HEATH INSURANCE CLAIM MANAGEMENT SYSTEM PROJECT REPORT.
Kamal Acharya
 
Ad

More from Jyothishmathi Institute of Technology and Science Karimnagar (20)

JAVA PROGRAMMING- GUI Programming with Swing - The Swing Buttons
JAVA PROGRAMMING- GUI Programming with Swing - The Swing ButtonsJAVA PROGRAMMING- GUI Programming with Swing - The Swing Buttons
JAVA PROGRAMMING- GUI Programming with Swing - The Swing Buttons
Jyothishmathi Institute of Technology and Science Karimnagar
 
JAVA PROGRAMMING - The Collections Framework
JAVA PROGRAMMING - The Collections Framework JAVA PROGRAMMING - The Collections Framework
JAVA PROGRAMMING - The Collections Framework
Jyothishmathi Institute of Technology and Science Karimnagar
 
JAVA PROGRAMMING- Exception handling - Multithreading
JAVA PROGRAMMING- Exception handling - MultithreadingJAVA PROGRAMMING- Exception handling - Multithreading
JAVA PROGRAMMING- Exception handling - Multithreading
Jyothishmathi Institute of Technology and Science Karimnagar
 
JAVA PROGRAMMING – Packages - Stream based I/O
JAVA PROGRAMMING – Packages - Stream based I/O JAVA PROGRAMMING – Packages - Stream based I/O
JAVA PROGRAMMING – Packages - Stream based I/O
Jyothishmathi Institute of Technology and Science Karimnagar
 
Java programming -Object-Oriented Thinking- Inheritance
Java programming -Object-Oriented Thinking- InheritanceJava programming -Object-Oriented Thinking- Inheritance
Java programming -Object-Oriented Thinking- Inheritance
Jyothishmathi Institute of Technology and Science Karimnagar
 
WEB TECHNOLOGIES JavaScript
WEB TECHNOLOGIES JavaScriptWEB TECHNOLOGIES JavaScript
WEB TECHNOLOGIES JavaScript
Jyothishmathi Institute of Technology and Science Karimnagar
 
WEB TECHNOLOGIES JSP
WEB TECHNOLOGIES  JSPWEB TECHNOLOGIES  JSP
WEB TECHNOLOGIES JSP
Jyothishmathi Institute of Technology and Science Karimnagar
 
WEB TECHNOLOGIES Servlet
WEB TECHNOLOGIES ServletWEB TECHNOLOGIES Servlet
WEB TECHNOLOGIES Servlet
Jyothishmathi Institute of Technology and Science Karimnagar
 
WEB TECHNOLOGIES XML
WEB TECHNOLOGIES XMLWEB TECHNOLOGIES XML
WEB TECHNOLOGIES XML
Jyothishmathi Institute of Technology and Science Karimnagar
 
Compiler Design- Machine Independent Optimizations
Compiler Design- Machine Independent OptimizationsCompiler Design- Machine Independent Optimizations
Compiler Design- Machine Independent Optimizations
Jyothishmathi Institute of Technology and Science Karimnagar
 
COMPILER DESIGN Run-Time Environments
COMPILER DESIGN Run-Time EnvironmentsCOMPILER DESIGN Run-Time Environments
COMPILER DESIGN Run-Time Environments
Jyothishmathi Institute of Technology and Science Karimnagar
 
COMPILER DESIGN- Syntax Directed Translation
COMPILER DESIGN- Syntax Directed TranslationCOMPILER DESIGN- Syntax Directed Translation
COMPILER DESIGN- Syntax Directed Translation
Jyothishmathi Institute of Technology and Science Karimnagar
 
COMPILER DESIGN- Syntax Analysis
COMPILER DESIGN- Syntax AnalysisCOMPILER DESIGN- Syntax Analysis
COMPILER DESIGN- Syntax Analysis
Jyothishmathi Institute of Technology and Science Karimnagar
 
COMPILER DESIGN- Introduction & Lexical Analysis:
COMPILER DESIGN- Introduction & Lexical Analysis: COMPILER DESIGN- Introduction & Lexical Analysis:
COMPILER DESIGN- Introduction & Lexical Analysis:
Jyothishmathi Institute of Technology and Science Karimnagar
 
CRYPTOGRAPHY AND NETWORK SECURITY- E-Mail Security
CRYPTOGRAPHY AND NETWORK SECURITY- E-Mail SecurityCRYPTOGRAPHY AND NETWORK SECURITY- E-Mail Security
CRYPTOGRAPHY AND NETWORK SECURITY- E-Mail Security
Jyothishmathi Institute of Technology and Science Karimnagar
 
CRYPTOGRAPHY AND NETWORK SECURITY- Transport-level Security
CRYPTOGRAPHY AND NETWORK SECURITY- Transport-level SecurityCRYPTOGRAPHY AND NETWORK SECURITY- Transport-level Security
CRYPTOGRAPHY AND NETWORK SECURITY- Transport-level Security
Jyothishmathi Institute of Technology and Science Karimnagar
 
CRYPTOGRAPHY & NETWORK SECURITY- Cryptographic Hash Functions
CRYPTOGRAPHY & NETWORK SECURITY- Cryptographic Hash FunctionsCRYPTOGRAPHY & NETWORK SECURITY- Cryptographic Hash Functions
CRYPTOGRAPHY & NETWORK SECURITY- Cryptographic Hash Functions
Jyothishmathi Institute of Technology and Science Karimnagar
 
CRYPTOGRAPHY & NETWOK SECURITY- Symmetric key Ciphers
CRYPTOGRAPHY & NETWOK SECURITY- Symmetric key CiphersCRYPTOGRAPHY & NETWOK SECURITY- Symmetric key Ciphers
CRYPTOGRAPHY & NETWOK SECURITY- Symmetric key Ciphers
Jyothishmathi Institute of Technology and Science Karimnagar
 
CRYPTOGRAPHY & NETWORK SECURITY
CRYPTOGRAPHY & NETWORK SECURITYCRYPTOGRAPHY & NETWORK SECURITY
CRYPTOGRAPHY & NETWORK SECURITY
Jyothishmathi Institute of Technology and Science Karimnagar
 
Computer Forensics Working with Windows and DOS Systems
Computer Forensics Working with Windows and DOS SystemsComputer Forensics Working with Windows and DOS Systems
Computer Forensics Working with Windows and DOS Systems
Jyothishmathi Institute of Technology and Science Karimnagar
 
Ad

Recently uploaded (20)

Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 

WEB TECHNOLOGIES- PHP Programming

  • 1. WEB TECHNOLOGIES- PHP Programming Dr R Jegadeesan Prof-CSE Jyothishmathi Institute of Technology and Science, karimnagar
  • 2. Syllabus PHP Programming Introduction to PHP: Declaring variables, data types, arrays, strings, operators, expressions, control structures, functions, Reading data from web form controls like text boxes, radio buttons, lists etc., Handling File Uploads, Connecting to database (MySQL as reference), executing simple queries, handling results, Handling sessions and cookies File Handling in PHP: File operations like opening, closing, reading, writing, appending, deleting etc. on text and binary files, listing directories 2
  • 3. UNIT 1 : PHP Programming Aim & Objective : ➢ To introduce PHP language for Server Side scripting. ➢ PHP file upload features allows you to upload binary and text files both. Moreover, you can have the full control over the file to be uploaded through PHP authentication and file operation functions. PHP File Uploads 3
  • 4. UNIT 1 : PHP Programming Principles of File Upload: ➢ PHP allows you to upload single and multiple files through few lines of code only. ➢PHP file upload facilities allows you to upload both type of files : binary and text files. Moreover, you can have the full control over the file to be uploaded through PHP authentication and file operation functions. PHP File Uploads 4
  • 5. UNIT 1 : PHP Programming PHP $_FILES ➢ The PHP global $_FILES contains all the information of file. ➢ $_FILES contains 5 elements. Each elements first dimension is name of the upload control. ➢ By the help of $_ FILES global, we can get file name, file type, file size, temp file name and errors associated with file. PHP File Uploads 5
  • 6. UNIT 1 : PHP Programming PHP File Uploads 6
  • 7. UNIT 1 : PHP Programming Elements of $_FILES we are assuming that file name is jits. $_FILES[‘jits']['name'] returns file name. $_FILES[‘jits’]['type'] returns MIME type of the file. Ex: application /pdf, image/jpg $_FILES[‘jits']['size'] returns size of the file (in bytes). $_FILES[‘jits']['tmp_name'] returns temporary file name of the file which was stored on the server. $_FILES[‘jits']['error'] returns error code associated with this file. PHP File Uploads 7
  • 8. UNIT 1 : PHP Programming is_uploaded_file() Function ➢By using this function, we can check whether the file is uploaded from client system to server temporary location or not. move_uploaded_file() function ➢The move_uploaded_file() function moves the uploaded file to a new location. ➢The move_uploaded_file() function checks internally if the file is uploaded through the POST request. It moves the file if it is uploaded through the POST request. PHP File Uploads 8
  • 9. UNIT 1 : PHP Programming Example :File Uploading <html> <body> <form action="server_uploaded.php" method="POST" enctype= "multipart/form-data"> <input type="file" name="myfile" /> <input type="submit" value="Upload" /> </form> </body> </html> PHP File Uploads 9
  • 10. UNIT 1 : PHP Programming <?php if(is_uploaded_file($_FILES['myfile']['tmp_name'])) { $fname=$_FILES['myfile']['name']; if(move_uploaded_file($_FILES['myfile']['tmp_name'],"myfolder/$fname")) { echo "<b>$fname file is sucessfully uploaded <br><br>"; echo "Name of the Uploaded file is ". $_FILES['myfile']['name']. "<br>"; echo "Size of the file is :". $_FILES['myfile']['size']."<br>"; echo "tmp name of the file is :". $_FILES['myfile']['tmp_name']."<br>"; echo "Type of the file is :". $_FILES['myfile']['type']; } else echo "file is not uploaded"; } else echo "not"; ?> PHP File Uploads 10
  • 11. UNIT 1 : PHP Programming PHP configuration init files 11
  • 12. UNIT 1 : PHP Programming PHP Configurations 12
  • 13. UNIT 1 : PHP Programming How PHP works 13
  • 14. UNIT 1 : PHP Programming PHP code 14
  • 15. UNIT 1 : PHP Programming PHP Text & Reference Books 15 Book Details : TEXT BOOKS: 1. Web Technologies, Uttam K Roy, Oxford University Press 2. The Complete Reference PHP – Steven Holzner, Tata McGraw-Hill REFERENCE BOOKS: 1.Web Programming, building internet applications, Chris Bates 2nd edition, Wiley Dreamtech 2. Java Server Pages –Hans Bergsten, SPD O’Reilly 3. Java Script, D. Flanagan, O’Reilly,SPD. 4. Beginning Web Programming-Jon Duckett WROX. 5. Programming World Wide Web, R. W. Sebesta, Fourth Edition, Pearson. 6. Internet and World Wide Web – How to program, Dietel and Nieto, Pearson.
  • 16. UNIT 1 : PHP Programming PHP Video reference 16 Video Link details (NPTEL, YOUTUBE Lectures and etc.) https://nptel.ac.in/courses/106105084/ https://freevideolectures.com/course/3140/internet-technologies https://www.btechguru.com/GATE--computer-science-and-engineering--web-technologies- video-lecture--22--132.html
  • 17. UNIT 1 : PHP Programming PHP courses 17 courses available on <www.coursera.org>, and http://neat.aicte-india.org https://www.coursera.org/ Course 1 : Web Applications for Everybody Specialization Build dynamic database-backed web sites.. Use PHP, MySQL, jQuery, and Handlebars to build web and database applications. Course 2: Web Design for Everybody: Basics of Web Development & Coding Specialization Learn to Design and Create Websites. Build a responsive and accessible web portfolio using HTML5, CSS3, and JavaScript
  • 18. UNIT 1 : PHP Programming PHP Tutorials 18 Tutorial topic wise ➢https://www.w3schools.com/PHP/DEfaULT.asP ➢https://www.phptpoint.com/php-tutorial/ ➢https://www.tutorialspoint.com/php/index.htm
  • 19. UNIT 1 : PHP Programming PHP MCQs 19 PHP – MCQs 1. What does PHP stand for? i) Personal Home Page ii) Hypertext Preprocessor iii) Pretext Hypertext Processor iv) Preprocessor Home Page A. Both (i) and (ii) B. Both (ii) and (iv) C. Only (ii) D. Both (i) and (iii) 2. PHP files have a default file extension of. A. .html B. .xml C. .php D. .ph 3. A PHP script should start with ---- and end with----: A. < php > B. < ? php ?> C. < ? ? > D. < ?php ? > 4. Which of the looping statements is/are supported by PHP? i) for loop ii) while loop iii) do-while loop iv) foreach loop A. (i) and (ii) B. (i), (ii) and (iii) C. All of the mentioned D. None of the mentioned
  • 20. UNIT 1 : PHP Programming PHP Tutorial 20 PHP –Tutorial Problems: 1.Write a php program to read employee details 2.Write aphp program to uploads files to remote directory
  • 21. UNIT 1 : PHP Programming PHP Questions 21 PHP –universities & Important Questions: 1.What are the different types of errors in PHP? 2.What is the functionality of the function strstr and stristr? 3. Explain about various data types in PHP. 4. Explain about Arrays in PHP. 5. List and Explain the string functions in PHP. 6. List the statements that are used to connect PHP with MySQL. 7.How PHP is different from PHP Script? Explain. 8. Explain PHP form processing with an example. 9.How can I retrieve values from one database server and store them in other database server using PHP? 10. What are the differences between Get and post methods in form submitting. Give the case where we can use get and we can use post methods?