Hallo zusammen.
Also, ich rufe ein Formular auf, dem ich auch gleich 2 Parameter mitgebe, damit 2 Drop Downs bereits vorselectiert sind. Wähle ich nun in einem dieser DropDowns einen anderen Wert und schicke das Formular ab, werden die alten Werte übergeben, die die ich ganz zu beginn an die Seite übergeben habe. Woran liegt das? Was mach ich falsch?
Das Formular wird mit PHP_SELF an sich selbst geschickt und dann die Werte überprüft....
Gruß
pepenipf
Hallo zusammen.
Also den ganzen Code kann und darf ich nicht posten, aber cih versuche mal die entsprechenden Stellen zu posten ohne was auszulassen...
Seitenafnag:
<?PHP
function checkFields() {
global $mode;
global $name, $sex, $firstname, $lastname, $country, $interest, $product, $email, $data;
print $interest (zum Testen was in Interest steht)
.....
(Überprüfung der Variablen)
}
if (!isset($druck)) $druck=0;
if ($druck != 1 && checkFields()) {
if (!isset($subject)) {
$subject = "message generated by contact script on $SERVER_NAME";
}
.....
(Senden einer mail)
} elseif ($REQUEST_METHOD == "POST") {
?>
<!--
<p class="content">Fill out the remaining fields and try it once again.</p>
-->
<p class="content"><font color="#ff0000">Please fill out the remaining fields and send the form once again:</font></p>
<?PHP
} else {
?>
<?PHP
}
if (!isset($mailsent)) {
?>
<form method="post" action="<?PHP echo $PHP_SELF;?>">
<input type="hidden" name="subject" value="<?PHP
if (isset($subject) && $subject!="") {
echo $subject;
} else {
echo "....";
}
?>">
<table width="545" border="0" cellspacing="3" cellpadding="0">
......
<tr>
<td<?PHP if (($REQUEST_METHOD == "POST") && ($interest == "")) {echo ' BGCOLOR="#ff0000"';}?> class="content" valign="top">At first, we kindly want to ask you to inform us about your area of interest:</td>
<td<?PHP if (($REQUEST_METHOD == "POST") && ($interest == "")) {echo ' BGCOLOR="#ff0000"';}?> valign="top"><select name="interest">
<option <?PHP if (isset($interest) && $interest == '') echo 'selected'; ?> value="">Please select...............................................</option>
<option value="Product Information"<?PHP if (isset($interest) && $interest == 'product_information') echo 'selected'; ?>>Product Information</option>
<option value="Webmaster"<?PHP if (isset($interest) && $interest == 'webmaster') echo 'selected'; ?>>Webmaster</option>
<option value="Other Request"<?PHP if (isset($interest) && $interest == 'other_request') echo 'selected'; ?>>Other Request</option></select></td>
</tr>
........
rest des Formulares
Dieses Formular ist in einer HTML Seite includiert, die einen HTML Ramen schafft und die Navigation beinhaltet.....
<tr>
<td> </td>
<td width="100%" class="content"><?php include("contactform.php3"); ?></td>
<td> </td>
</tr>
Diese Seite wird mit folgendem Link aufgerufen (gibt es auch noch mt anderem Parameter):
<a href="/content/contact/contact.php3?interest=product_information">Product Information</a></td>
Seitenafnag:
<?PHP
function checkFields() {
global $mode;
global $name, $sex, $firstname, $lastname, $country, $interest, $product, $email, $data;
print $interest (zum Testen was in Interest steht)
Das ist der Anfang der Seite und bereits beid er Testausgabe ist der Wert falsch........ Also schon bevor ich überhaupt die Chance hatte ihn zu überschreiben.
Trozdem werde ich nochmal alle ifs prüfen....
Hat den niemand sonst eine Idee. Leider machen gerade ein paar Leute Stress es soll bis heute Abend laufen......
Panik.....
Hallo Ben20.
Da bekomme ich folgendes:
Warning: Uninitialized variable or array index or property (_POST) in contactform.php3 on line 7
Schon ganz verzweifelten Gruß
pepenipf