Description
Validate the fields on the formNote: The fields are checked to be non-blank / valid email on the webpage BUT we do need to get the values in case someone's playing with URL parms
Usage
oiksp_validate_fields( $atts );Parameters
- $atts
- ( mixed ) required –
Returns
voidSource
File name: oik-squeeze/shortcodes/oik-squeeze.phpLines:
1 to 31 of 31
function oiksp_validate_fields( &$atts ) { oik_require( "bobbforms.inc" ); oik_require_lib( "oik-honeypot" ); do_action( "oik_check_honeypot", "Thanks for your interest." ); $result = bw_verify_nonce( "_oik_squeeze_post_form", "_oik_squeeze_post_nonce" ); if ( $result ) { $name = oiksp_validate_name(); $email = bw_array_get( $_REQUEST, "oiksp_email", null ); $confirm = bw_array_get( $_REQUEST, "oiksp_confirm", null ); $email = trim( $email ); $confirm = trim( $confirm ); if ( $name && $email ) { $atts['name'] = $name; $atts['email'] = $email; $result = oiksp_validate_contact( $name, $email, $confirm, $atts ); if ( $result ) $result = array( "oiksp_name" => urlencode( $name ) , "oiksp_email" => urlencode( $email ) , "oiksp_confirm" => $confirm , "oiksp_id" => $atts['oiksp_id'] ); } else { // p( "Please try again!" ); $result = false; } } bw_trace2( $result, "result", true, BW_TRACE_DEBUG ); return( $result ); }View on GitHub
Invoked by
Calls
1 to 5 of 5
- bw_array_get() – Return the array[index] or array->index (for an object) or a default value if not set
- bw_trace2() – Trace $value to the trace log file if tracing is active
- bw_verify_nonce() – Verify the nonce field
- oiksp_validate_contact() – Validate the contact information with respect to the contact status
- oiksp_validate_name() – Return a validated name field
