Ich habe ein Problem. Ich habe ein Formular was Werte weitergeben soll. Da mein Formular zwei Action Möglichkeiten hat musste ich die Button mit PHP erstellen. Die meisten Werte werden aus einer PHp Abfrage eingefügt, aber die textarea soll einen Standardtext übergeben.
Auf der 2.Seite soll die textarea verarbeitet werden.
Formular
2. Seite
Der Errororeport ergibt:
Notice: Undefined index: reject_comment in /home/americanblueva/public_html/Admin/Admin_pilot_anfragen_loeschen.php on line 136
Kann man da ne Lösung finden.
Auf der 2.Seite soll die textarea verarbeitet werden.
Formular
PHP:
<?php
$id = isset($_GET['id']) ? $_GET['id'] : null;
$abfrage = "SELECT * FROM piloten_bewerbung Where `id` = '".$id."'";
$ergebnis = mysql_query($abfrage);
$dataset = mysql_fetch_array($ergebnis);
$num = mysql_Num_Rows ($ergebnis);
$nachname = ($dataset['nachname']);
$vorname = ($dataset['vorname']);
$mail = ($dataset['mail']);
$passwort = ($dataset['passwort']);
$plz = ($dataset['plz']);
$ort = ($dataset['ort']);
$heimatflughafen = ($dataset['heimatflughafen']);
$basis = ($dataset['basis']);
$ivaoid = ($dataset['ivaoid']);
$vatsimid = ($dataset['vatsimid']);
$other = ($dataset['other']);
$reg_datum = ($dataset['reg_datum']);
if ($num != 0):
?>
<FORM ACTION="Admin_pilot_anfragen3.php" METHOD="post">
<table cellspacing="2" cellpadding="1" width="88%" class="tableLine" align="center">
<TR bgcolor="#B6B6B6">
<TD width="30%"><div align="left"><strong> Pilot ID:</strong></div></TD>
<TD width="19%"><div align="left">
<INPUT TYPE="text" NAME="pilot_id" VALUE="<?php echo mysql_result($ergebnis, 0, "pilot_id");?>"
SIZE="4" MAXLENGTH="4"> <TD width="29%"><div align="left"><strong>Date of Birth:</strong></div></TD>
<TD width="22%"> <?php echo "$geburtstag" ?>
<INPUT TYPE="hidden" NAME="vorname" VALUE="<?php echo "$geburtstag"; ?>"></TD>
</TR>
<TR bgcolor="#666666">
<TD width="30%"><div align="left"><strong> First Name:</strong></div></TD>
<TD width="19%"><div align="left">
<?php echo "$vorname" ?>
<INPUT TYPE="hidden" NAME="vorname" VALUE="<?php echo "$vorname"; ?>">
</div></TD>
<TD width="29%"><div align="left"><strong> Last Name:</strong></div></TD>
<TD width="22%"><div align="left"><?php echo "$nachname" ?>
<INPUT TYPE="hidden" NAME="nachname" VALUE="<?php echo "$nachname"; ?>"></div>
</TD>
</TR>
<TR bgcolor="#B6B6B6">
<TD width="30%"><div align="left"><strong> E-Mail Addy:</strong></div></TD>
<TD width="19%"><div align="left">
<?php echo "$mail" ?>
<INPUT TYPE="hidden" NAME="mail" VALUE="<?php echo "$mail"; ?>"> </div></TD>
<TD width="29%"><table cellspacing="0" cellpadding="0">
<tr>
<td></td>
<td><strong> Password:</strong></td>
</tr>
</table></TD>
<TD width="22%"><div align="left"><?php echo "$passwort" ?>
<INPUT TYPE="hidden" NAME="passwort" VALUE="<?php echo "$passwort"; ?>"> </div></TD>
</TR>
<TR bgcolor="#666666">
<TD width="30%"><div align="left"><strong> IVAO ID:</strong></div></TD>
<TD width="19%"><div align="left">
<?php echo "$ivaoid" ?>
<INPUT TYPE="hidden" NAME="ivaoid" VALUE="<?php echo "$ivaoid"; ?>">
</div></TD>
<TD width="29%"><table cellspacing="0" cellpadding="0">
<tr>
<td></td>
<td><strong> Vatsim ID:</strong></td>
</tr>
</table></TD>
<TD width="22%"><div align="left"><?php echo "$vatsimid" ?>
<INPUT TYPE="hidden" NAME="vatsimid" VALUE="<?php echo "$vatsimid"; ?>"> </div></TD>
</TR>
<TR bgcolor="#B6B6B6">
<TD width="30%"><div align="left"><strong> Location:</strong></div></TD>
<TD width="19%"><div align="left">
<?php echo "$ort" ?>
<INPUT TYPE="hidden" NAME="ort" VALUE="<?php echo "$ort"; ?>">
</div></TD>
<TD width="29%"><table cellspacing="0" cellpadding="0">
<tr>
<td></td>
<td><strong> Zip-Code:</strong></td>
</tr>
</table></TD>
<TD width="22%"><div align="left"><?php echo "$plz" ?>
<INPUT TYPE="hidden" NAME="plz" VALUE="<?php echo "$plz"; ?>"> </div></TD>
</TR>
<TR bgcolor="#666666">
<TD width="30%"><div align="left"><strong> Home Airport:</strong></div></TD>
<TD width="19%"><div align="left">
<?php echo "$heimatflughafen" ?>
<INPUT TYPE="hidden" NAME="heimatflughafen" VALUE="<?php echo "$heimatflughafen"; ?>">
</div></TD>
<TD width="29%"><table cellspacing="0" cellpadding="0">
<tr>
<td></td>
<td width="196"><div align="left"><strong> First Location:</strong></td>
</tr>
</table></TD>
<TD width="22%"><div align="left"><?php echo "$basis" ?>
<INPUT TYPE="hidden" NAME="basis" VALUE="<?php echo "$basis"; ?>">
</div></TD>
</TR>
<TR bgcolor="#B6B6B6">
<TD><div align="left"><strong> Remarks:</strong></div></TD>
<TD><div align="left">
<?php echo "$other" ?>
<INPUT TYPE="hidden" NAME="other" VALUE="<?php echo "$other"; ?>">
</div></TD>
<TD><div align="left"><strong> Registrierungsdatum:</strong></div></TD>
<TD><div align="left"><?php echo "$reg_datum" ?>
<INPUT TYPE="hidden" NAME="reg_datum" VALUE="<?php echo "$reg_datum"; ?>"> </div></TD>
</TR>
<TR bgcolor="#666666">
<TD><div align="left"></div></TD>
<TD><div align="left"></div></TD>
<TD><div align="left"><strong>Comment for Rejecting:<br /><i>(Pls. edit for each Application)</i></strong></div></TD>
<TD><div align="left">
<textarea name="reject_comment" cols="40" rows="">Dear <?php echo "$vorname" ?> <?php echo "$nachname" ?>\nWe are sorry, but we can not accept your Application.\n......\n For more Informations fell free to conact us on $sender\n\n Best Regards\n\n <b>Your AmericanBlue Support Team</b>
</textarea>
</div></TD>
</TR>
<TR bgcolor="#FFF">
<TD></TD>
<TD><div align="center"><b><?php print "<a href=\"Admin_pilot_anfragen3.php?id=$id\">Add Pilot</a>";?></b></div></TD>
<TD><div align="center"><b><?php print "<a href=\"Admin_pilot_anfragen_loeschen.php?id=$id\">Delete Pilot Application</a>";?></b></div> </TD>
<TD></TD>
</TR> </TABLE>
</FORM>
<?php else: echo "Eintrag nicht vorhanden";
endif;
mysql_freeresult($ergebnis);
mysql_close();
?>
2. Seite
PHP:
<?php
$id = isset($_GET['id']) ? $_GET['id'] : null;
$mailinput = mysql_real_escape_string($_POST['reject_comment']);
$abfrage = "SELECT
mail
FROM
piloten_bewerbung
Where id = $id
ORDER BY reg_datum ASC";
$ergebnis = mysql_query($abfrage);
$dataset = mysql_fetch_array($ergebnis);
$num = mysql_Num_Rows ($ergebnis);
$loesch = mysql_query("DELETE FROM piloten_bewerbung WHERE id = '$id'");
$sender = "info@americanblue-va.com";
$empfaenger = "".$dataset['mail']."";
$betreff = "Your Application on AmericanBlue-VA";
$mailtext = "$mailinput";
mail($empfaenger, $betreff, $mailtext, "From: $sender ");
print "You has rejected this Application";
?><br />
Notice: Undefined index: reject_comment in /home/americanblueva/public_html/Admin/Admin_pilot_anfragen_loeschen.php on line 136
Line136: $mailinput = mysql_real_escape_string($_POST['reject_comment']);
Kann man da ne Lösung finden.