Apr 06, 2015; 17:53
Yescas, Alejandro
Lasso 8.6 to 9, Image Verification
Thank you Carl and Steve for all your help and pointing me in the right direction. I=92m getting a =969956 error code, The key was not found. Any idea and thank you so much for all your help.
<?LassoScript
// Image Verification Example
// Tip of the Week
// <http://www.omnipilot.com/Tip%20of%20the%20Week.1768.8977.lasso>
// This variable will be set to true if the user successfully verifies.
var: 'verified' = false;
// The seed is used to encrypt the word shown in the image. The password
// should be altered to something unique for you site. Including the date
// insures that the encrypted values are different every day.
// Note - the seed must be changed both here and in the 'image.lasso' file.
var: 'seed' = =91Password' + date->(format: '%Q');
// This map defines how image names correspond to the word included in each
// image. Additional images can be added by placing GIFs in the images folder
// and adding entries to thsi map.
var: 'image_map' = (map:
'verification-1.gif'='orange',
'verification-2.gif'='bicycle',
'verification-3.gif'='celsius',
'verification-4.gif'='highway',
'verification-5.gif'='instant',
'verification-6.gif'='volcano',
'verification-7.gif'='coffee',
'verification-8.gif'='water'
);
// If the form has been submitted then we check the incoming value.
if: (action_param: 'action') >> 'submit';
// Decode and decrypt the 'code' parameter.
var: 'image_code' = (decrypt_blowfish: (decode_base64: (action_param: 'code')), -seed=$seed);
// Store the word which was entered by the user.
var: 'image_word' = (action_param: 'word');
// If the code and word match then the user has successfully verified.
if: $image_code == $image_word;
var: 'verified' = true;
Redirect_URL:'http://website/Forms/add.lasso';
else;
var: 'verified' = false;
var: 'message' = 'Please try again.';
/if;
/if;
// If the user has not successfully verified then we choose an image to show to the user.
if: $verified == false;
// Select one of the images from the map at random
var: 'random' = (math_random: -min=1, -max=$image_map->size + 1);
// Encrypt and encode the image name using the 'seed' from above.
// Below, this value is passed to the 'image.lasso' file which actually serves the image.
// This is done so the actual name of the image is never presented to the user.
var: 'image_src' = (encode_base64: (encrypt_blowfish: $image_map->(get: $random)->first, -seed=$seed));
// Encrypt and encode the word shown in the image using the 'seed' from above.
// Below, this value is passed in a hidden 'code' input.
var: 'image_code' = (encode_base64: (encrypt_blowfish: $image_map->(get: $random)->second, -seed=$seed));
/if;
?>
Alejandro Yescas
213.241.3824
Alejandro.Yescas@LAUSD.net
www.translationsunit.com
#############################################################
This message is sent to you because you are subscribed to
the mailing list Lasso Lasso@lists.lassosoft.com
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <Lasso-unsubscribe@lists.lassosoft.com>
Send administrative queries to <Lasso-request@lists.lassosoft.com>
Apr 06, 2015; 13:52
Steve Piercy - Website Builder
Re: Lasso 8.6 to 9, Image Verification