• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

retrieve data from database using session

phpsessionfetch


PHP Snippet 1:

if(!empty($_SESSION['idmember'])){
    header("Location: login.php");
}

PHP Snippet 2:

if (!isset($_SESSION['idmember'])){
    header("Location: login.php");
}

Related Snippets

OctoberCMS / Anonymous Global Scope

PHP: Calling MySQL Stored Procedure with Both INPUT AND OUTPUT Parameters (NOT "INOUT")

Two buttons one form

PHP Include for HTML?

How to change HTML structure inside WP <head>

Losing session data after POST from third party website

Sort multidimensional array by column value within a column

best way to store error messages in Laravel (session or variable)

how to insert data into select2 search input after scan using qrcode

Can't remotely connect to MySQL error (13) with PHP script, connecting through CLI works

How to use $this->session->set_userdata in codeigniter

Statement that checks whether a URL contains a particular path?

Warning: Unknown: Failed to write session data using user defined save handler. (session.save_path: ) in Unknown on line 0

How can I get new CSRF token in LARAVEL by using ajax

Using Associative arrays

About Contact Privacy policy Terms and conditions