Switching between WIFI settings for wiserver

I have a project that uses a WIFI shield to connect. The sketch runs the wiserver script. I need to be able to switch between locations and therefore WIFI settings. currently I have 3 blocks of settings and just comment out as required. Is there a was to have this configuration change made via an input, the WIFI settings seem to need to be before the void setup so I'm a bit lost as to how I can do this.

Is there a was to have this configuration change made via an input

Depends on what you need to configure. Usually, yes.

the WIFI settings seem to need to be before the void setup

Only because it is usually easier, though by no means better, to use global variables, declared and initialized with one statement.

so I'm a bit lost as to how I can do this.

Without knowing what you want to change/select, based on what kind of input, so am I.

Fair point. Here is the top of my sketch, I haven't set an input yet but I'm thinking some simple HIGH / LOW switching. As you can see I need to switch IPs, network name, security type and password. I've assumed it will be easier to jst select the entire configuration block. Hope this clarifies. Sorry about the all too short request in the first instance.

      #include <WiServer.h>

      
      #define WIRELESS_MODE_INFRA	1
      #define WIRELESS_MODE_ADHOC	2
      
      /////////////////////////////////////////////////////* WORK Wireless configuration parameters ////////////////////////////////////////
      
     /*
       unsigned char local_ip[] = {192,168,1,210};	// IP address of WiShield
      unsigned char gateway_ip[] = {192,168,1,254};	// router or gateway IP address
      unsigned char subnet_mask[] = {255,255,255,0};	// subnet mask for the local network
      const prog_char ssid[] PROGMEM = {"BG"};		// max 32 bytes
      
      unsigned char security_type = 2;	// 0 - open; 1 - WEP; 2 - WPA; 3 - WPA2
      
      // WPA/WPA2 passphrase
      const prog_char security_passphrase[] PROGMEM = {"passwordhere"};	// max 64 characters
        
        
        */
   
      
      
     ///////////////////////////////////////////////////// HOME Wireless configuration parameters ////////////////////////////////////////
      
      
         
  
      unsigned char local_ip[] = {192,168,0,101};	// IP address of WiShield
      unsigned char gateway_ip[] = {192,168,0,1};	// router or gateway IP address
      unsigned char subnet_mask[] = {255,255,255,0};	// subnet mask for the local network
      const prog_char ssid[] PROGMEM = {"BP1"};		// max 32 bytes
      
      unsigned char security_type = 3;	// 0 - open; 1 - WEP; 2 - WPA; 3 - WPA2
      
      // WPA/WPA2 passphrase
      const prog_char security_passphrase[] PROGMEM = {"passwordhere"};	// max 64 characters
      
      
        
     ///////////////////////////////////////////////////// PORTABLE Wireless configuration parameters ////////////////////////////////////////
      
      
    /*
     
  
      unsigned char local_ip[] = {192,168,1,99};	// IP address of WiShield
      unsigned char gateway_ip[] = {192,168,1,1};	// router or gateway IP address
      unsigned char subnet_mask[] = {255,255,255,0};	// subnet mask for the local network
      const prog_char ssid[] PROGMEM = {"cisco"};		// max 32 bytes
      
      unsigned char security_type = 3;	// 0 - open; 1 - WEP; 2 - WPA; 3 - WPA2
      
      // WPA/WPA2 passphrase
      const prog_char security_passphrase[] PROGMEM = {"passwordhere"};	// max 64 characters
    
      */
      
     
      ////////////////////////////////////////////////////// no need to edit below ////////////////////////////////////////
      
      // WEP 128-bit keys
      // sample HEX keys
        prog_uchar wep_keys[] PROGMEM = { 
        0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d,	// Key 0
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,	// Key 1
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,	// Key 2
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00	// Key 3
      };
      
      // setup the wireless mode
       unsigned char wireless_mode = WIRELESS_MODE_INFRA;
      unsigned char ssid_len;
      unsigned char security_passphrase_len;
     
      
      // End of wireless configuration parameters ----------------------------------------

You are declaring and initializing variables using one statement. What you need to do is declare, but not explicitly initialize the variables, local_ip, etc.

Then, in loop(), determine what the set of values ought to be, and assign the values to the variables. The read only security_passphrase will take special care. You'll probably have to have several variables with different values (and names) and assign security_passphrase to point to one of the hardcoded values.