0

I was wondering if there is a way to set a session variable (using Session Variables Plugin) and then when a user completes an input field (promo code), the field compares the input against the session variable to either allow a user onto another page or to rejects them.

Thanks in advance.

1
  • What have you tried already? I would use jQuery to do this validation upon submitting your form. – Anna_MediaGirl Feb 14 '13 at 2:18
1

I'm pretty sure that using Mo Variables (https://github.com/rsanchez/mo_variables) to receive a POST value from a form you could then perform a simple EE comparison on the session var (that you're setting with the Session Variables plug-in) and the POST var. You could then show/hide content based on the result of that or redirect the user back to the page from which they came.

As Anna suggested you could also use some jQuery to compare the value in the promo field with a hidden field elsewhere on the page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.