[pmwiki-users] {(...)} markup recipe available

The Editor editor at fast.st
Sun Apr 15 16:58:47 CDT 2007


On 4/15/07, Hans <design5 at softflow.co.uk> wrote:
> A question about using rand:
>
> I am failing to use {(rand 100 999)} for random number generation for
> access code. I do get nice random numbers, but when submitting the
> post I get an error, saying basically the number typed is not the
> random number given. So is this markup expression not suitable for
> this purpose?
>
> In the form I have:
>
> Enter code %red%{(rand 100 999)}
> (:input text access size=3 class=inputtext :)
> (:input hidden accesscode {(rand 100 999)} :)
>
> And the script checks if access==accesscode
>
>
>  ~Hans


It won't work here because it will generate two separate random
numbers.  Well it will work once in 1000 times.

If you look at the captcha function in the MarkupExpressionsExtension
recipe you can see how to make it work.

Cheers
Dan

PS.  Remember, any of the functions in the extension recipes can be
taken out and used independently.



More information about the pmwiki-users mailing list