Time limited file download upon form submit

a simple way would be to set a cookie with a timestamp when they submit the form, then check for the cookie and valid timestamp when they hit the url to download the file. a more complicated process would be to generate a unique url key for each user, put that in a db table … Read more

wp_redirect to file:// location results in blank page/cannot be displayed page

The above code didn’t work because of browser security. I’ve decided to go with this code: <?php global $post; the_post(); $location = get_post_meta($post->ID, ‘sc_stace_resource_location’, true); $count = (int) get_post_meta($post->ID, ‘sc_stace_view_count’, true); $count++; update_post_meta($post->ID, ‘sc_stace_view_count’, $count); ?> <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.0 Transitional//EN”> <html> <head> <title><?php the_title(); ?></title> <meta http-equiv=”REFRESH” content=”1;url=<?php echo $location; ?>”> </HEAD> … Read more