PDA

View Full Version : Question about 'print_stop_message'


Antivirus
11-17-2006, 11:44 PM
I am submitting info through a form in AdminCP. If the script fails my error check, I use 'print_stop_message' to display an error message and then redirect back to the original script.

Problem is the information previously entered in the form is no longer there. How can I get the form to remember what was previously entered so Admin doesn't have to enter it again?

I know it's possible as most forms in vbulletin's admincp have this feature, i just can't figure out how it's done. I was thinking of puting all the field values into a session array, but there's got to be an easier way.

Anyone know?

Adrian Schneider
11-17-2006, 11:46 PM
If you redirect using JavaScript (which IIRC is the same as hitting back) then you won't lose your form data. history.go(-1);Lazy answer though - too busy to dig any deeper right now.

Antivirus
11-18-2006, 12:07 AM
i tried your suggestion (thanks) but it didn't work, however i did figure outthe solution, rather simple which never occurred to try before.

I was using the following which was erasing the data upon returning to the page:

define('CP_REDIRECT', 'scst_stuffsmanager.php?' . $vbulletin->session->vars['sessionurl'] . "&do=add");
print_stop_message('error_user_has_no_active_stuff ');


however if i just use the print_stop_message function, it simply allows me to click a back button, and the data is there... !

print_stop_message('error_user_has_no_active_stuff ');


wow...