session and post get method

i have not understand

Comments 2

  • SESSIONS:- In php we use sessions to make boundaries for users like they not access our webpage without login etc.
    And we also able to get all details of users through session variables.
    POST & GET:-
    POST method used to post data without showing it on run time/execution time to user but in a secure way but.
    through get method user can read data during sending of data even he/she change it on execution time.

    in php side $variable=$_POST['name'];
    in php side $variable=$_GET['name'];

    if this article is helpful for you then visit the freecoder. Here you can earn form coding.

  • A security vulnerability will occur in the post or get method. To avoid this security simply use the following code:
    $username = strip_tags(trim(htmlentities($_POST['username'])));