int npp_usr_send_message()
Saves a message from user. The message is saved in users_messages table.
users_messages
npp_usr_xxx functions directly read the query string / payload data.
Request must contain the following parameters:
and optionally:
Returns OK or one of the error codes:
void npp_app_main() { // ... else if ( REQ("contact") ) { // show contact form with action="do_contact" render_contact(); } else if ( REQ("do_contact") && REQ_POST ) { ret = npp_usr_send_message(); if ( ret == OK ) RES_LOCATION("/contact?msg=%d", MSG_MESSAGE_SENT); else RES_LOCATION("/contact?msg=%d", ret); } }
Requires NPP_USERS compilation switch.
Contact forms are typically flooded by spamming bots. See the more advanced example how to protect your application against those bots.
There was an error while loading. Please reload this page.