Your SlideShare is downloading. ×
Get and post,session and cookie
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

Get and post,session and cookie

283
views

Published on

Ge tand post,session and cookie

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
283
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
11
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Yasirmusthafa pp yasirmusthafapp@gmail.com www.facebook.com/yasirmusthafa twitter.com/yasirmusthafapp in.linkedin.com/in/yasirmusthafapp 8891396749 GET andPOST,sessionand cookie
  • 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. GET & POST • 2 methods • Form data sent from client to server
  • 4. GET method
  • 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. POST method
  • 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. 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. Session &Cookie • Used to maintain the states of http request
  • 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. 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. 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. 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. 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. THANK YOU
  • 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. 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. 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