Setting up a one-time download

Permalink
I have a need to set up a link for a one-time download and I found the following code to get it working, only I'm having trouble integrating the PHP and HTML code in a page.

The following site has an example of how to set up a one-time download using PHP, MYSQL and HTML:
http://www.webvamp.co.uk/blog/coding/creating-one-time-download-lin...

I've tried using Simple PHP add-in and I can get it to work, sort of. It stores the key (strKey) in the new table created, but I can't reference the key in the corresponding HTML. I assume it's due to the variable being local to the PHP block, and HTML doesn't know about it.

The following page is the one I created for this, and the One Time Download code is at the bottom, beneath the image:
http://www.pacesinfo.org/paideia/index.php?cID=564...

 
SheldonB replied on at Permalink Reply
SheldonB
It might be easier trying to get it to work in a custom single page then in a block first

just a thought
pacesinf replied on at Permalink Best Answer Reply
I went with a custom single page, outside of C5. So, it's just a standalone PHP page that gets called.
ronyDdeveloper replied on at Permalink Reply
ronyDdeveloper
You are using PHP shortcode
<?=$strKey;?>

Try to use the regular code
<?php echo $strKey; ?>


Rony