For your first question “Detect where they are coming from”, Just check the $_SERVER['HTTP_REFERER']
for your expected web address.
For the second “Create a short lived page”, your answer lies in the set_transient() method. You can do something like:
function create_page() {
if ( get_current_user_id() )
return "<html>...</html>";
return false;
}
function get_page( $unique_id ) {
// Get an earlier created page if it's still alive
$page = get_transient( $unique_id );
if ( !$page ) {
// Try creating a new page
$page = create_page();
if ( !$page )
return false;
// Cache the page and allow it to live for 1 hour
set_transient( $unique_id, $page, HOUR_IN_SECONDS );
}
// Return the page
return $page;
}
Please note the code sample will require modifying to your needs. Basically it creates a page or an inset for a page and saves it to the database with a lifetime of 1 hour. You could accompany this by adding the $unique_id
to the users metadata
. That way you can be sure only a single user can access the page within it’s lifetime.