TweakPC

Zurück   Computer Hardware Forum - TweakPC > Games und Software > Programmiersprachen
Registrieren Hilfe Community Downloads

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 14.09.2004, 13:51   #1 (permalink)
Overclocker
 

Registriert seit: 11.04.2002
Beiträge: 203

Martin TweakPC befindet sich auf einem aufstrebenden Ast

Standard PHP-Kontaktformular

Hallo,
ich habe ein Kontaktformular erstellt: www.esfad.de/php/kontaktformular.html alle eingegeben Daten werden dann an eine datei www.esfad.de/php/info@esfad.php 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>
-----------------------------

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>
------------------------------------

Ich hoffe mir kann jemand weiterhelfen. Vielen Dank schonmal

mfg Albert Einstein
Martin TweakPC ist offline   Mit Zitat antworten
Alt 16.09.2004, 20:47   #2 (permalink)
Rechenknecht
 

Registriert seit: 10.01.2003
Beiträge: 93

Einstein befindet sich auf einem aufstrebenden Ast

Standard 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.
Einstein ist offline   Mit Zitat antworten
Alt 16.09.2004, 21:03   #3 (permalink)
Overclocker
 

Registriert seit: 11.04.2002
Beiträge: 203

Martin TweakPC befindet sich auf einem aufstrebenden Ast

Standard

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

mfg Albert Einstein
Martin TweakPC ist offline   Mit Zitat antworten
Antwort

Stichworte
phpkontaktformular


Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)
 

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist aus.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are an



Alle Zeitangaben in WEZ +1. Es ist jetzt 06:22 Uhr.






Powered by vBulletin® Version 3.8.10 (Deutsch)
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
SEO by vBSEO 3.5.2 ©2010, Crawlability, Inc.
Impressum, Datenschutz Copyright © 1999-2015 TweakPC, Alle Rechte vorbehalten, all rights reserved