SlideShare a Scribd company logo
Web Basics Programming With PHP
By: Mohammad Al-Shalabi & Mohammad Opada Al-Bosh
Lesson 2 Overview:
$_GET & $_POST2
Session3
Homework :P4
Include1
• Why ?
To insert the content of one PHP file into another
PHP file before the server executes it.
• Syntax:
Include & Require
include 'filename';
or
require 'filename';
By: Mohammad Al-Shalabi & Mohammad Opada Al-Bosh
By: Mohammad Al-Shalabi & Mohammad Opada Al-Bosh
Get
• What is GET ?
An associative array of variables passed to the current script via the
URL parameters.
• Example:
 www.mysite.com/index.php?p=home&s=1
• How can i catch the data ?
$page = $_GET[‘p’] ;
$start = $_GET[‘s’];
• When to use ?
when Information that sent is visible to everyone.
• What about security ?
Not Safe ! Need some efforts ..
By: Mohammad Al-Shalabi & Mohammad Opada Al-Bosh
POST
• What is POST?
An associative array of variables passed to the current script via the
HTTP POST method.
• Example:
using form tag.
• How can i catch the data ?
$name = $_POST[‘name’];
$pass = $_POST[‘pass’];
• When to use ?
when Information that sent is invisible to others.
• What about security ?
Not Safe ! But better than GET Need some efforts ..
By: Mohammad Al-Shalabi & Mohammad Opada Al-Bosh
GET vs POST
• Both GET and POST create an array
This array holds key/value pairs, where keys are the names of the form
controls and values are the input data from the user.
• Both GET and POST are treated as $_GET and $_POST.
These are “superglobals”, which means that they are always accessible,
regardless of scope - and you can access them from any function, class
or file without having to do anything special.
• $_GET is an array of variables passed to the current script via the URL
parameters.
• $_POST is an array of variables passed to the current script via the
HTTP POST method.
By: Mohammad Al-Shalabi & Mohammad Opada Al-Bosh
Session
• A PHP Session variable is used to store information about the user, or
change settings for a user session.
• Session variables hold information about one single user, and are
available to all pages in one application.
• session_start() Start new or resume existing session.
• session_destroy() Reset your session and you will lose all your stored
session data.
• Example :
$_SESSION['views']=1;
THANK YOU!
Your Logo

More Related Content

What's hot (20)

PPTX
Uploading a file with php
Muhamad Al Imran
 
PDF
Introduction to php web programming - get and post
baabtra.com - No. 1 supplier of quality freshers
 
PPTX
PHP for hacks
Tom Praison Praison
 
PPT
Php, mysq lpart1
Subhasis Nayak
 
ODP
Php File Upload
Hiroaki Kawai
 
PPT
File Upload
webhostingguy
 
ODP
PHP BASIC PRESENTATION
krutitrivedi
 
PPTX
Working with WP_Query in WordPress
topher1kenobe
 
PPT
php $_GET / $_POST / $_SESSION
tumetr1
 
PPTX
Loops PHP 04
mohamedsaad24
 
PDF
New Features in PHP 5.3
Bradley Holt
 
PPTX
File Uploading in PHP
Idrees Hussain
 
PPTX
File upload php
sana mateen
 
PPT
PHP Tutorials
Yuriy Krapivko
 
PPTX
PHP FUNCTIONS
Zeeshan Ahmed
 
PPTX
PHP Hypertext Preprocessor
adeel990
 
PDF
Web develop in flask
Jim Yeh
 
PDF
Extending the WordPress REST API - Josh Pollock
Caldera Labs
 
PPT
What Is Php
AVC
 
Uploading a file with php
Muhamad Al Imran
 
Introduction to php web programming - get and post
baabtra.com - No. 1 supplier of quality freshers
 
PHP for hacks
Tom Praison Praison
 
Php, mysq lpart1
Subhasis Nayak
 
Php File Upload
Hiroaki Kawai
 
File Upload
webhostingguy
 
PHP BASIC PRESENTATION
krutitrivedi
 
Working with WP_Query in WordPress
topher1kenobe
 
php $_GET / $_POST / $_SESSION
tumetr1
 
Loops PHP 04
mohamedsaad24
 
New Features in PHP 5.3
Bradley Holt
 
File Uploading in PHP
Idrees Hussain
 
File upload php
sana mateen
 
PHP Tutorials
Yuriy Krapivko
 
PHP FUNCTIONS
Zeeshan Ahmed
 
PHP Hypertext Preprocessor
adeel990
 
Web develop in flask
Jim Yeh
 
Extending the WordPress REST API - Josh Pollock
Caldera Labs
 
What Is Php
AVC
 

Similar to Php workshop L03 superglobals (20)

PDF
PHP-Part4
Ahmed Saihood
 
PPT
Lecture7 form processing by okello erick
okelloerick
 
PPTX
Unit - III.pptxbgffhjxfjdfjfgjnsnsnshdhsjsksjsjsjsjsjsjsjsjsldksk
cpbloger553
 
PPT
Php mysql
Abu Bakar
 
PDF
Making web forms using php
krishnapriya Tadepalli
 
PDF
web2_lec6.pdf
ssuser893014
 
PPTX
Form Handling using PHP
Nisa Soomro
 
PDF
Web app development_php_07
Hassen Poreya
 
PPTX
Web Techniques like Cookies and Sessions
SonaliAbhang
 
PDF
Form handling in php
Fahad Khan
 
PDF
Lecture2_IntroductionToPHP_Spring2023.pdf
ShaimaaMohamedGalal
 
PPTX
Introduction to php
Taha Malampatti
 
PPTX
5. Formshcfsjhfajkjsfjsjfjksafjsfjkjfhjsafjsajkgfjskafkjas.pptx
berihun18
 
PPT
Php mysql training-in-mumbai
vibrantuser
 
PDF
GET and POST in PHP
Vineet Kumar Saini
 
PPT
Chapter 07 php forms handling
Dhani Ahmad
 
PPTX
forms.pptx
asmabagersh
 
PPTX
Quick beginner to Lower-Advanced guide/tutorial in PHP
Sanju Sony Kurian
 
PPT
Learning of Php and My SQL Tutorial | For Beginners
Ratnesh Pandey
 
PHP-Part4
Ahmed Saihood
 
Lecture7 form processing by okello erick
okelloerick
 
Unit - III.pptxbgffhjxfjdfjfgjnsnsnshdhsjsksjsjsjsjsjsjsjsjsldksk
cpbloger553
 
Php mysql
Abu Bakar
 
Making web forms using php
krishnapriya Tadepalli
 
web2_lec6.pdf
ssuser893014
 
Form Handling using PHP
Nisa Soomro
 
Web app development_php_07
Hassen Poreya
 
Web Techniques like Cookies and Sessions
SonaliAbhang
 
Form handling in php
Fahad Khan
 
Lecture2_IntroductionToPHP_Spring2023.pdf
ShaimaaMohamedGalal
 
Introduction to php
Taha Malampatti
 
5. Formshcfsjhfajkjsfjsjfjksafjsfjkjfhjsafjsajkgfjskafkjas.pptx
berihun18
 
Php mysql training-in-mumbai
vibrantuser
 
GET and POST in PHP
Vineet Kumar Saini
 
Chapter 07 php forms handling
Dhani Ahmad
 
forms.pptx
asmabagersh
 
Quick beginner to Lower-Advanced guide/tutorial in PHP
Sanju Sony Kurian
 
Learning of Php and My SQL Tutorial | For Beginners
Ratnesh Pandey
 
Ad

More from Mohammad Tahsin Alshalabi (16)

PDF
NUMA optimized Parallel Breadth first Search on Multicore Single node System
Mohammad Tahsin Alshalabi
 
PDF
Learning Management System in Damascus University-Information Technology Engi...
Mohammad Tahsin Alshalabi
 
PPSX
Learning management system in information technology engineering faculty
Mohammad Tahsin Alshalabi
 
PDF
Moodle documentation
Mohammad Tahsin Alshalabi
 
PDF
Moodle plugins programing manual
Mohammad Tahsin Alshalabi
 
PPSX
CodeIgniter L5 email & user agent & security
Mohammad Tahsin Alshalabi
 
PPSX
CodeIgniter L4 file upload & image manipulation & language
Mohammad Tahsin Alshalabi
 
PPSX
CodeIgniter L3 model & active record & template
Mohammad Tahsin Alshalabi
 
PPSX
CodeIgniter L2 helper & libraries & form validation
Mohammad Tahsin Alshalabi
 
PPSX
CodeIgniter L1 introduction to CodeIgniter framework
Mohammad Tahsin Alshalabi
 
PPSX
Comparison between web and mobile application requirements
Mohammad Tahsin Alshalabi
 
PDF
Introduction to web services
Mohammad Tahsin Alshalabi
 
PDF
Introduction to HTML5
Mohammad Tahsin Alshalabi
 
PDF
Php workshop L02 php basics
Mohammad Tahsin Alshalabi
 
PDF
Php workshop L01 CSS
Mohammad Tahsin Alshalabi
 
PDF
Php workshop L0 Introduction
Mohammad Tahsin Alshalabi
 
NUMA optimized Parallel Breadth first Search on Multicore Single node System
Mohammad Tahsin Alshalabi
 
Learning Management System in Damascus University-Information Technology Engi...
Mohammad Tahsin Alshalabi
 
Learning management system in information technology engineering faculty
Mohammad Tahsin Alshalabi
 
Moodle documentation
Mohammad Tahsin Alshalabi
 
Moodle plugins programing manual
Mohammad Tahsin Alshalabi
 
CodeIgniter L5 email & user agent & security
Mohammad Tahsin Alshalabi
 
CodeIgniter L4 file upload & image manipulation & language
Mohammad Tahsin Alshalabi
 
CodeIgniter L3 model & active record & template
Mohammad Tahsin Alshalabi
 
CodeIgniter L2 helper & libraries & form validation
Mohammad Tahsin Alshalabi
 
CodeIgniter L1 introduction to CodeIgniter framework
Mohammad Tahsin Alshalabi
 
Comparison between web and mobile application requirements
Mohammad Tahsin Alshalabi
 
Introduction to web services
Mohammad Tahsin Alshalabi
 
Introduction to HTML5
Mohammad Tahsin Alshalabi
 
Php workshop L02 php basics
Mohammad Tahsin Alshalabi
 
Php workshop L01 CSS
Mohammad Tahsin Alshalabi
 
Php workshop L0 Introduction
Mohammad Tahsin Alshalabi
 
Ad

Recently uploaded (20)

PPTX
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
PPTX
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
PDF
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
PDF
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
PDF
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
PDF
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
PPTX
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
PDF
Online Queue Management System for Public Service Offices in Nepal [Focused i...
Rishab Acharya
 
PDF
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
PPTX
Migrating Millions of Users with Debezium, Apache Kafka, and an Acyclic Synch...
MD Sayem Ahmed
 
PPTX
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
PDF
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
PPTX
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
PPTX
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
PDF
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
PDF
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
PPTX
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
PDF
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
PDF
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
Online Queue Management System for Public Service Offices in Nepal [Focused i...
Rishab Acharya
 
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
Migrating Millions of Users with Debezium, Apache Kafka, and an Acyclic Synch...
MD Sayem Ahmed
 
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 

Php workshop L03 superglobals

  • 2. By: Mohammad Al-Shalabi & Mohammad Opada Al-Bosh Lesson 2 Overview: $_GET & $_POST2 Session3 Homework :P4 Include1
  • 3. • Why ? To insert the content of one PHP file into another PHP file before the server executes it. • Syntax: Include & Require include 'filename'; or require 'filename'; By: Mohammad Al-Shalabi & Mohammad Opada Al-Bosh
  • 4. By: Mohammad Al-Shalabi & Mohammad Opada Al-Bosh Get • What is GET ? An associative array of variables passed to the current script via the URL parameters. • Example:  www.mysite.com/index.php?p=home&s=1 • How can i catch the data ? $page = $_GET[‘p’] ; $start = $_GET[‘s’]; • When to use ? when Information that sent is visible to everyone. • What about security ? Not Safe ! Need some efforts ..
  • 5. By: Mohammad Al-Shalabi & Mohammad Opada Al-Bosh POST • What is POST? An associative array of variables passed to the current script via the HTTP POST method. • Example: using form tag. • How can i catch the data ? $name = $_POST[‘name’]; $pass = $_POST[‘pass’]; • When to use ? when Information that sent is invisible to others. • What about security ? Not Safe ! But better than GET Need some efforts ..
  • 6. By: Mohammad Al-Shalabi & Mohammad Opada Al-Bosh GET vs POST • Both GET and POST create an array This array holds key/value pairs, where keys are the names of the form controls and values are the input data from the user. • Both GET and POST are treated as $_GET and $_POST. These are “superglobals”, which means that they are always accessible, regardless of scope - and you can access them from any function, class or file without having to do anything special. • $_GET is an array of variables passed to the current script via the URL parameters. • $_POST is an array of variables passed to the current script via the HTTP POST method.
  • 7. By: Mohammad Al-Shalabi & Mohammad Opada Al-Bosh Session • A PHP Session variable is used to store information about the user, or change settings for a user session. • Session variables hold information about one single user, and are available to all pages in one application. • session_start() Start new or resume existing session. • session_destroy() Reset your session and you will lose all your stored session data. • Example : $_SESSION['views']=1;