SlideShare uma empresa Scribd logo
1 de 22
Baixar para ler offline
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

Mais conteúdo relacionado

Mais procurados

Introduction of Html/css/js
Introduction of Html/css/jsIntroduction of Html/css/js
Introduction of Html/css/jsKnoldus Inc.
 
Ppt of web development
Ppt of web developmentPpt of web development
Ppt of web developmentbethanygfair
 
Web servers – features, installation and configuration
Web servers – features, installation and configurationWeb servers – features, installation and configuration
Web servers – features, installation and configurationwebhostingguy
 
Laravel introduction
Laravel introductionLaravel introduction
Laravel introductionSimon Funk
 
Request dispatching in servlet
Request dispatching in servletRequest dispatching in servlet
Request dispatching in servletvikram singh
 
Web Application Development using PHP and MySQL
Web Application Development using PHP and MySQLWeb Application Development using PHP and MySQL
Web Application Development using PHP and MySQLGanesh Kamath
 
PHP Form Validation Technique
PHP Form Validation TechniquePHP Form Validation Technique
PHP Form Validation TechniqueMorshedul Arefin
 
HTTP Request and Response Structure
HTTP Request and Response StructureHTTP Request and Response Structure
HTTP Request and Response StructureBhagyashreeGajera1
 
Introduction to xampp
Introduction to xamppIntroduction to xampp
Introduction to xamppJin Castor
 
Introduction to ajax
Introduction  to  ajaxIntroduction  to  ajax
Introduction to ajaxPihu Goel
 
INDUSTRIAL TRAINING Presentation on Web Development. (2).pptx
INDUSTRIAL TRAINING Presentation on Web Development. (2).pptxINDUSTRIAL TRAINING Presentation on Web Development. (2).pptx
INDUSTRIAL TRAINING Presentation on Web Development. (2).pptx12KritiGaneriwal
 
Beginners PHP Tutorial
Beginners PHP TutorialBeginners PHP Tutorial
Beginners PHP Tutorialalexjones89
 
Ajax ppt - 32 slides
Ajax ppt - 32 slidesAjax ppt - 32 slides
Ajax ppt - 32 slidesSmithss25
 
Front-End Web Development
Front-End Web DevelopmentFront-End Web Development
Front-End Web DevelopmentYash Sati
 

Mais procurados (20)

Introduction of Html/css/js
Introduction of Html/css/jsIntroduction of Html/css/js
Introduction of Html/css/js
 
Ppt of web development
Ppt of web developmentPpt of web development
Ppt of web development
 
Laravel Introduction
Laravel IntroductionLaravel Introduction
Laravel Introduction
 
Web servers – features, installation and configuration
Web servers – features, installation and configurationWeb servers – features, installation and configuration
Web servers – features, installation and configuration
 
Laravel introduction
Laravel introductionLaravel introduction
Laravel introduction
 
Request dispatching in servlet
Request dispatching in servletRequest dispatching in servlet
Request dispatching in servlet
 
Web Application Development using PHP and MySQL
Web Application Development using PHP and MySQLWeb Application Development using PHP and MySQL
Web Application Development using PHP and MySQL
 
PHP Form Validation Technique
PHP Form Validation TechniquePHP Form Validation Technique
PHP Form Validation Technique
 
HTTP Request and Response Structure
HTTP Request and Response StructureHTTP Request and Response Structure
HTTP Request and Response Structure
 
laravel.pptx
laravel.pptxlaravel.pptx
laravel.pptx
 
Web Development using HTML & CSS
Web Development using HTML & CSSWeb Development using HTML & CSS
Web Development using HTML & CSS
 
Introduction to xampp
Introduction to xamppIntroduction to xampp
Introduction to xampp
 
Introduction to ajax
Introduction  to  ajaxIntroduction  to  ajax
Introduction to ajax
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
INDUSTRIAL TRAINING Presentation on Web Development. (2).pptx
INDUSTRIAL TRAINING Presentation on Web Development. (2).pptxINDUSTRIAL TRAINING Presentation on Web Development. (2).pptx
INDUSTRIAL TRAINING Presentation on Web Development. (2).pptx
 
Beginners PHP Tutorial
Beginners PHP TutorialBeginners PHP Tutorial
Beginners PHP Tutorial
 
Ajax ppt - 32 slides
Ajax ppt - 32 slidesAjax ppt - 32 slides
Ajax ppt - 32 slides
 
Codeigniter
CodeigniterCodeigniter
Codeigniter
 
Front-End Web Development
Front-End Web DevelopmentFront-End Web Development
Front-End Web Development
 
Php with MYSQL Database
Php with MYSQL DatabasePhp with MYSQL Database
Php with MYSQL Database
 

Semelhante a WEB TECHNOLOGIES- PHP Programming

Semelhante a 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
 
Chp 08 php (shared)
Chp 08   php  (shared) Chp 08   php  (shared)
Chp 08 php (shared)
 
Department information system
Department information systemDepartment information system
Department information system
 
Php Interview Questions
Php Interview QuestionsPhp Interview Questions
Php Interview Questions
 
Federico Feroldi: PHP in Yahoo!
Federico Feroldi: PHP in Yahoo!Federico Feroldi: PHP in Yahoo!
Federico Feroldi: PHP in Yahoo!
 
Federico Feroldi Php In Yahoo
Federico Feroldi Php In YahooFederico Feroldi Php In Yahoo
Federico Feroldi Php In Yahoo
 
Introduction to web and php mysql
Introduction to web and php mysqlIntroduction to web and php mysql
Introduction to web and php mysql
 
main report on restaurant
main report on restaurantmain report on restaurant
main report on restaurant
 
How PHP works
How PHP works How PHP works
How PHP works
 
PHP Basics
PHP BasicsPHP Basics
PHP Basics
 
Php intro
Php introPhp intro
Php intro
 
Php intro
Php introPhp intro
Php intro
 
Php intro
Php introPhp intro
Php intro
 
Php intro
Php introPhp intro
Php intro
 
PHP
PHPPHP
PHP
 
Php advance
Php advancePhp advance
Php advance
 
Flyr PHP micro-framework
Flyr PHP micro-frameworkFlyr PHP micro-framework
Flyr PHP micro-framework
 
My self learing -Php
My self learing -PhpMy self learing -Php
My self learing -Php
 
My self learn -Php
My self learn -PhpMy self learn -Php
My self learn -Php
 
1912851 635128322315095000
1912851 6351283223150950001912851 635128322315095000
1912851 635128322315095000
 

Mais de Jyothishmathi Institute of Technology and Science Karimnagar

Mais de 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
 
JAVA PROGRAMMING - The Collections Framework
JAVA PROGRAMMING - The Collections Framework JAVA PROGRAMMING - The Collections Framework
JAVA PROGRAMMING - The Collections Framework
 
JAVA PROGRAMMING- Exception handling - Multithreading
JAVA PROGRAMMING- Exception handling - MultithreadingJAVA PROGRAMMING- Exception handling - Multithreading
JAVA PROGRAMMING- Exception handling - Multithreading
 
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
 
Java programming -Object-Oriented Thinking- Inheritance
Java programming -Object-Oriented Thinking- InheritanceJava programming -Object-Oriented Thinking- Inheritance
Java programming -Object-Oriented Thinking- Inheritance
 
WEB TECHNOLOGIES JavaScript
WEB TECHNOLOGIES JavaScriptWEB TECHNOLOGIES JavaScript
WEB TECHNOLOGIES JavaScript
 
WEB TECHNOLOGIES JSP
WEB TECHNOLOGIES  JSPWEB TECHNOLOGIES  JSP
WEB TECHNOLOGIES JSP
 
WEB TECHNOLOGIES Servlet
WEB TECHNOLOGIES ServletWEB TECHNOLOGIES Servlet
WEB TECHNOLOGIES Servlet
 
WEB TECHNOLOGIES XML
WEB TECHNOLOGIES XMLWEB TECHNOLOGIES XML
WEB TECHNOLOGIES XML
 
Compiler Design- Machine Independent Optimizations
Compiler Design- Machine Independent OptimizationsCompiler Design- Machine Independent Optimizations
Compiler Design- Machine Independent Optimizations
 
COMPILER DESIGN Run-Time Environments
COMPILER DESIGN Run-Time EnvironmentsCOMPILER DESIGN Run-Time Environments
COMPILER DESIGN Run-Time Environments
 
COMPILER DESIGN- Syntax Directed Translation
COMPILER DESIGN- Syntax Directed TranslationCOMPILER DESIGN- Syntax Directed Translation
COMPILER DESIGN- Syntax Directed Translation
 
COMPILER DESIGN- Syntax Analysis
COMPILER DESIGN- Syntax AnalysisCOMPILER DESIGN- Syntax Analysis
COMPILER DESIGN- Syntax Analysis
 
COMPILER DESIGN- Introduction & Lexical Analysis:
COMPILER DESIGN- Introduction & Lexical Analysis: COMPILER DESIGN- Introduction & Lexical Analysis:
COMPILER DESIGN- Introduction & Lexical Analysis:
 
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
 
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
 
CRYPTOGRAPHY & NETWORK SECURITY- Cryptographic Hash Functions
CRYPTOGRAPHY & NETWORK SECURITY- Cryptographic Hash FunctionsCRYPTOGRAPHY & NETWORK SECURITY- Cryptographic Hash Functions
CRYPTOGRAPHY & NETWORK SECURITY- Cryptographic Hash Functions
 
CRYPTOGRAPHY & NETWOK SECURITY- Symmetric key Ciphers
CRYPTOGRAPHY & NETWOK SECURITY- Symmetric key CiphersCRYPTOGRAPHY & NETWOK SECURITY- Symmetric key Ciphers
CRYPTOGRAPHY & NETWOK SECURITY- Symmetric key Ciphers
 
CRYPTOGRAPHY & NETWORK SECURITY
CRYPTOGRAPHY & NETWORK SECURITYCRYPTOGRAPHY & NETWORK SECURITY
CRYPTOGRAPHY & NETWORK SECURITY
 
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
 

Último

Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 

Último (20)

Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 

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?