HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/deensekroon.komma-mediadesign.nl/wwwroot/lib/general/url_pin.class.php
<?php
/**
 * pagePin.class.php
 * Created by Komma Mediadesign.
 * Author: mike
 * Date: 4/10/13
 */

class Url_Pin
{
    /*
     * Pin a 'url-point'
     */
    public static function set($prefix = null)
    {
        $key = 'url_pin';
        if($prefix != null) $key = $prefix . '_' . $key;

        $stringUrl = substr($_SERVER['REQUEST_URI'],1);
        Session::set($key,$stringUrl);
    }

    /*
     * Get pinned 'url-point'
     */
    public static function get($prefix = null)
    {
        $key = 'url_pin';
        if($prefix != null) $key = $prefix . '_' . $key;

        if($url = Session::get($key))
        {
            return $url;
        }
        return false;
    }

    /*
     * Return to pinned 'url-point'
     */
    public static function redirect($prefix = null)
    {
        $key = 'url_pin';
        if($prefix != null) $key = $prefix . '_' . $key;

        if($url = Session::get($key))
        {
            header('location:' . '/' .$url);
            exit;
        }
    }
}