oh mann ... langsam kriege ich echt die krise. bin zwar noch in der learning by doing phase und habe eigentlich alles hier irgentwie hinbekommen ... aber ich bekomme doch einfach nicht die var in ein formularfeld ...
also wie schonmal angesprochen habe ich folgendes konstrukt:
ich habe ein button (mittlerweile in einem modul) - Button_Anmeldung
Code: Alles auswählen
<?php
echo '
<form method="post" action="front_content.php?idcat=49&idart=35">
<input type="submit" name="submit" value="anmelden" />
<p>
<input type="hidden" value="'.urlencode("CMS_HTML[2]").'" name="kursname" />
</p>
</form>'."\n";
?>
wenn ich den drücke wird die variable "kursname" an das aufgerufene formular gesendet. hier das modul dazu ... war früher das kontaktformular ...
Code: Alles auswählen
<?php
/***********************************************
* CONTENIDO MODUL - OUTPUT
*
* Modulname : Contact form
* Author(s) : Andreas Lindner
* Copyright : Contenido - four for business
* Created : 12.08.2005
************************************************/
#Includes
cInclude("classes", "class.phpmailer.php");
if (!isset ($_POST['send'])) {
#Form has not been sent yet
cInclude('classes', 'class.article.php');
cInclude('classes', 'class.template.php');
#Create contact form
echo '<form name="kontaktform" id="kontaktform" method="post" action="'.$sess->url("front_content.php?idcat=$idcat&idart=$idart&parentid=$parentid").'">';
echo '<input type="hidden" name="send" value="1">';
if (!is_object($tpl)) {
$tpl = new Template;
}
# darum geht es ...
$tpl->set("s", "KURS", $_REQUEST["Kursname"]);
# nur zum testen ob die var auch da ist
echo $_REQUEST["Kursname"];
$tpl->set("s", "Firma", mi18n("Firma"));
$tpl->set("s", "ANREDE", mi18n("Anrede"));
$tpl->set("s", "ANREDE_OPTION1", mi18n("Herr"));
$tpl->set("s", "ANREDE_OPTION2", mi18n("Frau"));
$tpl->set("s", "Name", mi18n("Name"));
$tpl->set("s", "Strasse", mi18n("Straße/Nr."));
$tpl->set("s", "PlzOrt", mi18n("PLZ/Ort"));
$tpl->set("s", "Land", mi18n("Land"));
$tpl->set("s", "Telefon", mi18n("Telefon"));
$tpl->set("s", "Fax", mi18n("Fax"));
$tpl->set("s", "Mobil", mi18n("Mobil"));
$tpl->set("s", "Email", mi18n("E-Mail"));
$tpl->set("s", "Nachricht", mi18n("Nachricht"));
$tpl->set("s", "PFLICHTFELDER", mi18n("Pflichtfelder"));
$tpl->set("s", "ABSCHICKEN", mi18n("Anmeldung senden"));
$tpl->set("s", "LOESCHEN", mi18n("Löschen"));
$tpl->generate($cfgClient[$client]["path"]["frontend"]."templates/anmelde_formular.html");
echo '</form>';
} elseif ($_POST['send'] == 1) {
#Form has been sent
#Check user input
$noerrors = true;
$msg = '';
if ($_POST['Name'] == '') {
$noerrors = false;
$msg .= mi18n("- Bitte geben Sie Ihren Vornamen und Namen ein!")."<br/><br/>";
}
if ($_POST['Strasse'] == '') {
$noerrors = false;
$msg .= mi18n("- Bitte geben Sie Ihre Straße und Haus-Nr. ein!")."<br/><br/>";
}
if ($_POST['PlzOrt'] == '') {
$noerrors = false;
$msg .= mi18n("- Bitte geben Sie Ihre Postleitzahl und Ort ein!")."<br/><br/>";
}
if ($_POST['KURS'] == '') {
$noerrors = false;
$msg .= mi18n("- Für welchen Kurs möchten Sie sich anmelden?")."<br/><br/>";
}
if ($noerrors == false) {
#Errors have been found
echo mi18n("<font color='red'><b>Beim Versenden sind folgende Fehler aufgetreten:</b>")."<br/><br/><br/>";
echo $msg.'<br/>';
echo '<a href="javascript:history.back();">'.mi18n("Zurück zum Formular").'</a>';
echo '<br/>';
echo '<br/>';
echo '<br/>';
echo '<br/>';
echo '<br/>';
echo '<br/>';
echo '<br/>';
} else {
#No errors, create and send mail
$mail = new phpmailer;
$mail_body = '<html><head></head><body bgcolor="#ffffff"><table cellspacing="0" cellpadding="2" border="0">';
if (is_array($_POST)) {
foreach ($_POST as $key => $value) {
if ($key != 'send') {
$mail_body .= "<tr><td>$key</td><td>$value</td></tr>";
}
}
}
$mail_body .= '</table></bo'.'dy></html>';
$mail->Host = "localhost";
$mail->IsHTML(true);
#Get mailer from settings
switch (strtolower("CMS_VALUE[4]")) {
case "smtp" :
$mail->IsSMTP();
$host = "CMS_VALUE[5]";
$user = "CMS_VALUE[6]";
$password = "CMS_VALUE[7]";
if (($host != '') && ($user != '') && ($password != '')) {
$mail-> $SMTPAuth = true;
$mail->Host = $host;
$mail->Username = $user;
$mail->Password = $password;
}
break;
case "mail" :
$mail->IsMail();
break;
case "sendmail" :
$mail->IsSendmail();
break;
case "qmail" :
$mail->IsQmail();
break;
default :
}
$mail->From = "CMS_VALUE[0]";
$mail->FromName = "CMS_VALUE[2]";
$mail->AddAddress("CMS_VALUE[1]", "");
$mail->Subject = "CMS_VALUE[3]";
$mail->Body = $mail_body;
$mail->WordWrap = 50;
$mail->Send();
#Display message after mail is sent
echo mi18n("<font color='green'><b>Ihre Nachricht wurde erfolgreich versendet.</b>")."<br/><br/><br/>";
echo mi18n("Vielen Dank!")."<br/><br/><br/>";
echo '<a href="javascript:history.back();">'.mi18n("Zum Anmeldeformular").'</a>';
echo '<br/>';
echo '<br/>';
echo '<br/>';
echo '<br/>';
echo '<br/>';
echo '<br/>';
echo '<br/>';
}
}
?>
er gibt mit request die var aus ... aber nicht in das formularfeld ... grrr
dann habe ich da noch den html aufbau vom formular was ins modul included wird "anmelde_formular.html":
Code: Alles auswählen
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="473" border="0" cellspacing="2" cellpadding="2">
<tr>
<td bgcolor="#D0E6DC" height="50">
<table cellspacing="2" cellpadding="2" border="0" width="473" height="50">
<tr>
<td width="111">Kurs/Ausbildung<span class="small"><sup><font color="#FF0000">*</font></sup></span></td>
<td width="2"></td>
<td width="334">
<input type="text" name="KURS" id="KURS" maxlength="100"
style="width:240px;"/>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="2" cellpadding="2" border="0" width="473">
<tr>
<td width="133" height="10"></td>
<td width="5" height="10"></td>
<td height="10" width="335"></td>
</tr>
<tr>
<td width="133" height="8">Firma, Verein, Behörde</td>
<td width="5" height="8"></td>
<td height="8" width="335">
<input type="text" name="Firma" id="firma" maxlength="100" style="width:240px;"/>
</td>
</tr>
<tr>
<td width="133" height="8">Anrede</td>
<td width="5" height="8"></td>
<td height="8" width="335">
<p>
<input type="radio" name="Anrede" value="{ANREDE_OPTION1}" checked>
{ANREDE_OPTION1}
<input type="radio" name="Anrede" value="{ANREDE_OPTION2}"/>
{ANREDE_OPTION2} </p>
</td>
</tr>
<tr>
<td width="133">Vorname, Name<span class="small"><sup><font color="#FF0000">*</font></sup></span></td>
<td width="5"></td>
<td width="335">
<input type="text" name="Name" id="name" maxlength="100" style="width:240px;"/>
</td>
</tr>
<tr>
<td width="133">Straße, Nr.<span class="small"><sup><font color="#FF0000">*</font></sup></span></td>
<td width="5"></td>
<td width="335">
<input type="text" name="Strasse" id="strasse" maxlength="100" style="width:240px;"/>
</td>
</tr>
<tr>
<td width="133">Plz, Ort<span class="small"><sup><font color="#FF0000">*</font></sup></span></td>
<td width="5"></td>
<td width="335">
<input type="text" name="PlzOrt" id="plzort" maxlength="100" style="width:240px;"/>
</td>
</tr>
<tr>
<td width="133">Land</td>
<td width="5"></td>
<td width="335">
<input type="text" name="Land" id="land" maxlength="100" style="width:240px;"/>
</td>
</tr>
<tr>
<td width="133">Telefon<span class="small"><sup></sup></span></td>
<td width="5"></td>
<td width="335">
<input type="text" name="Tel" id="tel" maxlength="100" style="width:240px;"/>
</td>
</tr>
<tr>
<td width="133">Fax</td>
<td width="5"></td>
<td width="335">
<input type="text" name="Fax" id="fax" maxlength="100" style="width:240px;"/>
</td>
</tr>
<tr>
<td width="133">Mobil</td>
<td width="5"></td>
<td width="335">
<input type="text" name="Mobil" id="mobil" maxlength="100" style="width:240px;"/>
</td>
</tr>
<tr>
<td width="133" height="31">E-Mail</td>
<td width="5" height="31"></td>
<td width="335" height="31">
<input type="text" name="Email" id="email" maxlength="100" style="width:240px;"/>
</td>
</tr>
<tr>
<td width="133"> </td>
<td width="5"></td>
<td width="335"> </td>
</tr>
<tr>
<td width="133" valign="top">Nachricht</td>
<td width="5"></td>
<td width="335">
<textarea name="Nachricht" id="nachricht" style="width:320px;height:120px;font-family:Verdana,Tahoma,Arial,Helvetica,Sans-serif,sans-serif;font-size:11px;"></textarea>
</td>
</tr>
<tr>
<td width="133" height="10"></td>
<td width="5" height="10"></td>
<td align="left" width="335" height="10"></td>
</tr>
<tr>
<td width="133"> </td>
<td width="5"></td>
<td align="left" width="335">
<input type="submit" value="{ABSCHICKEN}" class="button"/>
<input type="reset" value="{LOESCHEN}" class="button" name="reset"/>
</td>
</tr>
<tr>
<td width="133"></td>
<td width="5"></td>
<td align="right" width="335"></td>
</tr>
<tr>
<td width="133"></td>
<td width="5"></td>
<td align="right" width="335"><span class="small"><sup><font color="#FF0000">*</font></sup></span>
{PFLICHTFELDER}</td>
</tr>
<tr>
<td width="133" height="10"></td>
<td width="5" height="10"></td>
<td align="right" width="335" height="10"></td>
</tr>
</table>
1.) ich bekomme zwar über echo request die var ausgegeben aber nicht ins formular ...
2.) dann gibt er über echo die var so aus :
"Heilpraktiker%2Fin+" sollte aber "Heilpraktiker/in" rauskommen
als ich die idee hierzu hatte, dachte ich echt das es einfach ist und meine kenntnisse ausreichen würden ...
würde mich über ne kleine hilfe eurerseits echt freuen ...
beste grüße vince