This document discusses GET and POST methods, as well as sessions and cookies.
The GET method sends form data in the URL query string, while POST sends data invisibly. GET has limits on data size and isn't secure for passwords, while POST can handle sensitive data and larger sizes.
Sessions use server-side storage to identify users across pages. Cookies use client-side storage to identify users across browser sessions. Sessions are lost when the browser closes, while cookies persist but only store strings.
3. 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
4. GET & POST
• 2 methods
• Form data sent from client to server
6. GET method
• The data send along the query string
<form action=“registration.php” method=“get”>
• $_GET function is used to collect values in a
form with method=“get".
• Can seen in the url
• Can be bookmarked
• Not suitable for sending password or sensitive
data
• Cant send values exceeding 2000 characters
8. POST method
• $_POST function is used to collect values in a
form with method="post".
<form action=“registration” method=“post”>
• Invisible in url
• Cant be bookmarked
• Suitable for sending sensitive data
• 8 mb size by default
9. GET & POST
GET
• Seen in url
• Can be bookmarked
• Not suitable for sending
sensitive data
• Max size=2000 characters
POST
• Invisible in url
• Cant bookmarked
• Suitable for sending
sensitive data
• Max size=8 mb
11. Session
• A PHP session variable is used to store
information about, or change settings for a
user session.
• Session variables hold information about one
single user, and are available to all pages in
one application.
12. Session
Starting php session
Session_start()
Storing a session variable
$_SESSION['intUserId']=$arrUser['pk_int_user_id'];//set session variable
Accessing a session variable
$user_id=$_SESSION['intUserId'];
Destroying a session variable
1. Unset($_SESSION[‘intUserId’])
2. Session_destroy()
13. Cookie
• A cookie is often used to identify a user.
• A cookie is a small file that the server embeds
on the user's computer.
• Each time the same computer requests a page
with a browser, it will send the cookie too.
15. Session &Cookie
Session
• Stored in server
• Lost when browser close
• Store string and object
• Use future reference
cookie
• Stored in browser
• Don’t lose when browser
close
• Only store string
• Cant use
17. 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.
18. 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
19. 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