PHP Classes

File: public_html/generateKeys.php

Recommend this page to a friend!
  Classes of Xavier Pérez  >  PHP Protected Page  >  public_html/generateKeys.php  >  Download  
File: public_html/generateKeys.php
Role: Auxiliary script
Content type: text/plain
Description: Example generating auth links
Class: PHP Protected Page
Block direct access to a page from external links
Author: By
Last change:
Date: 2 years ago
Size: 430 bytes


Class file image Download

// This code is for example only, never leave this script on your website witout htpasswd or another protection.
$SECRET_KEY = 'mySecretKey12345679';
$PAGE = '/'; // URL , best default to your project index.php
$USER = '';
$TOKEN = md5($SECRET_KEY . '-' . $USER . '-' . $SERVER);

// Example url
echo 'http://'.$SERVER.'/'.$PAGE.'?xid='.$USER.'&xtk='.$TOKEN;