• 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

Install mysql client in docker image

How to average columns of data from multiple, flat arrays?

Malformed MIME header error in Symfony 5.3

virtctl works when executed via command line but not from php exec()

How to get values inside <![CDATA[values]] > using php DOM?

Calculating Median of an array in PHP

The difference when using if statement true === something() vs something() === true [duplicate]

Custom add to cart button URL for specific product in WooCommerce?

Create a new line whenever an array value reaches more than 10 characters

PHPS source file - 403 Forbidden You don't have permission to access this resource

Add a custom text for a particular product on specific email notification in Woocommerce

How to send image,audio or video through the WhatsApp API - PHP

how to hide previous markers when new markers added in google map javascript api

Laravel csrf token mismatch for ajax POST Request

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource [duplicate]

About Contact Privacy policy Terms and conditions