SlideShare a Scribd company logo
1 of 22
Download to read 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

More Related Content

What's hot (20)

JavaScript guide 2020 Learn JavaScript
JavaScript guide 2020 Learn JavaScriptJavaScript guide 2020 Learn JavaScript
JavaScript guide 2020 Learn JavaScript
 
HTML and CSS crash course!
HTML and CSS crash course!HTML and CSS crash course!
HTML and CSS crash course!
 
Web Development using HTML & CSS
Web Development using HTML & CSSWeb Development using HTML & CSS
Web Development using HTML & CSS
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to Javascript
 
Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)
 
Web Page Designing
Web Page DesigningWeb Page Designing
Web Page Designing
 
Js ppt
Js pptJs ppt
Js ppt
 
Javascript
JavascriptJavascript
Javascript
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
 
Html forms
Html formsHtml forms
Html forms
 
Java Script ppt
Java Script pptJava Script ppt
Java Script ppt
 
How to learn HTML in 10 Days
How to learn HTML in 10 DaysHow to learn HTML in 10 Days
How to learn HTML in 10 Days
 
HTML Forms
HTML FormsHTML Forms
HTML Forms
 
Form Validation in JavaScript
Form Validation in JavaScriptForm Validation in JavaScript
Form Validation in JavaScript
 
HTML Fundamentals
HTML FundamentalsHTML Fundamentals
HTML Fundamentals
 
cascading style sheet ppt
cascading style sheet pptcascading style sheet ppt
cascading style sheet ppt
 
تعلم HTML CSS و JavaScript
تعلم HTML CSS و JavaScriptتعلم HTML CSS و JavaScript
تعلم HTML CSS و JavaScript
 
Presentation on HTML
Presentation on HTMLPresentation on HTML
Presentation on HTML
 
HTML, CSS And JAVASCRIPT!
HTML, CSS And JAVASCRIPT!HTML, CSS And JAVASCRIPT!
HTML, CSS And JAVASCRIPT!
 
Java script ppt
Java script pptJava script ppt
Java script ppt
 

Similar to WEB TECHNOLOGIES- PHP Programming

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
 
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 Unit 1
Php Unit 1Php Unit 1
Php Unit 1
 
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
 

More from Jyothishmathi Institute of Technology and Science Karimnagar

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
 
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
 

Recently uploaded

AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
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
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
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
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 

Recently uploaded (20)

Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
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
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
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
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 

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?