Yasirmusthafa pp
yasirmusthafapp@gmail.com
www.facebook.com/yasirmusthafa
twitter.com/yasirmusthafapp
in.linkedin.com/in/y...
Disclaimer: This presentation is prepared by trainees of
baabtra as a part of mentoring program. This is not official
docu...
GET & POST
• 2 methods
• Form data sent from client to server
GET method
GET method
• The data send along the query string
<form action=“registration.php” method=“get”>
• $_GET function is used t...
POST method
POST method
• $_POST function is used to collect values in a
form with method="post".
<form action=“registration” method=“...
GET & POST
GET
• Seen in url
• Can be bookmarked
• Not suitable for sending
sensitive data
• Max size=2000 characters
POST...
Session &Cookie
• Used to maintain the states of http request
Session
• A PHP session variable is used to store
information about, or change settings for a
user session.
• Session vari...
Session
Starting php session
Session_start()
Storing a session variable
$_SESSION['intUserId']=$arrUser['pk_int_user_id'...
Cookie
• A cookie is often used to identify a user.
• A cookie is a small file that the server embeds
on the user's comput...
Cookie
Create cookie
setcookie("intUserId",$intValue,time()+600);//create cookie variable
Access cookie
$intUserId=$_COO...
Session &Cookie
Session
• Stored in server
• Lost when browser close
• Store string and object
• Use future reference
cook...
THANK YOU
Want to learn more about programming or Looking to become a good programmer?
Are you wasting time on searching so many con...
Follow us @ twitter.com/baabtra
Like us @ facebook.com/baabtra
Subscribe to us @ youtube.com/baabtra
Become a follower @ s...
Emarald Mall (Big Bazar Building)
Mavoor Road, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550
NC Complex, Near Bus Sta...
Get and post,session and cookie
Upcoming SlideShare
Loading in...5
×

Get and post,session and cookie

308

Published on

Ge tand post,session and cookie

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
308
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
12
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Get and post,session and cookie"

  1. 1. Yasirmusthafa pp yasirmusthafapp@gmail.com www.facebook.com/yasirmusthafa twitter.com/yasirmusthafapp in.linkedin.com/in/yasirmusthafapp 8891396749 GET andPOST,sessionand cookie
  2. 2. 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
  3. 3. GET & POST • 2 methods • Form data sent from client to server
  4. 4. GET method
  5. 5. 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
  6. 6. POST method
  7. 7. 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
  8. 8. 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
  9. 9. Session &Cookie • Used to maintain the states of http request
  10. 10. 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.
  11. 11. 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()
  12. 12. 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.
  13. 13. Cookie Create cookie setcookie("intUserId",$intValue,time()+600);//create cookie variable Access cookie $intUserId=$_COOKIE['intUserId']; Unset cookie setcookie("intUserId", "", time()-600);//unset cookie
  14. 14. 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
  15. 15. THANK YOU
  16. 16. 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.
  17. 17. 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
  18. 18. 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
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×