Computer Hardware Forum - TweakPC

Computer Hardware Forum - TweakPC (https://www.tweakpc.de/forum/)
-   Programmiersprachen (https://www.tweakpc.de/forum/programmiersprachen/)
-   -   PHP-Kontaktformular (https://www.tweakpc.de/forum/programmiersprachen/18526-php-kontaktformular.html)

Martin TweakPC 14.09.2004 13:51

PHP-Kontaktformular
 
Hallo,
ich habe ein Kontaktformular erstellt: [url]www.esfad.de/php/kontaktformular.html[/url] alle eingegeben Daten werden dann an eine datei [url]www.esfad.de/php/info@esfad.php[/url] weitergegeben und diese Datei schickt mir die Daten per E-Mail zu. Jedoch habe ich wohl einige Fehler drin. Ich habe schon ein wenig Ahnung von html, jedoch leider wohl nicht ausreichend. Ich habe noch nicht alle Texteingabe $variablen übertragen in die php-datei. Ich weiß aber leider nicht wie das geht: hier ist der quelltext der datei:

Kontaktformular:

----------------------------------------------

[code]<form action="http://esfad.de/php/info@esfad.php" method="post">
Ich möchte die/den

<select name="typ" size="1">
<option><font face="Arial" size="2" color="#000000">Agentur</option>
<option><font face="Arial" size="2" color="#000000">Veranstalter</option>

</select> namens

<input style="color:#800000;" type="user" name="name" size="13" maxlength="30">

in (Stadt) <input style="color:#800000;" type="user" name="ort" size="13" maxlength="30"> bewerten.

<p>

Das Event-Datum: 
<select name="tag" size="1">
<option><font face="Arial" size="2" color="#000000">1</option>
<option><font face="Arial" size="2" color="#000000">2</option>
<option><font face="Arial" size="2" color="#000000">3</option>
<option><font face="Arial" size="2" color="#000000">4</option>
<option><font face="Arial" size="2" color="#000000">5</option>
<option><font face="Arial" size="2" color="#000000">6</option>
<option><font face="Arial" size="2" color="#000000">7</option>
<option><font face="Arial" size="2" color="#000000">8</option>
<option><font face="Arial" size="2" color="#000000">9</option>
<option><font face="Arial" size="2" color="#000000">10</option>
<option><font face="Arial" size="2" color="#000000">11</option>
<option><font face="Arial" size="2" color="#000000">12</option>
<option><font face="Arial" size="2" color="#000000">13</option>
<option><font face="Arial" size="2" color="#000000">14</option>
<option><font face="Arial" size="2" color="#000000">15</option>
<option><font face="Arial" size="2" color="#000000">16</option>
<option><font face="Arial" size="2" color="#000000">17</option>
<option><font face="Arial" size="2" color="#000000">18</option>
<option><font face="Arial" size="2" color="#000000">19</option>
<option><font face="Arial" size="2" color="#000000">20</option>
<option><font face="Arial" size="2" color="#000000">21</option>
<option><font face="Arial" size="2" color="#000000">22</option>
<option><font face="Arial" size="2" color="#000000">23</option>
<option><font face="Arial" size="2" color="#000000">24</option>
<option><font face="Arial" size="2" color="#000000">25</option>
<option><font face="Arial" size="2" color="#000000">26</option>
<option><font face="Arial" size="2" color="#000000">27</option>
<option><font face="Arial" size="2" color="#000000">28</option>
<option><font face="Arial" size="2" color="#000000">29</option>
<option><font face="Arial" size="2" color="#000000">30</option>
<option><font face="Arial" size="2" color="#000000">31</option>

</select>(Tag)

<select name="monat" size="1">
<option><font face="Arial" size="2" color="#000000">1</option>
<option><font face="Arial" size="2" color="#000000">2</option>
<option><font face="Arial" size="2" color="#000000">3</option>
<option><font face="Arial" size="2" color="#000000">4</option>
<option><font face="Arial" size="2" color="#000000">5</option>
<option><font face="Arial" size="2" color="#000000">6</option>
<option><font face="Arial" size="2" color="#000000">7</option>
<option><font face="Arial" size="2" color="#000000">8</option>
<option><font face="Arial" size="2" color="#000000">9</option>
<option><font face="Arial" size="2" color="#000000">10</option>
<option><font face="Arial" size="2" color="#000000">11</option>
<option><font face="Arial" size="2" color="#000000">12</option>
</select>
(Monat)
<select name="jahr" size="1">
<option><font face="Arial" size="2" color="#000000">2004</option>
<option><font face="Arial" size="2" color="#000000">2005</option>

</select>(Jahr)

<hr><br>


Event-Art:                  
<select name="event-art" size="1">
<option><font face="Arial" size="2" color="#000000">DJ-Booking</option>
<option><font face="Arial" size="2" color="#000000">Music-Act</option>
<option><font face="Arial" size="2" color="#000000">Show-Progr. aller Art</option>
<option><font face="Arial" size="2" color="#000000">Künstler</option>
<option><font face="Arial" size="2" color="#000000">Party-Pakete (Deko etc.)</option>
</select>
<br>
Genauere Bezeichnung: <input style="color:#800000;" type="user" name="event-bes" size="20" maxlength="30">

<br>

Ort der Veranstaltung:   <input style="color:#800000;" type="ort-ver" name="pass" size="20" maxlength="30">
<hr>

Bewertungstext: <br>
<input style="color:#800000;" type="user" name="bewertung" size="89" maxlength="150">
<p>
Bewertungsfazit:      <font color="#008030">Positiv: </font><input type="Radio" name="fazit" value="v">    Neutral: <input type="Radio" name="fazit" value="v">     <font color="#FF0000">Negativ: </font><input type="Radio" name="fazit" value="v">

<br><input style="width:166;" type="submit" value="Bewertung abschicken *"></form>[/code]

-----------------------------

Quelltext der php-datei (info@esfad.php) --> hier sollen die datein hin übertragen werden:

[code]<html>
<head>
<title>Kontakt-Formular</title>
</head>
<body>

<?php

if($abschicken)
{
if(empty($name) || empty($email) || empty($text))
{
echo "Bitte gehen Sie zurück und füllen Sie alle Felder aus!";
}
else
{
while(list($feld,$wert)=each($HTTP_POST_VARS))
{
if($feld!="abschicken")
{
$mailnachricht.=ucfirst($feld).": $wert\n";
}
}
$mailnachricht.="\nDatum/Zeit: ";
$mailnachricht.=date("d.m.Y H:i:s");
$mailbetreff="Kontakt: ";
$mailbetreff.=$HTTP_POST_VARS[betreff];
mail("webmaster@esfad.de", $mailbetreff, $mailnachricht, "From: $email");
echo "Vielen Dank für Ihre eMail! Wir werden ihnen schnellst möglich antworten<br>
";
}
}
else
{
echo "Ein Fehler ist aufgetreten.";
}

?>

<a href="http://www.esfad.de/esfad/">zurück zur seite</a>

</body>
</html>[/code]------------------------------------

Ich hoffe mir kann jemand weiterhelfen. Vielen Dank schonmal

mfg Albert Einstein

Einstein 16.09.2004 20:47

Re: PHP-Kontaktformular
 
Bevor ich deine Frage beantworten kann, würde ich noch gern wissen, was für ein Fehler auftritt (wird die Meldung "Ein Fehler ist aufgetreten" - die du ja per echo ausgibst - ausgegeben??).
Dann würde ich mal an deiner Stelle alle per Post übergegebenen Variablen nicht über $variablenname abfragen sondern über $_POST["variablenname"] (also z.B. statt $name $_POST["name"] verwenden), ebenso das "while(list($feld,$wert)=each($HTTP_POST_VARS))" durch "while(list($feld,$wert)=each($_POST))" ersetzen.

Martin TweakPC 16.09.2004 21:03

Hallo,
habe inzwischen zum Glück durch rumprobieren eine Lösung gefunden.

mfg Albert Einstein


Alle Zeitangaben in WEZ +1. Es ist jetzt 23:24 Uhr.

Powered by vBulletin® Version 3.8.10 (Deutsch)
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
SEO by vBSEO 3.5.2 ©2010, Crawlability, Inc.