Hi,
ich poste euch erstmal ein bissel quelltext und dann meine Fragen und Anliegen.
Code:
<script type="text/javascript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
-->
</script>
<?
function save($country){
$connect = odbc_connect('XXX','XXX','XXX') or die("fehler");
$settings = "SELECT * FROM settings";
$wmarerror = ("UPDATE Settings Set TAGVALUE = '$country' WHERE Tag = 'Country'");
$eintragen = odbc_exec($connect,$wmarerror);
odbc_close($connect);
}
$newcountry=$_GET['c'];
if (isset($newcountry)){
save($newcountry);
}
echo "<td><select name='country' onChange=\"MM_jumpMenu('parent',this,0)\">";
echo "<option value='odbc.php?s=plrec&c=$country' selected>$country</option>";
echo "<option value='odbc.php?s=plrec'>--</option>";
echo "<option value='odbc.php?s=plrec&c=Germany'>Germany</option>";
echo "<option value='odbc.php?s=plrec&c=Poland'>Poland</option>";
echo "<option value='odbc.php?s=plrec&c=Austria'>Austria</option>";
echo "<option value='odbc.php?s=plrec&c=Switzerland'>Switzerland</option>";
echo "</select></td></tr>";
Das währe erstmal der text. Wenn man ein Land aus der Listbox auswählt wird die seite refresht und der url wird das ausgewählte Land angehängt. Das Problem ist, er fügt das Land zwar immer in die URL ein, er kann es auch jedes mal auslesen nur er scheint nicht richtig zu refreschen. Damit die variable in die odbc Datenbank eingetragen wird muss ich 2 mal das selbe land auswählebn erst dann ist das speichern geglückt.
Was mache ich falsch wo liegt der fehler?!
MFG Ich hoffe ihr könnt mir helfen.