-2

Hi All,
Good Morning.
I'm new to php environment. When you are in internet explorer and you register, if you choose a different address to send the commission checks to, it always says "Choose a state" even though you chose one already.
Here is the code.

<?php

session_start();

include_once( "common.php" );

$sid = session_id();

//session_destroy();

//unset($_SESSION[id]);

$_SESSION[status] = 'Not Logged On';


//sessionTime();



#foreach( $_POST as $k=>$v ) { echo " $k=$v <br>"; } exit;



if(isset( $_SESSION[status]))

   {

   if( $_SESSION[status] != 'Logged On' )

      {

      $_SESSION[status] = "Not Logged On "; 

      }

   }

else 

   {

   $_SESSION[status] = "Logged On";

   }



$dup;



$company_name = trim($_POST[company_name]);

$user_name = trim($_POST[user_name]);

$first_name = trim($_POST[first_name]);

$last_name = trim($_POST[last_name]);

$address = trim($_POST[address]);

$city = trim($_POST[city]);

$state = trim($_POST[state]);

$zip = trim($_POST[zip]);

$email = trim($_POST[email]);

$phone1 = trim($_POST[phone1]);

$phone2 = trim($_POST[phone2]);

$tidssn = trim($_POST[tidssn]);

$password = trim($_POST[password]);

$repassword = trim($_POST[repassword]);

$commission_payable_to = trim($_POST[commission_payable_to]);

$commission_address = trim($_POST[commission_address]);

$commission_city = trim($_POST[commission_city]);

$commission_state = trim($_POST[commission_state]);

$commission_zip = trim($_POST[commission_zip]);

$terms_of_service = trim($_POST[terms_of_service]);



if( $_SERVER[HTTP_HOST] == 'alldebtsgone.com' )

   {

   esc_meta($company_name);

   esc_meta($user_name);

   esc_meta($first_name);

   esc_meta($last_name);

   esc_meta($address);

   esc_meta($city);

   esc_meta($state);

   esc_meta($zip);

   esc_meta($email);

   esc_meta($phone1);

   esc_meta($phone2);

   esc_meta($tidssn);

   esc_meta($password);

   esc_meta($repassword);

   esc_meta($commission_payable_to);

   esc_meta($commission_address);

   esc_meta($commission_city);

   esc_meta($commission_state);

   esc_meta($commission_zip);

   }



   ### Actually the next line should never be true because


if( $_SESSION[status] != 'Logged On' )

   {

   #echo "User Name and Password not set<br>";

   # If no user_name or password then no need to do php database stuff.

   # Just pull up page and keep prev-values



   if( !isset( $_POST[user_name] ) ||  ( !isset( $_POST[password]  ) ) )

      {

      }

   else

      {

         // get seq number to update both affiliate and pwd tables

      $sql = "SELECT nextval ('affiliate_id_seq')";

      $result = pg_query($dbh, $sql);

      if( !$result )

         {

         die("Error in SQL query: Could not select next affiliate_id_seq from db " . pg_last_error());

         }

      else

         {

         $affiliate_id_seq = pg_fetch_array($result); 

         $sql = "SELECT id, password FROM pwd WHERE user_name = '$user_name'";

         $result = pg_query($dbh, $sql);

         $tuples = pg_num_rows($result);

         if( $tuples == 0 )

            { 

            $sql = "INSERT INTO pwd ( id, user_name, password ) VALUES ( $affiliate_id_seq[0], '$user_name','$password')";

            $result = pg_query($dbh, $sql);

            if (!$result) 

               { die("Error in SQL query: Could not INSERT into pwd " . pg_last_error()); }

            }

         else if($tuples!=0)

            {

            $db_err_msg = "User name $user_name has already been taken. Please choose another.";

            }



         if(!isset($_POST['terms_of_service']) )

            { 

               // terms_of_service is not set 

            $sql = "DELETE FROM pwd WHERE id = $affiliate_id_seq[0]";

            $result = pg_query($dbh, $sql);

            $db_err_msg = "Please accept Terms and conditions.";

            $tuples = 1;

            }



         $sql = "SELECT id FROM affiliate WHERE user_name = '$user_name' OR company_name = '$company_name'";

         $result = pg_query($dbh, $sql);

         $tuples1 = pg_num_rows($result);



        if($tuples==0)

        {

             if( $tuples1 == 0 )

                {

                $terms_of_service = 'y'; 

                $remote_addr = getenv('REMOTE_ADDR');

                $sql = "INSERT INTO affiliate ( 

                   id,

                   company_name,

                   first_name,

                   last_name,

                   address,

                   city,

                   state,

                   zip,

                   email,

                   phone1,

                   phone2,

                   tidssn,

                   password,

                   user_name,

                   commission_payable_to,

                   commission_address,

                   commission_city,

                   commission_state,

                   commission_zip,

                   ip_address,

                   terms_of_service ) 

                VALUES ( 

                   $affiliate_id_seq[0],

                   '$company_name',

                   '$first_name',

                   '$last_name',

                   '$address',

                   '$city',

                   '$state',

                   '$zip',

                   '$email',

                   '$phone1',

                   '$phone2',

                   '$tidssn',

                   '$password',

                   '$user_name',

                   '$commission_payable_to',

                   '$commission_address',

                   '$commission_city',

                   '$commission_state',

                   '$commission_zip',

                   '$remote_addr',

                   '$terms_of_service' )";

                   //echo $sql;

                $result = pg_query($dbh, $sql);

                if (!$result) 

                   {

                   $db_err_msg = "Unable to INSERT registration information into database.";

                   }

                else

                   {

                   // update sucessful ... add id and user_name to session so register_thank_you.php can get db info

                   // but do not set 'logged in' status

                    $_SESSION[id] = $affiliate_id_seq[0];



                   $_SESSION[user_name] = $user_name;

                   header("Location: register_thank_you.php");

                   }

               }

             else

               {

               $db_err_msg = "either company name or Username already exists";

               }

             }

         }

      } 

   }

else 

   {

   if (! $dbh) 

      {

      echo "open db failed";

      exit;

      }



   if( $_POST[submit_registration] == 'Submit' )

      {

      $sql = "UPDATE affiliate SET 

         company_name = '$_POST[company_name]',

         first_name = '$_POST[first_name]',

         last_name = '$_POST[last_name]',

         address = '$_POST[address]',

         city = '$_POST[city]',

         state = '$_POST[state]',

         zip = '$_POST[zip]',

         email = '$_POST[email]',

         phone1 = '$_POST[phone1]',

         phone2 = '$_POST[phone2]',

         tidssn = '$_POST[tidssn]',

         commission_payable_to = '$_POST[commission_payable_to]',

         commission_address = '$_POST[commission_address]', 

         commission_city = '$_POST[commission_city]', 

         commission_state = '$_POST[commission_state]', 

         commission_zip = '$_POST[commission_zip]', 

         terms_of_service = '$_POST[terms_of_service]'

      WHERE id = $_SESSION[id]";

      $result = pg_query($dbh, $sql);

      }

   else

      {

      $sql = "SELECT company_name, first_name, last_name, address, city, state, zip, email, phone1, phone2, tidssn, user_name, commission_payable_to, commission_address, commission_city, commission_state, commission_zip, terms_of_service FROM affiliate WHERE id = '$_SESSION[id]'";

      $result = pg_query($dbh, $sql);

      $rows = pg_fetch_array($result); 



      $company_name=$rows[0];

      $first_name=$rows[1];

      $last_name=$rows[2];

      $address=$rows[3];

      $city=$rows[4];

      $state=$rows[5];

      $zip=$rows[6];

      $email=$rows[7];

      $phone1=$rows[8];

      $phone2=$rows[9];

      $tidssn=$rows[10];

      $user_name=$rows[11];

      $commission_payable_to=$rows[12];

      $commission_address=$rows[13];

      $commission_city=$rows[14];

      $commission_state=$rows[15];

      $commission_zip=$rows[16];

      $terms_of_service=$rows[17];



      #echo "$company_name,  $first_name,  $last_name,  $address,  $city,  $state,  $zip,  $email,  $phone1,  $phone2,  $tidssn,  $user_name,  $commission_payable_to,  $commission_address, $commission_city, $commission_state, $commission_zip, $terms_of_service";

      }

   }

?>



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Consumer Debt Solutions, Inc.</title>

<link href="css/consumer.css" rel="stylesheet" type="text/css" />

<link href="css/cr.css" rel="stylesheet" type="text/css" />

<!-- <link href="css/cr.css" rel="stylesheet" type="text/css" /> -->

<script language="JavaScript" src="js/cr.js" type="text/javascript"></script>

<script language="javascript" src="js/jQuery.js"></script>





<script language="JavaScript" type="text/javascript">

// IMPORTANT:   THIS FUNCTION MUST REMAIN HERE ... DO NOT MOVE TO cr.js

function get_state( )

   {

      // get form object

   var form = document.forms["cs_registration"]

      // get length of state select box

   var len = form.state.length

      // grap state from db

   var db_state = "<?php echo $state?>"

      // loop state select items until db state found 

   for( var x = 0; x < len; x++ )

      {

      if( form.state[x].value == db_state.toUpperCase() )

         {

         // assign active index to select box

         form.state.selectedIndex = x

         }

      }

   }



function get_commission_state( )

   {

      // get form object

   var form = document.forms["cs_registration"]

      // get length of state select box

   var len = form.commission_state.length

      // grap state from db

   var db_state = "<?php echo $state?>"

      // loop state select items until db state found 

   for( var x = 0; x < len; x++ )

      {

      if( form.commission_state[x].value == db_state.toUpperCase() )

         {

         // assign active index to select box

         form.commission_state.selectedIndex = x

         }

      }

   }



</script>



<script language="JavaScript" type="text/javascript">



function copy_address()

   {

   var form = document.forms["cs_registration"]

   if( form.same_address.checked == true )

      {

      form.commission_address.value = form.address.value;

      form.commission_city.value = form.city.value;

      form.commission_state.value = form.state.value;

      form.commission_zip.value = form.zip.value;

      }

   else

      {

      form.commission_address.value = '';

      form.commission_city.value = '';

      form.commission_state.selectedIndex = 0;

      form.commission_zip.value = '';

      }

   }



function submitform()

   {

   var y = validate_login_form(); 

   if( y == true ) 

      {

      document.login_form.submit();

      }

   }



function submit_main_form(form)

   {

   validate_form(form)

   }

</script>







<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

</head>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>Consumer Debt Solutions inc</title>

<style type="text/css">

<!--

body {

    background: #ffffff;

    margin: 0px;

}

-->

</style>



<!--[if IE 7]> 

   <link href="css/menu_ie7.css" rel="stylesheet" type="text/css"> 

<![endif]-->



<!--[if IE 8]> 

   <link href="css/menu_ie8.css" rel="stylesheet" type="text/css" />

<![endif]-->



<!--[if !IE]>--> 



<!--<![endif]-->





<script type="text/javascript">

<!--

function MM_preloadImages() { //v3.0

  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

}



function MM_swapImgRestore() { //v3.0

  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;

}



function MM_findObj(n, d) { //v4.01

  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);

  if(!x && d.getElementById) x=d.getElementById(n); return x;

}



function MM_swapImage() { //v3.0

  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

}

function all_clear(e, flag, default_value){

  if(flag==1){

    if(e.value==default_value){

      e.value="";

    }

  }else{

    if(e.value==""){

      e.value=default_value;

    }

  }

}

//-->

</script>

</head>



<body>

<table width="100%" border="0" cellpadding="0" cellspacing="0">

  <tr>

            <td id="topblue"></td>

        </tr>

  <tr>



    <td align="center" valign="top"><table width="95%" align="center" cellpadding="0" cellspacing="0">

      <tr>

        <td align="center" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">

          <tr>

            <td><table width="100%" border="0">

 <tr>

                        <td><img src="images/consumer1_blue.png"></td>

                        <td>&nbsp;</td>

                        <td align="right">

                            <table>



                                <tr>

                                    <td align="right">

                                    <?php include("headers/loginForm.php"); ?>                                       </td>

                                </tr>

                          </table>                       </td>

                    </tr>

  <tr>

                        <td id="toplinkbg" colspan="3" valign="top">

                            <?php include("headers/top.php"); ?>                     </td>

                    </tr>

 <tr valign="top">

                        <td colspan="3" style="background-image:url(images/consumer1_blue_09.png); height:398px; vertical-align:top;">

                            <table cellpadding="0" cellspacing="0" align="center">

                                <tr>

                                    <td><?php include("headers/header_main.php"); ?></td>

                                </tr>

                          </table>                       </td>

                    </tr>                    

</table></td>

          </tr>

          <tr>

            <td align="center" valign="top" style="background-image:url(images/consumer1_blue_16.png);"><table width="100%" border="0" cellspacing="0" cellpadding="0">

              <tr>

                <td align="center" valign="top" ><table width="100%" border="0" cellspacing="0" cellpadding="0">

                  <tr>

                    <td align="center" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">



                      <tr>

                        <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0" style="background-image:url(images/consumer1_blue_16.png);">

                            <tr>

                              <td ><table width="100%" border="0" style="background-color:#144b8e" cellpadding="3" cellspacing="5">

<form id="cs_registration" name="cs_registration" method="post" onsubmit="return validate_form(this);" action="<?php echo $_SERVER[PHP_SELF] ?>">

  <tr>

    <td colspan="2" align="center"><span class="register_main_content" style="color:#FFFFFF"><strong>Please complete the registration form below. You will receive an automated email containing your Affiliate ID, login name and password. Thank you</strong>.</span></td>

  </tr>

  <tr>

    <td align="right">Company Name</td>

    <td><input name="company_name" type="text" id="company_name" size="30" maxlength="60" tabindex="3" value="<?php echo $company_name ?>" /></td>

  </tr>

  <tr>

    <td align="right">First Name</td>

    <td><input name="first_name" type="text" id="first_name" size="26" maxlength="26" tabindex="4" value="<?php echo $first_name ?>" /></td>

  </tr>

  <tr>

    <td align="right">Last Name</td>

    <td><input name="last_name" type="text" id="last_name" tabindex="5" size="36" maxlength="36" value="<?php echo $last_name ?>" /></td>

  </tr>

  <tr>

    <td align="right">Company Address &nbsp;</td>

    <td><input  type="text" name="address" id="address" style="width:370px; background-color: #e7f7fe;" tabindex="6" size="150" maxlength="150" value="<?php echo $address ?>" /> &nbsp;</td>

  </tr>

  <tr>

    <td align="right">City &nbsp;</td>

    <td><input name="city" type="text" id="city" tabindex="7" size="30" maxlength="50" value="<?php echo $city ?>" /> &nbsp;</td>

  </tr>

  <tr>

    <td align="right">State &nbsp;</td>

    <td>

<select name="state" tabindex="8" style="background-color: #E7F7FE; width: 130px;"> 

   <option value="--- select ---">--- select ---</option>

   <option value="AL">Alabama</option> 

   <option value="AK">Alaska</option> 

   <option value="AZ">Arizona</option> 

   <option value="AR">Arkansas</option> 

   <option value="CA">California</option> 

   <option value="CO">Colorado</option> 

   <option value="CT">Connecticut</option> 

   <option value="DE">Delaware</option> 

   <option value="FL">Florida</option> 

   <option value="GA">Georgia</option> 

   <option value="HI">Hawaii</option> 

   <option value="ID">Idaho</option> 

   <option value="IL">Illinois</option> 

   <option value="IN">Indiana</option> 

   <option value="IA">Iowa</option> 

   <option value="KS">Kansas</option> 

   <option value="KY">Kentucky</option> 

   <option value="LA">Louisiana</option> 

   <option value="ME">Maine</option> 

   <option value="MD">Maryland</option> 

   <option value="MA">Massachusetts</option> 

   <option value="MI">Michigan</option> 

   <option value="MN">Minnesota</option> 

   <option value="MS">Mississippi</option> 

   <option value="MO">Missouri</option> 

   <option value="MT">Montana</option> 

   <option value="NE">Nebraska</option> 

   <option value="NV">Nevada</option> 

   <option value="NH">New Hampshire</option> 

   <option value="NJ">New Jersey</option> 

   <option value="NM">New Mexico</option> 

   <option value="NY">New York</option> 

   <option value="NC">North Carolina</option> 

   <option value="ND">North Dakota</option> 

   <option value="OH">Ohio</option> 

   <option value="OK">Oklahoma</option> 

   <option value="OR">Oregon</option> 

   <option value="PA">Pennsylvania</option> 

   <option value="RI">Rhode Island</option> 

   <option value="SC">South Carolina</option> 

   <option value="SD">South Dakota</option> 

   <option value="TN">Tennessee</option> 

   <option value="TX">Texas</option> 

   <option value="UT">Utah</option> 

   <option value="VT">Vermont</option> 

   <option value="VA">Virginia</option> 

   <option value="WA">Washington</option> 

   <option value="WV">West Virginia</option> 

   <option value="WI">Wisconsin</option> 

   <option value="WY">Wyoming</option> </select> &nbsp;</td>

  </tr>

  <tr>

    <td align="right">Zip &nbsp;</td>

    <td><input name="zip" type="text" id="zip" tabindex="9" size="14" maxlength="14" value="<?php echo $zip ?>" /> &nbsp;</td>

  </tr>

  <tr>

    <td align="right">Email &nbsp;</td>

    <td><input name="email" type="text" id="email" tabindex="10" size="30" maxlength="80" value="<?php echo $email ?>" /> &nbsp;</td>

  </tr>

  <tr>

    <td align="right">Phone 1 &nbsp;</td>

    <td><input name="phone1" type="text" id="phone1" tabindex="11" size="14" maxlength="14" value="<?php echo $phone1 ?>" /> &nbsp;</td>

  </tr>

  <tr>

    <td align="right">Phone 2 &nbsp;</td>

    <td><input name="phone2" type="text" id="phone2" tabindex="12" size="14" maxlength="14" value="<?php echo $phone2 ?>" /> &nbsp;</td>

  </tr>

  <tr>

    <td align="right">Tax ID# or SSN &nbsp;</td>

    <td><input name="tidssn" type="text" id="tidssn" tabindex="13" size="18" maxlength="50" value="<?php echo $tidssn ?>" /> &nbsp;</td>

  </tr>

  <tr>

    <td align="right">Commission check payable to&nbsp;</td>

    <td><input name="commission_payable_to" type="text" id="commission_payable_to" tabindex="14" size="30" maxlength="80" value="<?php echo $commission_payable_to ?>" /> &nbsp;</td>

  </tr>

  <tr>

    <td align="right">Address in which to send commission &nbsp;</td>

    <td><input name="commission_address" type="text" id="commission_address" tabindex="15" size="30" maxlength="200" style="width:400px" value="<?php echo $commission_address ?>" /> &nbsp;</td>

  </tr>

  <tr>

    <td align="right">Same address as above &nbsp;</td>

    <td><input type="checkbox" name="same_address" id="same_address" onClick="copy_address(this.form);" />   &nbsp;</td>

  </tr>

  <tr>

    <td align="right">City &nbsp;</td>

    <td><input name="commission_city" type="text" id="commission_city" tabindex="16" size="30" maxlength="50" value="<?php echo $commission_city ?>" >&nbsp;</td>

  </tr>

  <tr>

    <td align="right">State &nbsp;</td>

    <td><select name="commission_state" tabindex="17" style="background-color: #E7F7FE; width: 130px;">

          <option value="--- select ---">--- select ---</option>

          <option value="AL">Alabama</option>

          <option value="AK">Alaska</option>

          <option value="AZ">Arizona</option>

          <option value="AR">Arkansas</option>

          <option value="CA">California</option>

          <option value="CO">Colorado</option>

          <option value="CT">Connecticut</option>

          <option value="DE">Delaware</option>

          <option value="FL">Florida</option>

          <option value="GA">Georgia</option>

          <option value="HI">Hawaii</option>

          <option value="ID">Idaho</option>

          <option value="IL">Illinois</option>

          <option value="IN">Indiana</option>

          <option value="IA">Iowa</option>

          <option value="KS">Kansas</option>

          <option value="KY">Kentucky</option>

          <option value="LA">Louisiana</option>

          <option value="ME">Maine</option>

          <option value="MD">Maryland</option>

          <option value="MA">Massachusetts</option>

          <option value="MI">Michigan</option>

          <option value="MN">Minnesota</option>

          <option value="MS">Mississippi</option>

          <option value="MO">Missouri</option>

          <option value="MT">Montana</option>

          <option value="NE">Nebraska</option>

          <option value="NV">Nevada</option>

          <option value="NH">New Hampshire</option>

          <option value="NJ">New Jersey</option>

          <option value="NM">New Mexico</option>

          <option value="NY">New York</option>

          <option value="NC">North Carolina</option>

          <option value="ND">North Dakota</option>

          <option value="OH">Ohio</option>

          <option value="OK">Oklahoma</option>

          <option value="OR">Oregon</option>

          <option value="PA">Pennsylvania</option>

          <option value="RI">Rhode Island</option>

          <option value="SC">South Carolina</option>

          <option value="SD">South Dakota</option>

          <option value="TN">Tennessee</option>

          <option value="TX">Texas</option>

          <option value="UT">Utah</option>

          <option value="VT">Vermont</option>

          <option value="VA">Virginia</option>

          <option value="WA">Washington</option>

          <option value="WV">West Virginia</option>

          <option value="WI">Wisconsin</option>

          <option value="WY">Wyoming</option>

        </select> &nbsp;</td>

  </tr>

  <tr>

    <td align="right">Zip &nbsp;</td>

    <td><input name="commission_zip" type="text" id="zip2" tabindex="18" size="14" maxlength="14" value="<?php echo $commission_zip ?>" /> &nbsp;</td>

  </tr>

  <tr>

    <td align="right">User Name</td>

    <td><input name="user_name" type="text" id="user_name" tabindex="19" size="8" maxlength="8" value="<?php echo $user_name?>" /></td>

  </tr>

  <tr>

    <td align="right">Password &nbsp;</td>

    <td><input name="password" type="password" id="password" tabindex="20" size="8" maxlength="8" value="<?php echo $password ?>" /> &nbsp;</td>

  </tr>

  <tr>

    <td align="right">Re-Enter Password &nbsp;</td>

    <td><input name="repassword" type="password" id="repassword" tabindex="21" size="8" maxlength="8" value="<?php echo $repassword ?>" /> &nbsp;</td>

  </tr>

  <tr>

    <td align="right">I have read and agree with the <a href="terms_of_service.php" target="_BLANK" style="color:#FFFF00">Terms of Service</a>&nbsp;</td>

    <td> <input name="terms_of_service" type="checkbox" id="terms_of_service" tabindex="22" <?php if( $terms_of_service == 'y' ){ echo "checked"; } ?> value="y" />&nbsp;</td>

  </tr>

  <tr>

    <td colspan="2" style="padding-left:485px;"><input type="submit" name="submit_registration" id="submit_registration" class="submit_registration" value="Submit" tabindex="23" />&nbsp;&nbsp;&nbsp;

  <?php

         if( $_SESSION[status] != 'Logged On' )

            {

            echo "<a href=\"javascript:document.forms[1].reset()\" style='color:#FFFF00'>RESET</a>";

            }

      ?></td>

    </tr>

  <tr>

    <td align="right">&nbsp;</td>

    <td>&nbsp;</td>

  </tr>

  </form>

</table>



                                 </td>

                            </tr>

                            <tr>

                              <td align="left" valign="top" class="content"> <p>&nbsp;</p></td>

                            </tr>



                            <tr>

            <td >

                <?php include("headers/bottom.php"); ?>          </td>

        </tr>

                        </table></td>

                      </tr>

                    </table></td>

                  </tr>

                  <tr>

                    <td height="1" align="center" valign="top" bgcolor="#12498A"></td>

                  </tr>

                </table></td>

              </tr>

            </table></td>

          </tr>



          <tr>

            <td align="center" valign="top"><img src="images/footer.jpg" width="999" height="40" /></td>

          </tr>

        </table></td>

      </tr>

    </table></td>

  </tr>

</table>



<!-- Wait until page is loaded before calling get_state java function -->

<script language="JavaScript" type="text/javascript">

    void get_state(this)

</script>



<!-- Wait until page is loaded before calling get_state java function -->

<script language="JavaScript" type="text/javascript">

    void get_commission_state(this)

</script>



<!--

  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

-->



<div id='V_ERR' class="error_msg" >

        <div id="v_err_msg">

    V_ERR_MSG        </div>

    <br />



   <div style='text-align: right;'>

      <a onmouseover='this.style.cursor=&quot;pointer&quot; ' style='font-size: 12px;' onfocus='this.blur();' onclick="document.getElementById('V_ERR').style.display = 'none' " ><span style="text-decoration: underline;">Close</span></a>   </div>

</div>

<!--

  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

-->

<!--

  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

-->



<div id='P_ERR' class="error_msg" >

        <div id="p_err_msg">

    P_ERR_MSG        </div>

    <br />



   <div style='text-align: right;'>

      <a onmouseover='this.style.cursor=&quot;pointer&quot; ' style='font-size: 12px;' onfocus='this.blur();' onclick="document.getElementById('P_ERR').style.display = 'none' " ><span style="text-decoration: underline;">Close</span></a>   </div>

</div>

<!--

  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

-->



<?php

if( $db_err_msg )

   {

   echo "

      <script language=\"JavaScript\">

      document.getElementById('v_err_msg').innerHTML = '$db_err_msg' 

      document.getElementById('V_ERR').style.display = 'block'

      var sw = screen.width

      var sh = screen.height

      var style_top = screen.height*75;



      document.getElementById('V_ERR').style.left = (sw * .25) + 'px'

      document.getElementById('V_ERR').style.top = (sh * .25) + 'px'

      </script>

   ";

   }

?>



</body>

</html>

When we click on check box the city, state, zip are copied from the above to the below. when we click on submit button the second state of dropdown asking to select the state.
Please help me. I was tried for last few days. I didn't get it. Thanks in advance

Edited by mike_2000_17: Fixed formatting

Votes + Comments
read the instructios [code] tags
2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by chrishea
1

Good luck getting an answer!
First: You have dumped a large amount of code into your post without code tags so that makes it difficult for anyone to make sense of the code.
Second: Debugging is part of programming. You give no indication as to what you have already done to try to isolate the problem or where in your code the pertinent code is to choose the state or set the value.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.