[ic] perl code in mv_check gets executed despite verification failure

Mike Heins interchange-users@icdevgroup.org
Wed Feb 19 11:01:00 2003


Quoting John Allman (allmanj@houseofireland.com):
> Jonathan Clark wrote:
> 
> >>Hi - I strongly suspect i'm missing the point of mv_check. If i am can
> >>someone tell me the *proper* way to do this? I'm attempting to perform a
> >>database operation with form data but i only want the operation to
> >>happen if the form passes the verification successfully.
> >>
> >>I have mv_order_profile set to myprofile in a hidden field in my form.
> >>In etc/profiles.order i have defined myprofile. I have mv_check set to
> >>performop in a hidden field in my form. Later on that page i have a
> >>[seti performop]...[/seti] section with the code i want to execute after
> >>verification.
> >>    
> >>
> >
> >You should be setting your routine using [set] not [seti] - you are
> >interpolating and running the code when the page is delivered at the moment.
> >
> >Jonathan
> >www.webmaint.net
> >
> 
> My bad - it is a [set]. There's a [seti] inside it though. I thought 
> [seti] inside [set] wouldn't be interpolated?
> 

I don't know what part of the documentation gave you the idea mv_check
would run only if a profile succeeded.

If you want to conditionally do an mv_check, don't set it in the
form, set it in the profile.

    &calc = $CGI->{mv_check} = 'performop' if $Scratch->{success};

-- 
Mike Heins
Perusion -- Expert Interchange Consulting    http://www.perusion.com/
phone +1.513.523.7621      <mike@perusion.com>

I am a great believer in luck, and I find that the harder I work
the more luck I have. -- Thomas Jefferson