I am using SafeCracker to allow guests to post an entry, and upon submitting said entry are forwarded to another page allowing them to watch a video. I have the Session Variables Plugin, but need to somehow set a Session Variable upon the SafeCracker form being submitted. This would then expire after a specific amount of time so the user cannot come back and view the video again without filling out the form once more.
Is there a way to set this session variable (unique to each submission) when the form is submitted?
I had a similar question, basically can I get the $_POST[‘variable’] or $_REQUEST[‘variable’] from a Safecracker submission. I haven’t found a way directly, but an unelegant way would be to use Safecracker to add this entry to some channel, then retrieve this entry’s data and assign it to your $_SESSION variable. You can later on delete the channel entry. So basically it would work similar to how a PHP session variable works, that is it creates a file and stores the value, then deletes the file, except you’d be doing this in a channel entry. Depending on your traffic your incremental entry id could get rather high though.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.