From 5ec6294a7ac9c5dfa6a0746675764c2ee71076fd Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Tue, 9 Jan 2018 16:08:25 -0500 Subject: [PATCH] Updating the registration forms. Have to use attribute name not class in the form for it to work correctly. --- models/front/registrations/register.php | 47 ++++++++++--------------- views/front/registrations/register.html | 4 +-- views/front/registrations/summary.html | 4 +-- 3 files changed, 23 insertions(+), 32 deletions(-) diff --git a/models/front/registrations/register.php b/models/front/registrations/register.php index cacfe1f..4be44a3 100644 --- a/models/front/registrations/register.php +++ b/models/front/registrations/register.php @@ -70,22 +70,26 @@ $zip = (isset($_REQUEST['zip'])) ? filter_var( $_REQUEST['zip'], FILTER_SANITIZE_STRING ): ''; $country = (isset($_REQUEST['country'])) ? filter_var( $_REQUEST['country'], FILTER_SANITIZE_STRING ): ''; + // Setup the Account Data array from submitted data + $accountData = array( + 'date_created' => date('Y-m-d'), + 'active' => 1, + 'email' => $email, + 'password' => password_hash($password, PASSWORD_DEFAULT), + 'fname' => $fname, + 'lname' => $lname, + 'addr1' => $addr1, + 'addr2' => $addr2, + 'city' => $city, + 'state' => $state, + 'zip' => $zip, + 'country' => $country, + ); + // echo '
$accountData: ' . print_r( $accountData, true ) . '
'; + // exit; + switch ( $option ) { case 'update': - $accountData = array( - 'date_created' => date('Y-m-d'), - 'active' => 1, - 'email' => $email, - 'password' => password_hash($password, PASSWORD_DEFAULT), - 'fname' => $fname, - 'lname' => $lname, - 'addr1' => $addr1, - 'addr2' => $addr2, - 'city' => $city, - 'state' => $state, - 'zip' => $zip, - 'country' => $country, - ); $account_id = (isset($_REQUEST['reg_account_id'])) ? filter_var( $_REQUEST['reg_account_id'], FILTER_VALIDATE_INT ): ''; $this->wpdb->update( GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'account', @@ -108,20 +112,7 @@ case 'submit': $this->wpdb->insert( GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'account', - array( - 'date_created' => date('Y-m-d'), - 'active' => 1, - 'email' => $email, - 'password' => password_hash($password, PASSWORD_DEFAULT), - 'fname' => $fname, - 'lname' => $lname, - 'addr1' => $addr1, - 'addr2' => $addr2, - 'city' => $city, - 'state' => $state, - 'zip' => $zip, - 'country' => $country, - ), + $accountData, '%s' ); $accountId = $this->wpdb->insert_id; diff --git a/views/front/registrations/register.html b/views/front/registrations/register.html index 8833dd4..9adaf07 100644 --- a/views/front/registrations/register.html +++ b/views/front/registrations/register.html @@ -63,7 +63,7 @@