Preventing unwanted validations

One change I’ve made today, which is a hack (but I can’t think how to do it better) is to change the first line of @function validate@ from:
@if (!$_POST) {@
to
@if (!$_POST || $GLOBALS['FORMPROCESSOR_NO_PROCESS'] == 1) {@

I had to do this because I was writing a login interface which doesn’t work by redirection, and after POSTing to the login form and being authorised, the next form that was shown was being validated straight off, due to the POST of the login data (make sense?).

I’ve no doubt this will cause problems somewhere down the line. If anyone’s thought out how to cure this better then please let me know :-)

2 comments ↓

#1 Simon Willison on 08.27.03 at 2:19 am

The $_POST array is NOT read only, so if I understand your problem correctly you might be able to fix it by deleting the form data that is causing your other logic to activate.

#2 JD on 08.31.03 at 6:37 pm

Hey Peter,

If you don’t mind, could you please send in your latest form processor code to boyzone_2001 AT yahoo DOT com ??

Thanks & Regards,
JD

Leave a Comment