latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Validate custom registratio field in database

Home Forums Community Forum Validate custom registratio field in database

This topic contains 0 replies, has 1 voice. Last updated by  Charles Manning 3 years, 4 months ago.

Topic Author Topic
Posted: Saturday Aug 31st, 2013 at 9:27 pm #58932

Trying to validate a custom form entry against a valid license key stored in a separate database BEFORE a new user is registered. Research has me using a post reply from Jason describing code to be placed in ../wp-content/mu-plugins/s2hacks.php
Upon license failure I’m trying to get an alert(‘Invalid License’) to display before a new user is registered. Step 1 is to get the function to trigger.
Recommendations?

add_action(“init”, “my_custom_validator”, 1);
function my_custom_validator(){
$custom_fields = stripslashes_deep($_POST[s2member_pro_authnet_registration][custom_fields]);
if(empty($custom_fields[“rescue_code”])){ // This custom field is missing?
// Set the error response message for s2Member to display.
$response[“error”] = TRUE;
$response[“response”] = “Custom Field ID

my_unique_field_id

is missing. Please try again.”;
}
}

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.