Results 1 to 1 of 1
  1. #1
    Join Date
    Apr 2011
    Location
    Espoo, Finland
    Posts
    49
    Plugin Contributions
    0

    Default Undefined variable $country in /includes/modules/create_account.php

    Good day,

    Sorry (if I do understand sometyhng wrong or issue has been already described), but the following code in create_account.php module can cause "Undefined variable" warning:

    Code:
    /**
     * Process form contents
     */
    if (isset($_POST['action']) && ($_POST['action'] == 'process') && !isset($login_page)) {
    ...
        $country = zen_db_prepare_input($_POST['zone_country_id']);
    ...
    }
    
    /*
     * Set flags for template use:
     */
    $selected_country = (isset($_POST['zone_country_id']) && $_POST['zone_country_id'] != '') ?  $country : SHOW_CREATE_ACCOUNT_DEFAULT_COUNTRY;
    ...
    My homble suggestion (line 401):

    Code:
    $selected_country = !empty($_POST['zone_country_id']) ? zen_db_prepare_input($_POST['zone_country_id']) : SHOW_CREATE_ACCOUNT_DEFAULT_COUNTRY;
    Last edited by yesaul; 9 Dec 2023 at 04:22 PM.

 

 

Similar Threads

  1. v158 PHP Warning: Undefined variable
    By rattell in forum General Questions
    Replies: 7
    Last Post: 23 Apr 2024, 09:07 PM
  2. v158 PHP Warning: Undefined variable
    By strelitzia in forum Bug Reports
    Replies: 19
    Last Post: 9 Jun 2023, 10:20 AM
  3. v157 Undefined variable $country
    By wsworx in forum General Questions
    Replies: 1
    Last Post: 29 Jun 2022, 03:23 AM
  4. v157 PHP Warning: Undefined variable $show_top_submit_button
    By wsworx in forum General Questions
    Replies: 3
    Last Post: 27 Jun 2022, 11:17 AM
  5. Replies: 0
    Last Post: 4 Jan 2007, 10:17 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR