Jump to content

Archived

This topic is now archived and is closed to further replies.

fazzfarrell

PHP new sessions

Recommended Posts

I have a problem with my sessions

SESSION CODE
<?php
session_start();
$postConn = $HTTP_POST_VARS['DelCon'];
$_SESSION["postConn"] = $postConn;

$curNcy = $HTTP_POST_VARS['curEncy'];
$_SESSION["curNcy"] = $curNcy;
?>


These get there values from two different forms on the same page (below) problem is when you make the first selection it works, make the next selection on the next menu and that then works but destroys the other session?

<form id="frmCurr" name="frmCurr" method="post">
                    <select name="curEncy" id="curEncy" onChange="document.frmCurr.submit();">
                      <option Selected="True"><?php echo $_SESSION['curNcy']; ?></option>
                      <option value="British Pounds">British Pounds</option>
  <option value="American Dollars">American Dollars</option>
  <option value="Euros">Euros</option>
                      </select>
                                                      </form>                  </td>
                </tr>
                <tr>
                  <td align="left" valign="middle" class="FormIntroText">Country </td>
                  <td align="left" valign="middle" class="FormIntroText"><form id="frmBasket" name="frmBasket" method="post">
                    <select name="DelCon" id="DelCon" onChange="document.DelCon.submit();">
                      <option Selected="True"><?php echo $_SESSION['postConn']; ?></option>
                      <option value="UK">UK</option>
  <option value="AGUILLA">AGUILLA</option>
  <option value="ALBANIA">ALBANIA</option> Etc Etc

Share this post


Link to post
Share on other sites
You've cut off the form in the middle -- to truely help we need to see the full thing.. also wrap it in [*code] [*/code] tags minus the * to make it easier to read.

Share this post


Link to post
Share on other sites
ok here goes

[CODE]<?php
session_start();
$postConn = $HTTP_POST_VARS['DelCon'];
$_SESSION["postConn"] = $postConn;
session_register("postConn");

$curNcy = $HTTP_POST_VARS['curEncy'];
$_SESSION["curNcy"] = $curNcy;
session_register("curNcy");
?> [/CODE]

THE FORM
[CODE]
<form id="frmCurr" name="frmCurr" method="post">
                    <select name="curEncy" id="curEncy" onChange="document.frmCurr.submit();">
                      <option Selected="True"><?php echo $_SESSION['curNcy']; ?></option>
                      <option value="British Pounds">British Pounds</option>
  <option value="American Dollars">American Dollars</option>
  <option value="Euros">Euros</option>
                      </select>
                                                      </form>                  </td>
                </tr>
                <tr>
                  <td align="left" valign="middle" class="FormIntroText">Country </td>
                  <td align="left" valign="middle" class="FormIntroText"><form id="frmBasket" name="frmBasket" method="post">
                    <select name="DelCon" id="DelCon" onChange="document.frmBasket.submit();">
                      <option Selected="True"><?php echo $_SESSION['postConn']; ?></option>
                      <option value="UK">UK</option>
  <option value="AGUILLA">AGUILLA</option>
  <option value="ALBANIA">ALBANIA</option>
  <option value="ALGERIA">ALGERIA</option>
  <option value="ANDORRA">ANDORRA</option>
  <option value="ANGOLA">ANGOLA</option>
  <option value="ANTIGUABARBUDA">ANTIGUABARBUDA</option>
  <option value="ARGENTINA">ARGENTINA</option>
  <option value="ARMENIA">ARMENIA</option>
  <option value="ARUBA">ARUBA</option>
  <option value="AUSTRALIA">AUSTRALIA</option>
  <option value="AUSTRIA">AUSTRIA</option>
  <option value="AZERBAIJAN">AZERBAIJAN</option>
  <option value="BAHAMAS">BAHAMAS</option>
  <option value="BAHRAIN">BAHRAIN</option>
  <option value="BANGLADESH">BANGLADESH</option>
  <option value="BARBADOS">BARBADOS</option>
  <option value="BELARUS">BELARUS</option>
  <option value="BELGIUM">BELGIUM</option>
  <option value="BELIZE">BELIZE</option>
  <option value="BENIN">BENIN</option>
  <option value="BERMUDA">BERMUDA</option>
  <option value="BOLIVIA">BOLIVIA</option>
  <option value="BOSNIA"> BOSNIA </option>
  <option value="BOTSWANA">BOTSWANA</option>
  <option value="BRAZIL">BRAZIL</option>
  <option value="BRUNEI">BRUNEI</option>
  <option value="BULGARIA">BULGARIA</option>
  <option value="BURKINA FASO">BURKINA FASO</option>
  <option value="BURUNDI">BURUNDI</option>
  <option value="CAMBODIA">CAMBODIA</option>
  <option value="CAMEROON">CAMEROON</option>
  <option value="CANADA">CANADA</option>
  <option value="CAPE CP VERDE">CAPE CP VERDE</option>
  <option value="CAYMAN ISLANDS">CAYMAN ISLANDS</option>
  <option value="CENTRAL AF REP">CENTRAL AF REP</option>
  <option value="CHAD">CHAD</option>
  <option value="CHANNEL ISLANDS">CHANNEL ISLANDS</option>
  <option value="CHILE">CHILE</option>
  <option value="CHINA BEIJING">CHINA BEIJING</option>
  <option value="CHINA CANTON">CHINA CANTON</option>
  <option value="CHINA SHANGHAI">CHINA SHANGHAI</option>
  <option value="COLUMBIA">COLUMBIA</option>
  <option value="CONGO">CONGO</option>
  <option value="COOK ISLANDS">COOK ISLANDS</option>
  <option value="COSTA RICA">COSTA RICA</option>
  <option value="CROATIA">CROATIA</option>
  <option value="CYPRUS">CYPRUS</option>
  <option value="CZECH REPUBLIC">CZECH REPUBLIC</option>
  <option value="DENMARK">DENMARK</option>
  <option value="DJIBOUTI">DJIBOUTI</option>
  <option value="DOMINICA">DOMINICA</option>
  <option value="DOMINICAN REP">DOMINICAN REP</option>
  <option value="ECUADOR">ECUADOR</option>
  <option value="EGYPT">EGYPT</option>
  <option value="EL SALVADOR">EL SALVADOR</option>
  <option value="EQUATORIAL GUINE">EQUATORIAL GUINE</option>
  <option value="ERITREA">ERITREA</option>
  <option value="ETHIOPIA">ETHIOPIA</option>
  <option value="FAEROE ISLANDS">FAEROE ISLANDS</option>
  <option value="FIJI ISLANDS">FIJI ISLANDS</option>
  <option value="FINLAND">FINLAND</option>
  <option value="FR POLY-TAHITI">FR POLY-TAHITI</option>
  <option value="FRANCE">FRANCE</option>
  <option value="FRENCH GUIANA"> FRENCH GUIANA</option>
  <option value="GABON">GABON</option>
  <option value="GEORGIA">GEORGIA</option>
  <option value="GERMANY">GERMANY</option>
  <option value="GHANA">GHANA</option>
  <option value="GIBRALTER">GIBRALTER</option>
  <option value="GREECE">GREECE</option>
  <option value="GREENLAND">GREENLAND</option>
  <option value="GRENADA">GRENADA</option>
  <option value="GUADELOUPE">GUADELOUPE</option>
  <option value="GUAM">GUAM</option>
  <option value="GUATEMALA">GUATEMALA</option>
  <option value="GUINEA">GUINEA</option>
  <option value="GUINEA BISSAU">GUINEA BISSAU</option>
  <option value="GUYANA">GUYANA</option>
  <option value="HAITI">HAITI</option>
  <option value="HONDURAS">HONDURAS</option>
  <option value="HONG KONG">HONG KONG</option>
  <option value="HUNGARY">HUNGARY</option>
  <option value="ICELAND">ICELAND</option>
  <option value="INDIA">INDIA</option>
  <option value="INDONESIA">INDONESIA</option>
  <option value="IRELAND REP">IRELAND REP</option>
  <option value="ISRAEL">ISRAEL</option>
  <option value="ITALY">ITALY</option>
  <option value="IVORY COAST">IVORY COAST</option>
  <option value="JAMAICA">JAMAICA</option>
  <option value="JAPAN">JAPAN</option>
  <option value="KAZAKHSTAN">KAZAKHSTAN</option>
  <option value="KENYA">KENYA</option>
  <option value="KIRIBATI">KIRIBATI</option>
  <option value="KRYGZSTAN">KRYGZSTAN</option>
  <option value="KUWAIT">KUWAIT</option>
  <option value="LAOS">LAOS</option>
  <option value="LATVIA">LATVIA</option>
  <option value="LEBANON">LEBANON</option>
  <option value="LESOTHO">LESOTHO</option>
  <option value="LIBERIA">LIBERIA</option>
  <option value="LIBYA">LIBYA</option>
  <option value="LIECHTENSTEIN">LIECHTENSTEIN</option>
  <option value="LITHUANIA">LITHUANIA</option>
  <option value="LUXEMBOURG">LUXEMBOURG</option>
  <option value="MACAU">MACAU</option>
  <option value="MACEDONIA">MACEDONIA</option>
  <option value="MADAGASGAR">MADAGASGAR</option>
  <option value="MALAWI">MALAWI</option>
  <option value="MALAYSIA">MALAYSIA</option>
  <option value="MALDIVES">MALDIVES</option>
  <option value="MALI REPUBLIC">MALI REPUBLIC</option>
  <option value="MALTA">MALTA</option>
  <option value="MARIANA ISLANDS">MARIANA ISLANDS</option>
  <option value="MARSHALL ISLANDS">MARSHALL ISLANDS</option>
  <option value="MARTINIQUE">MARTINIQUE</option>
  <option value="MAURITANIA">MAURITANIA</option>
  <option value="MAURITIUS">MAURITIUS</option>
  <option value="MEXICO">MEXICO</option>
  <option value="MICRONESIA">MICRONESIA</option>
  <option value="MOLDAVIA">MOLDAVIA</option>
  <option value="MONACO">MONACO</option>
  <option value="MONSERRAT">MONSERRAT</option>
  <option value="MOROCCO">MOROCCO</option>
  <option value="MOZAMBIQUE">MOZAMBIQUE</option>
  <option value="NAMIBIA">NAMIBIA</option>
  <option value="NEPAL">NEPAL</option>
  <option value="NETHERLAND ANTIL">NETHERLAND ANTIL</option>
  <option value="NETHERLANDS">NETHERLANDS</option>
  <option value="NEW CALEDONIA">NEW CALEDONIA</option>
  <option value="NEW ZEALAND">NEW ZEALAND</option>
  <option value="NICARAGUA">NICARAGUA</option>
  <option value="NIGER">NIGER</option>
  <option value="NIGERIA">NIGERIA</option>
  <option value="NORWAY">NORWAY</option>
  <option value="OMAN">OMAN</option>
  <option value="PAKISTAN">PAKISTAN</option>
  <option value="PALAU">PALAU</option>
  <option value="PANAMA">PANAMA</option>
  <option value="PAPUA NEW GUINEA">PAPUA NEW GUINEA</option>
  <option value="PARAGUAY">PARAGUAY</option>
  <option value="PERU">PERU</option>
  <option value="PHILIPINES">PHILIPINES</option>
  <option value="POLAND">POLAND</option>
  <option value="PORTUGAL">PORTUGAL</option>
  <option value="PUERTO RICO">PUERTO RICO</option>
  <option value="QATAR">QATAR</option>
  <option value="REUNON ISLAND">REUNON ISLAND</option>
  <option value="ROMANIA">ROMANIA</option>
  <option value="RUSSIA">RUSSIA</option>
  <option value="RWANDA">RWANDA</option>
  <option value="SAMOA-AMERICAN">SAMOA-AMERICAN</option>
  <option value="SAMOA-WESTERN">SAMOA-WESTERN</option>
  <option value="SAUDI ARABIA">SAUDI ARABIA</option>
  <option value="SENEGAL">SENEGAL</option>
  <option value="SEYCHELLES">SEYCHELLES</option>
  <option value="SIERRA LEONE">SIERRA LEONE</option>
  <option value="SINGAPORE">SINGAPORE</option>
  <option value="SLOVAKIA">SLOVAKIA</option>
  <option value="SLOVENIA">SLOVENIA</option>
  <option value="SOLOMAN ISLES">SOLOMAN ISLES</option>
  <option value="SOUTH AFRICA">SOUTH AFRICA</option>
  <option value="SOUTH KOREA">SOUTH KOREA</option>
  <option value="SPAIN">SPAIN</option>
  <option value="SRI LANKA">SRI LANKA</option>
  <option value="ST KITTS">ST KITTS</option>
  <option value="ST LUCIA">ST LUCIA</option>
  <option value="ST VINCENT">ST VINCENT</option>
  <option value="SURINAME">SURINAME</option>
  <option value="SWAZILAND">SWAZILAND</option>
  <option value="SWEDEN">SWEDEN</option>
  <option value="SWITZERLAND">SWITZERLAND</option>
  <option value="SYRIA">SYRIA</option>
  <option value="TAIWAN">TAIWAN</option>
  <option value="TAJKISTAN">TAJKISTAN</option>
  <option value="TANZANIA">TANZANIA</option>
  <option value="THAILAND">THAILAND</option>
  <option value="TOGO">TOGO</option>
  <option value="TONGA">TONGA</option>
  <option value="TRINIDAD&TOBAGO">TRINIDAD & TOBAGO</option>
  <option value="TUNISIA">TUNISIA</option>
  <option value="TURKEY">TURKEY</option>
  <option value="TURKMENISTAN ">TURKMENISTAN</option>
  <option value="TURKS&CAICOS">TURKS & CAICOS</option>
  <option value="TUVALU">TUVALU</option>
  <option value="UAE">UAE</option>
  <option value="UGANDA">UGANDA</option>
  <option value="UKRAINE">UKRAINE</option>
  <option value="URUGUAY">URUGUAY</option>
  <option value="US VIRGIN ISLANDS">US VIRGIN ISLANDS</option>
  <option value="NEW YORK-NEW JERSEY">NEW YORK-NEW JERSEY</option>
  <option value="USA-OTHER CITIES">USA-OTHER CITIES</option>
  <option value="UZBEKISTAN">UZBEKISTAN</option>
  <option value="VANUATU">VANUATU</option>
  <option value="VENEZUELA">VENEZUELA</option>
  <option value="VIETNAM">VIETNAM</option>
  <option value="VIRGIN ISLANDS">VIRGIN ISLANDS</option>
  <option value="WAKE ISLANDS">WAKE ISLANDS</option>
  <option value="WALLIS&FORTUNA">WALLIS & FORTUNA</option>
  <option value="YEMEN">YEMEN</option>
  <option value="YUGOSLAVIA">YUGOSLAVIA</option>
  <option value="ZAMBIA">ZAMBIA</option>
  <option value="ZIMBABWE">ZIMBABWE</option>
                      </select>
                                                      </form> [/CODE]

Share this post


Link to post
Share on other sites
Okay here it is...  What it was is that in your code sine they are two different forms basically each option is refreshed alone...  so what I did was threw in some hidden fields next to them both so that if the other is set it doesnt get erased and gets passed too... 

[code]
<?php
session_start();
$postConn = $HTTP_POST_VARS['DelCon'];
$_SESSION["postConn"] = $postConn;
$curNcy = $HTTP_POST_VARS['curEncy'];
$_SESSION["curNcy"] = $curNcy;
/*
used to view output of $_SESSION
echo "<pre>";
print_r ($_SESSION);
echo "</pre>";
*/
?>
<form id="frmCurr" name="frmCurr" method="post">
  <select name="curEncy" id="curEncy" onChange="document.frmCurr.submit();">
    <option Selected="True"><?php echo $_SESSION['curNcy']; ?></option>
    <option value="British Pounds">British Pounds</option>
    <option value="American Dollars">American Dollars</option>
    <option value="Euros">Euros</option>
  </select>
  <input name="DelCon" type="hidden" id="DelCon" value="<?php echo $_SESSION[postConn]; ?>">
</form>                  </td>
                </tr>
                <tr>
                  <td align="left" valign="middle" class="FormIntroText">Country </td>
                  <td align="left" valign="middle" class="FormIntroText"><form id="frmBasket" name="frmBasket" method="post">
                    <select name="DelCon" id="DelCon" onChange="document.frmBasket.submit();">
                      <option Selected="True"><?php echo $_SESSION['postConn']; ?></option>
                      <option value="UK">
  UK
  </option>
  <option value="AGUILLA">AGUILLA</option>
  <option value="ALBANIA">ALBANIA</option>
  <option value="ALGERIA">ALGERIA</option>
  <option value="ANDORRA">ANDORRA</option>
  <option value="ANGOLA">ANGOLA</option>
  <option value="ANTIGUABARBUDA">ANTIGUABARBUDA</option>
  <option value="ARGENTINA">ARGENTINA</option>
  <option value="ARMENIA">ARMENIA</option>
  <option value="ARUBA">ARUBA</option>
  <option value="AUSTRALIA">AUSTRALIA</option>
  <option value="AUSTRIA">AUSTRIA</option>
  <option value="AZERBAIJAN">AZERBAIJAN</option>
  <option value="BAHAMAS">BAHAMAS</option>
  <option value="BAHRAIN">BAHRAIN</option>
  <option value="BANGLADESH">BANGLADESH</option>
  <option value="BARBADOS">BARBADOS</option>
  <option value="BELARUS">BELARUS</option>
  <option value="BELGIUM">BELGIUM</option>
  <option value="BELIZE">BELIZE</option>
  <option value="BENIN">BENIN</option>
  <option value="BERMUDA">BERMUDA</option>
  <option value="BOLIVIA">BOLIVIA</option>
  <option value="BOSNIA"> BOSNIA </option>
  <option value="BOTSWANA">BOTSWANA</option>
  <option value="BRAZIL">BRAZIL</option>
  <option value="BRUNEI">BRUNEI</option>
  <option value="BULGARIA">BULGARIA</option>
  <option value="BURKINA FASO">BURKINA FASO</option>
  <option value="BURUNDI">BURUNDI</option>
  <option value="CAMBODIA">CAMBODIA</option>
  <option value="CAMEROON">CAMEROON</option>
  <option value="CANADA">CANADA</option>
  <option value="CAPE CP VERDE">CAPE CP VERDE</option>
  <option value="CAYMAN ISLANDS">CAYMAN ISLANDS</option>
  <option value="CENTRAL AF REP">CENTRAL AF REP</option>
  <option value="CHAD">CHAD</option>
  <option value="CHANNEL ISLANDS">CHANNEL ISLANDS</option>
  <option value="CHILE">CHILE</option>
  <option value="CHINA BEIJING">CHINA BEIJING</option>
  <option value="CHINA CANTON">CHINA CANTON</option>
  <option value="CHINA SHANGHAI">CHINA SHANGHAI</option>
  <option value="COLUMBIA">COLUMBIA</option>
  <option value="CONGO">CONGO</option>
  <option value="COOK ISLANDS">COOK ISLANDS</option>
  <option value="COSTA RICA">COSTA RICA</option>
  <option value="CROATIA">CROATIA</option>
  <option value="CYPRUS">CYPRUS</option>
  <option value="CZECH REPUBLIC">CZECH REPUBLIC</option>
  <option value="DENMARK">DENMARK</option>
  <option value="DJIBOUTI">DJIBOUTI</option>
  <option value="DOMINICA">DOMINICA</option>
  <option value="DOMINICAN REP">DOMINICAN REP</option>
  <option value="ECUADOR">ECUADOR</option>
  <option value="EGYPT">EGYPT</option>
  <option value="EL SALVADOR">EL SALVADOR</option>
  <option value="EQUATORIAL GUINE">EQUATORIAL GUINE</option>
  <option value="ERITREA">ERITREA</option>
  <option value="ETHIOPIA">ETHIOPIA</option>
  <option value="FAEROE ISLANDS">FAEROE ISLANDS</option>
  <option value="FIJI ISLANDS">FIJI ISLANDS</option>
  <option value="FINLAND">FINLAND</option>
  <option value="FR POLY-TAHITI">FR POLY-TAHITI</option>
  <option value="FRANCE">FRANCE</option>
  <option value="FRENCH GUIANA"> FRENCH GUIANA</option>
  <option value="GABON">GABON</option>
  <option value="GEORGIA">GEORGIA</option>
  <option value="GERMANY">GERMANY</option>
  <option value="GHANA">GHANA</option>
  <option value="GIBRALTER">GIBRALTER</option>
  <option value="GREECE">GREECE</option>
  <option value="GREENLAND">GREENLAND</option>
  <option value="GRENADA">GRENADA</option>
  <option value="GUADELOUPE">GUADELOUPE</option>
  <option value="GUAM">GUAM</option>
  <option value="GUATEMALA">GUATEMALA</option>
  <option value="GUINEA">GUINEA</option>
  <option value="GUINEA BISSAU">GUINEA BISSAU</option>
  <option value="GUYANA">GUYANA</option>
  <option value="HAITI">HAITI</option>
  <option value="HONDURAS">HONDURAS</option>
  <option value="HONG KONG">HONG KONG</option>
  <option value="HUNGARY">HUNGARY</option>
  <option value="ICELAND">ICELAND</option>
  <option value="INDIA">INDIA</option>
  <option value="INDONESIA">INDONESIA</option>
  <option value="IRELAND REP">IRELAND REP</option>
  <option value="ISRAEL">ISRAEL</option>
  <option value="ITALY">ITALY</option>
  <option value="IVORY COAST">IVORY COAST</option>
  <option value="JAMAICA">JAMAICA</option>
  <option value="JAPAN">JAPAN</option>
  <option value="KAZAKHSTAN">KAZAKHSTAN</option>
  <option value="KENYA">KENYA</option>
  <option value="KIRIBATI">KIRIBATI</option>
  <option value="KRYGZSTAN">KRYGZSTAN</option>
  <option value="KUWAIT">KUWAIT</option>
  <option value="LAOS">LAOS</option>
  <option value="LATVIA">LATVIA</option>
  <option value="LEBANON">LEBANON</option>
  <option value="LESOTHO">LESOTHO</option>
  <option value="LIBERIA">LIBERIA</option>
  <option value="LIBYA">LIBYA</option>
  <option value="LIECHTENSTEIN">LIECHTENSTEIN</option>
  <option value="LITHUANIA">LITHUANIA</option>
  <option value="LUXEMBOURG">LUXEMBOURG</option>
  <option value="MACAU">MACAU</option>
  <option value="MACEDONIA">MACEDONIA</option>
  <option value="MADAGASGAR">MADAGASGAR</option>
  <option value="MALAWI">MALAWI</option>
  <option value="MALAYSIA">MALAYSIA</option>
  <option value="MALDIVES">MALDIVES</option>
  <option value="MALI REPUBLIC">MALI REPUBLIC</option>
  <option value="MALTA">MALTA</option>
  <option value="MARIANA ISLANDS">MARIANA ISLANDS</option>
  <option value="MARSHALL ISLANDS">MARSHALL ISLANDS</option>
  <option value="MARTINIQUE">MARTINIQUE</option>
  <option value="MAURITANIA">MAURITANIA</option>
  <option value="MAURITIUS">MAURITIUS</option>
  <option value="MEXICO">MEXICO</option>
  <option value="MICRONESIA">MICRONESIA</option>
  <option value="MOLDAVIA">MOLDAVIA</option>
  <option value="MONACO">MONACO</option>
  <option value="MONSERRAT">MONSERRAT</option>
  <option value="MOROCCO">MOROCCO</option>
  <option value="MOZAMBIQUE">MOZAMBIQUE</option>
  <option value="NAMIBIA">NAMIBIA</option>
  <option value="NEPAL">NEPAL</option>
  <option value="NETHERLAND ANTIL">NETHERLAND ANTIL</option>
  <option value="NETHERLANDS">NETHERLANDS</option>
  <option value="NEW CALEDONIA">NEW CALEDONIA</option>
  <option value="NEW ZEALAND">NEW ZEALAND</option>
  <option value="NICARAGUA">NICARAGUA</option>
  <option value="NIGER">NIGER</option>
  <option value="NIGERIA">NIGERIA</option>
  <option value="NORWAY">NORWAY</option>
  <option value="OMAN">OMAN</option>
  <option value="PAKISTAN">PAKISTAN</option>
  <option value="PALAU">PALAU</option>
  <option value="PANAMA">PANAMA</option>
  <option value="PAPUA NEW GUINEA">PAPUA NEW GUINEA</option>
  <option value="PARAGUAY">PARAGUAY</option>
  <option value="PERU">PERU</option>
  <option value="PHILIPINES">PHILIPINES</option>
  <option value="POLAND">POLAND</option>
  <option value="PORTUGAL">PORTUGAL</option>
  <option value="PUERTO RICO">PUERTO RICO</option>
  <option value="QATAR">QATAR</option>
  <option value="REUNON ISLAND">REUNON ISLAND</option>
  <option value="ROMANIA">ROMANIA</option>
  <option value="RUSSIA">RUSSIA</option>
  <option value="RWANDA">RWANDA</option>
  <option value="SAMOA-AMERICAN">SAMOA-AMERICAN</option>
  <option value="SAMOA-WESTERN">SAMOA-WESTERN</option>
  <option value="SAUDI ARABIA">SAUDI ARABIA</option>
  <option value="SENEGAL">SENEGAL</option>
  <option value="SEYCHELLES">SEYCHELLES</option>
  <option value="SIERRA LEONE">SIERRA LEONE</option>
  <option value="SINGAPORE">SINGAPORE</option>
  <option value="SLOVAKIA">SLOVAKIA</option>
  <option value="SLOVENIA">SLOVENIA</option>
  <option value="SOLOMAN ISLES">SOLOMAN ISLES</option>
  <option value="SOUTH AFRICA">SOUTH AFRICA</option>
  <option value="SOUTH KOREA">SOUTH KOREA</option>
  <option value="SPAIN">SPAIN</option>
  <option value="SRI LANKA">SRI LANKA</option>
  <option value="ST KITTS">ST KITTS</option>
  <option value="ST LUCIA">ST LUCIA</option>
  <option value="ST VINCENT">ST VINCENT</option>
  <option value="SURINAME">SURINAME</option>
  <option value="SWAZILAND">SWAZILAND</option>
  <option value="SWEDEN">SWEDEN</option>
  <option value="SWITZERLAND">SWITZERLAND</option>
  <option value="SYRIA">SYRIA</option>
  <option value="TAIWAN">TAIWAN</option>
  <option value="TAJKISTAN">TAJKISTAN</option>
  <option value="TANZANIA">TANZANIA</option>
  <option value="THAILAND">THAILAND</option>
  <option value="TOGO">TOGO</option>
  <option value="TONGA">TONGA</option>
  <option value="TRINIDAD&TOBAGO">TRINIDAD & TOBAGO</option>
  <option value="TUNISIA">TUNISIA</option>
  <option value="TURKEY">TURKEY</option>
  <option value="TURKMENISTAN ">TURKMENISTAN</option>
  <option value="TURKS&CAICOS">TURKS & CAICOS</option>
  <option value="TUVALU">TUVALU</option>
  <option value="UAE">UAE</option>
  <option value="UGANDA">UGANDA</option>
  <option value="UKRAINE">UKRAINE</option>
  <option value="URUGUAY">URUGUAY</option>
  <option value="US VIRGIN ISLANDS">US VIRGIN ISLANDS</option>
  <option value="NEW YORK-NEW JERSEY">NEW YORK-NEW JERSEY</option>
  <option value="USA-OTHER CITIES">USA-OTHER CITIES</option>
  <option value="UZBEKISTAN">UZBEKISTAN</option>
  <option value="VANUATU">VANUATU</option>
  <option value="VENEZUELA">VENEZUELA</option>
  <option value="VIETNAM">VIETNAM</option>
  <option value="VIRGIN ISLANDS">VIRGIN ISLANDS</option>
  <option value="WAKE ISLANDS">WAKE ISLANDS</option>
  <option value="WALLIS&FORTUNA">WALLIS & FORTUNA</option>
  <option value="YEMEN">YEMEN</option>
  <option value="YUGOSLAVIA">YUGOSLAVIA</option>
  <option value="ZAMBIA">ZAMBIA</option>
  <option value="ZIMBABWE">ZIMBABWE</option>
  </select>
  <input name="curEncy" type="hidden" id="curEncy" value="<?php echo $_SESSION[curNcy]; ?>">
</form>
[/code]

Share this post


Link to post
Share on other sites
You should just make a simple check if the field is not empty, and that should work fine, because the you set to the session variable an empty value:

[code]<?
session_start();
$postConn = $HTTP_POST_VARS['DelCon'];
if ($postConn != '')
$_SESSION["postConn"] = $postConn;

$curNcy = $HTTP_POST_VARS['curEncy'];
if ($curNcy != '')
$_SESSION["curNcy"] = $curNcy;
?>[/code]

Share this post


Link to post
Share on other sites
Yeah that would probably work too -- but I like hard and complex...  tis why i'm building my site with 0 pieces of pre-written code.. yay woohoo go me..

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.