InteractiveMechanics / sda

Website redesign for the Surface Design Association
Other
0 stars 0 forks source link

membership directory search: user gets a 404 after clicking submit #4

Closed cahdeemer closed 8 years ago

cahdeemer commented 8 years ago

user gets a 404 page after clicking submit

`<?php /**

get_header(); ?>

<?php require_once('neon.php');

$neon = new Neon();

$keys = array(
  'orgId'=>'surfacedesign', 
  'apiKey'=>'494f48e09c0f7818cc1511b7cefdf813'
  ); 
$neon->login($keys);

$search = array( 
  'method' => 'account/listAccounts',
  'criteria' => array(
      array('Account Type', 'EQUAL', 'Individual'),
      array('Most Recent Membership Only', 'EQUAL', 'Yes'),
      array('Membership', 'EQUAL', 'Member'),
      array('Membership Status', 'EQUAL', 'SUCCEED'),
      array('First Name', 'NOT_BLANK'),
      array('Last Name', 'NOT_BLANK'),      
  ),
  'columns' => array(
    'standardFields' => array('First Name', 'Last Name', 'City', 'State', 'Province', 'Country', 'Email 1', 'URL', 'Twitter Page', 'Facebook Page')
  ),
  'page' => array(
    'currentPage' => 1,
    'pageSize' => 20,
    'sortColumn' => 'Last Name',
    'sortDirection' => 'ASC',
  ),

); // $result = $neon->search($search);

$arguments = array( 'lastName' => FILTER_SANITIZE_SPECIAL_CHARS, 'city' => FILTER_SANITIZE_SPECIAL_CHARS, 'state' => FILTER_SANITIZE_SPECIAL_CHARS, 'country' => FILTER_SANITIZE_SPECIAL_CHARS,

); $searchCriteria = filter_input_array( INPUT_POST, $arguments );

if ( isset( $loginResult['operationResult'] ) && $loginResult['operationResult'] == 'SUCCESS' ) {

$userSearch = array( 
    'method' => 'account/listAccounts', 
    'columns' => array(
        'standardFields' => array('First Name', 'Last Name', 'City', 'State', 'Province', 'Country', 'Email 1', 'URL', 'Twitter Page', 'Facebook Page')
    ),
    'page' => array(
        'currentPage' => 1,
        'pageSize' => 20,
        'sortColumn' => 'Last Name',
        'sortDirection' => 'ASC',
    ),
);

}

if ( isset( $searchCriteria['lastName'] ) && !empty( $searchCriteria['lastName'] ) ) { $userSearch['criteria'][] = array( 'Last Name', 'EQUAL', $searchCriteria['lastName'] ); } if ( isset( $searchCriteria['city'] ) && !empty( $searchCriteria['city'] ) ) { $userSearch['criteria'][] = array( 'City', 'EQUAL', $searchCriteria['city'] ); } if ( isset( $searchCriteria['state'] ) && !empty( $searchCriteria['state'] ) ) { $userSearch['criteria'][] = array( 'State', 'EQUAL', $searchCriteria['state'] ); } if ( isset( $searchCriteria['country'] ) && !empty( $searchCriteria['country'] ) ) { $userSearch['criteria'][] = array( 'Country', 'EQUAL', $searchCriteria['country'] ); }

if ( !empty( $userSearch['criteria'] ) ) { $result = $neon->search($userSearch); } else { $result = $neon->search($search); }

$neon->go( array( 'method' => 'common/logout' ) );

?>

```

Membership Directory

```
```
Name Location Media Contact
```

<?php get_footer(); ?>`

mtedeschi commented 8 years ago

Resolved this issue—self submitting the form by removing action=""