SlideShare ist ein Scribd-Unternehmen logo
1 von 25
WELCOME
MIDHUNSUDHAKAR
midhusudhakaran@gmail.com
Midhun.sudhakar.73@facebook.com
twitter.com/midhunopus
in.linkedin.com/pub/midhunsudhakar/86/a65/a9b/Phonenumber
9995586182
Session and cookies, GET and POST methods
Disclaimer: This presentation is prepared by trainees of
baabtra as a part of mentoring program. This is not official
document of baabtra –Mentoring Partner
Baabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt . Ltd
content
•What are session and cookies
•How it works
•What are GET and POST methods
•examples
HTTP
•HTTP is a stateless protocol.
•Does not remember what happened between
two consecutive requests.
•Even two Requests made by same user are
different for HTTP.
•HTTP just processes a client REQUEST and supplies
the server RESPONSE.
What is
cookie ?
•Cookies are small piece of data
•Stored in the users computer.
•it stores info about you and your
preferences.
For example.
It is not limited to remember just our languages.
•It can contain time you visited a web site.
•Or items in your shopping cart
•Or even contain all the links your clicked.
Syntax and example
Syn:
Setcookie(name, value, expire, path, domain);
Ex:
setcookie("user", "Alex Porter", time()+3600);
click ME
To Read Cookie Values
$_COOKIE['CookieName'];
$_REQUEST['CookieName'];
To Destroy a cookie
setcookie("user", "", time()-3600);
•It is same like cookies
•But it stored in the server.
•Usually used for handle user info
about one session
•Default expire time is 24mnts
What is
session ?
Syntax and example
Syn:
session_start();
$_SESSION[‘name']=value;
Ex:
$_SESSION[‘userid']=100;
Accessing session variable
$_SESSION['views'];
Destroying a Session
unset($_SESSION[‘userid']);
session_destroy();
click Me
Why GET and POST methods?
These are two ways the browser client can send
info to the web server.
GET method
•It sends only limited amount of data.
•Info send using GET method will appear in
browser URL
•PHP provides $_GET associative array to access info.
example
<?php
if( $_GET["name"] || $_GET["age"] ) {
echo "Welcome ". $_GET['name']. "<br />";
echo "You are ". $_GET['age']. " years old.";
}
?>
<html>
<body>
<form action="<?php $_PHP_SELF ?>" method="GET">
Name: <input type="text" name="name" />
Age: <input type="text" name="age" />
<input type="submit" />
</form>
</body>
</html> clickME
POST method
• info sent by using POST method is not visible to
users.
•does not have any restriction on data size to be sent.
•PHP provides $_POST associative array to access
example
<?php
if( $_POST["yourname"] || $_POST["yourage"] )
{
echo "Welcome ". $_POST['yourname']. "<br />";
echo "You age is ". $_POST['yourage']. " years.";
exit();
}
?>
<html>
<body>
<form action="<?php $_PHP_SELF ?>" method="POST">
Your Name: <input type="text" name="yourname" />
Your Age: <input type="text" name="yourage" />
<input type="submit" />
</form>
</body>
</html> click ME
THANK YOU
Want to learn more about programming or Looking to become a good programmer?
Are you wasting time on searching so many contents online?
Do you want to learn things quickly?
Tired of spending huge amount of money to become a Software professional?
Do an online course
@ baabtra.com
We put industry standards to practice. Our structured, activity based courses are so designed
to make a quick, good software professional out of anybody who holds a passion for coding.
Follow us @ twitter.com/baabtra
Like us @ facebook.com/baabtra
Subscribe to us @ youtube.com/baabtra
Become a follower @ slideshare.net/BaabtraMentoringPartner
Connect to us @ in.linkedin.com/in/baabtra
Give a feedback @ massbaab.com/baabtra
Thanks in advance
www.baabtra.com | www.massbaab.com |www.baabte.com
Emarald Mall (Big Bazar Building)
Mavoor Road, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550
NC Complex, Near Bus Stand
Mukkam, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550
Cafit Square,
Hilite Business Park,
Near Pantheerankavu,
Kozhikode
Start up Village
Eranakulam,
Kerala, India.
Email: info@baabtra.com
Contact Us

Weitere ähnliche Inhalte

Was ist angesagt?

Less01 architecture
Less01 architectureLess01 architecture
Less01 architecture
Amit Bhalla
 
Ch 3 software quality factor
Ch 3 software quality factorCh 3 software quality factor
Ch 3 software quality factor
Kittitouch Suteeca
 
Release With Maven
Release With MavenRelease With Maven
Release With Maven
eugenn
 
Software quality assurance
Software quality assuranceSoftware quality assurance
Software quality assurance
Rajeev Sharan
 
verification and validation
verification and validationverification and validation
verification and validation
Dinesh Pasi
 

Was ist angesagt? (20)

Availability and reliability
Availability and reliabilityAvailability and reliability
Availability and reliability
 
requirements analysis and design
requirements analysis and designrequirements analysis and design
requirements analysis and design
 
Boehm Software Quality Model
Boehm Software Quality ModelBoehm Software Quality Model
Boehm Software Quality Model
 
Chapter 01
Chapter 01Chapter 01
Chapter 01
 
Software Evolution
Software EvolutionSoftware Evolution
Software Evolution
 
Software Engineering - chp8- deployment
Software Engineering - chp8- deploymentSoftware Engineering - chp8- deployment
Software Engineering - chp8- deployment
 
UNIT 1.pptx
UNIT 1.pptxUNIT 1.pptx
UNIT 1.pptx
 
Less01 architecture
Less01 architectureLess01 architecture
Less01 architecture
 
Software metrics
Software metricsSoftware metrics
Software metrics
 
Ch 3 software quality factor
Ch 3 software quality factorCh 3 software quality factor
Ch 3 software quality factor
 
Test Strategy and Planning
Test Strategy and PlanningTest Strategy and Planning
Test Strategy and Planning
 
Power of the AWR Warehouse
Power of the AWR WarehousePower of the AWR Warehouse
Power of the AWR Warehouse
 
Release With Maven
Release With MavenRelease With Maven
Release With Maven
 
Best practices for large oracle apps r12 implementations apps14
Best practices for large oracle apps r12 implementations apps14Best practices for large oracle apps r12 implementations apps14
Best practices for large oracle apps r12 implementations apps14
 
Building Aneka clouds.ppt
Building Aneka clouds.pptBuilding Aneka clouds.ppt
Building Aneka clouds.ppt
 
Oracle architecture ppt
Oracle architecture pptOracle architecture ppt
Oracle architecture ppt
 
Software quality assurance
Software quality assuranceSoftware quality assurance
Software quality assurance
 
Software Configuration Management (SCM)
Software Configuration Management (SCM)Software Configuration Management (SCM)
Software Configuration Management (SCM)
 
verification and validation
verification and validationverification and validation
verification and validation
 
Software design
Software designSoftware design
Software design
 

Ähnlich wie Session,cookies and get and post methods

Cookies and sessions
Cookies and sessionsCookies and sessions
Cookies and sessions
UdaAs PaNchi
 
HTML CSS Best Practices
HTML CSS Best PracticesHTML CSS Best Practices
HTML CSS Best Practices
hoctudau
 
Php file upload, cookies & session
Php file upload, cookies & sessionPhp file upload, cookies & session
Php file upload, cookies & session
Jamshid Hashimi
 

Ähnlich wie Session,cookies and get and post methods (20)

Session and cookies ,get and post methods
Session and cookies ,get and post methodsSession and cookies ,get and post methods
Session and cookies ,get and post methods
 
Get and post,session and cookie
Get and post,session and cookieGet and post,session and cookie
Get and post,session and cookie
 
php $_GET / $_POST / $_SESSION
php  $_GET / $_POST / $_SESSIONphp  $_GET / $_POST / $_SESSION
php $_GET / $_POST / $_SESSION
 
Get method and post method
Get method and post methodGet method and post method
Get method and post method
 
GET and POST in PHP
GET and POST in PHPGET and POST in PHP
GET and POST in PHP
 
Dev traning 2016 intro to the web
Dev traning 2016   intro to the webDev traning 2016   intro to the web
Dev traning 2016 intro to the web
 
Common Gateway Interface
Common Gateway InterfaceCommon Gateway Interface
Common Gateway Interface
 
Php Tutorial
Php TutorialPhp Tutorial
Php Tutorial
 
The Devil and HTML5
The Devil and HTML5The Devil and HTML5
The Devil and HTML5
 
Html5 101
Html5 101Html5 101
Html5 101
 
Web Application Development using PHP Chapter 5
Web Application Development using PHP Chapter 5Web Application Development using PHP Chapter 5
Web Application Development using PHP Chapter 5
 
Session and cookies,get and post
Session and cookies,get and postSession and cookies,get and post
Session and cookies,get and post
 
HTML 5
HTML 5HTML 5
HTML 5
 
Cookies and sessions
Cookies and sessionsCookies and sessions
Cookies and sessions
 
HTML CSS Best Practices
HTML CSS Best PracticesHTML CSS Best Practices
HTML CSS Best Practices
 
Sessions n cookies
Sessions n cookiesSessions n cookies
Sessions n cookies
 
PHP COOKIES AND SESSIONS
PHP COOKIES AND SESSIONSPHP COOKIES AND SESSIONS
PHP COOKIES AND SESSIONS
 
Html5 101
Html5 101Html5 101
Html5 101
 
Session and cookies,get and post methods
Session and cookies,get and post methodsSession and cookies,get and post methods
Session and cookies,get and post methods
 
Php file upload, cookies & session
Php file upload, cookies & sessionPhp file upload, cookies & session
Php file upload, cookies & session
 

Mehr von baabtra.com - No. 1 supplier of quality freshers

Mehr von baabtra.com - No. 1 supplier of quality freshers (20)

Agile methodology and scrum development
Agile methodology and scrum developmentAgile methodology and scrum development
Agile methodology and scrum development
 
Best coding practices
Best coding practicesBest coding practices
Best coding practices
 
Core java - baabtra
Core java - baabtraCore java - baabtra
Core java - baabtra
 
Acquiring new skills what you should know
Acquiring new skills   what you should knowAcquiring new skills   what you should know
Acquiring new skills what you should know
 
Baabtra.com programming at school
Baabtra.com programming at schoolBaabtra.com programming at school
Baabtra.com programming at school
 
99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love 99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love
 
Php sessions & cookies
Php sessions & cookiesPhp sessions & cookies
Php sessions & cookies
 
Php database connectivity
Php database connectivityPhp database connectivity
Php database connectivity
 
Chapter 6 database normalisation
Chapter 6  database normalisationChapter 6  database normalisation
Chapter 6 database normalisation
 
Chapter 5 transactions and dcl statements
Chapter 5  transactions and dcl statementsChapter 5  transactions and dcl statements
Chapter 5 transactions and dcl statements
 
Chapter 4 functions, views, indexing
Chapter 4  functions, views, indexingChapter 4  functions, views, indexing
Chapter 4 functions, views, indexing
 
Chapter 3 stored procedures
Chapter 3 stored proceduresChapter 3 stored procedures
Chapter 3 stored procedures
 
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
Chapter 2  grouping,scalar and aggergate functions,joins   inner join,outer joinChapter 2  grouping,scalar and aggergate functions,joins   inner join,outer join
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Microsoft holo lens
Microsoft holo lensMicrosoft holo lens
Microsoft holo lens
 
Blue brain
Blue brainBlue brain
Blue brain
 
5g
5g5g
5g
 
Aptitude skills baabtra
Aptitude skills baabtraAptitude skills baabtra
Aptitude skills baabtra
 
Gd baabtra
Gd baabtraGd baabtra
Gd baabtra
 

KĂźrzlich hochgeladen

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

KĂźrzlich hochgeladen (20)

Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 

Session,cookies and get and post methods

  • 1.
  • 4. Disclaimer: This presentation is prepared by trainees of baabtra as a part of mentoring program. This is not official document of baabtra –Mentoring Partner Baabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt . Ltd
  • 5. content •What are session and cookies •How it works •What are GET and POST methods •examples
  • 6. HTTP •HTTP is a stateless protocol. •Does not remember what happened between two consecutive requests. •Even two Requests made by same user are different for HTTP. •HTTP just processes a client REQUEST and supplies the server RESPONSE.
  • 7. What is cookie ? •Cookies are small piece of data •Stored in the users computer. •it stores info about you and your preferences.
  • 9.
  • 10.
  • 11. It is not limited to remember just our languages. •It can contain time you visited a web site. •Or items in your shopping cart •Or even contain all the links your clicked.
  • 12. Syntax and example Syn: Setcookie(name, value, expire, path, domain); Ex: setcookie("user", "Alex Porter", time()+3600); click ME
  • 13. To Read Cookie Values $_COOKIE['CookieName']; $_REQUEST['CookieName']; To Destroy a cookie setcookie("user", "", time()-3600);
  • 14. •It is same like cookies •But it stored in the server. •Usually used for handle user info about one session •Default expire time is 24mnts What is session ?
  • 16. Accessing session variable $_SESSION['views']; Destroying a Session unset($_SESSION[‘userid']); session_destroy(); click Me
  • 17. Why GET and POST methods? These are two ways the browser client can send info to the web server.
  • 18. GET method •It sends only limited amount of data. •Info send using GET method will appear in browser URL •PHP provides $_GET associative array to access info.
  • 19. example <?php if( $_GET["name"] || $_GET["age"] ) { echo "Welcome ". $_GET['name']. "<br />"; echo "You are ". $_GET['age']. " years old."; } ?> <html> <body> <form action="<?php $_PHP_SELF ?>" method="GET"> Name: <input type="text" name="name" /> Age: <input type="text" name="age" /> <input type="submit" /> </form> </body> </html> clickME
  • 20. POST method • info sent by using POST method is not visible to users. •does not have any restriction on data size to be sent. •PHP provides $_POST associative array to access
  • 21. example <?php if( $_POST["yourname"] || $_POST["yourage"] ) { echo "Welcome ". $_POST['yourname']. "<br />"; echo "You age is ". $_POST['yourage']. " years."; exit(); } ?> <html> <body> <form action="<?php $_PHP_SELF ?>" method="POST"> Your Name: <input type="text" name="yourname" /> Your Age: <input type="text" name="yourage" /> <input type="submit" /> </form> </body> </html> click ME
  • 23. Want to learn more about programming or Looking to become a good programmer? Are you wasting time on searching so many contents online? Do you want to learn things quickly? Tired of spending huge amount of money to become a Software professional? Do an online course @ baabtra.com We put industry standards to practice. Our structured, activity based courses are so designed to make a quick, good software professional out of anybody who holds a passion for coding.
  • 24. Follow us @ twitter.com/baabtra Like us @ facebook.com/baabtra Subscribe to us @ youtube.com/baabtra Become a follower @ slideshare.net/BaabtraMentoringPartner Connect to us @ in.linkedin.com/in/baabtra Give a feedback @ massbaab.com/baabtra Thanks in advance www.baabtra.com | www.massbaab.com |www.baabte.com
  • 25. Emarald Mall (Big Bazar Building) Mavoor Road, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 NC Complex, Near Bus Stand Mukkam, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 Cafit Square, Hilite Business Park, Near Pantheerankavu, Kozhikode Start up Village Eranakulam, Kerala, India. Email: info@baabtra.com Contact Us