Gegen Bilderklau - Das Original (https://www.gegen-bilderklau.net/index.php)
- Design, Website, Copyright (https://www.gegen-bilderklau.net/board.php?boardid=80)
--- Homepagehilfe (https://www.gegen-bilderklau.net/board.php?boardid=27)
---- Homepagehilfe - Archiv (https://www.gegen-bilderklau.net/board.php?boardid=139)
----- [PHP & MySQL] Formularproblem (https://www.gegen-bilderklau.net/thread.php?threadid=155548)
Geschrieben von Juicey am 14.05.2009 um 15:23:
Formularproblem
Ich habe ein totales Formularproblem. Immer wenn ich alles ausfülle und auf abschicken gehe,steht da,dass da irgendwas fehlt,kann mir wer helfen?
Link:
http://tssilberpfeil.ts.funpic.de/nennformular.html
HTML TEIL
code: |
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>SEITENTITEL</title>
<!--
link zu einer externen CSS-Datei, in die Datei eingebundene CSS-Eigenschaften, etc.
-->
</head>
<body>
<!--
Evtl einleitender Text zum Formular
-->
<form action="action_nennformular.php" method="post"><small><small><span
style="font-weight: bold; text-decoration: underline; font-family: Verdana;">Nennformular</span></small></small>
<br>
<div style="text-align: left;">
<div style="text-align: left;"><small><small><span
style="font-family: Verdana;"></span><span
style="text-decoration: underline; font-family: Verdana;"></span></small></small><br>
<small><small><span style="font-family: Verdana;">Alle
Informationen bis auf die * werden gebraucht!:</span></small></small><br>
<small><small><span style="font-family: Verdana;"></span></small></small><br>
<small><small><span style="font-family: Verdana;"></span></small></small><small
style="font-weight: bold;"><small><span
style="font-family: Verdana;">Name:</span></small></small>
<input name="textfeld"
value="" type="text"> <small
style="font-weight: bold;"><small><span
style="font-family: Verdana;"></span></small></small><br>
<small style="font-weight: bold;"><small><span
style="font-family: Verdana;">Hofadresse:</span></small></small><input
name="textfeld" value="http://" type="text"><br>
<small style="font-weight: bold;"><small><span
style="font-family: Verdana;">Turnier:
</span></small></small>
<select size="1" name="Turnier">
<option>Eröffnungsturnier</option>
<option>Test</option>
<option>Test</option>
<option>Test</option>
</select>
<small style="font-weight: bold;"><small><span
style="font-family: Verdana;"></span></small></small><br>
<small style="font-weight: bold;"><small><span
style="font-family: Verdana;">Disziplin1:
</span></small></small>
<select size="1" name="Disziplin">
<option>Springen E</option>
<option>Springen A</option>
<option>Springen L</option>
<option>Springen M</option>
</select>
<br>
<small style="font-family: Verdana; font-weight: bold;"><small>Disziplin2</small></small><span
style="font-weight: bold;">* </span>
<select size="1" name="Disziplin">
<option>Springen E</option>
<option>Springen A</option>
<option>Springen L</option>
<option>Springen M</option>
</select>
<br>
<small style="font-family: Verdana; font-weight: bold;"><small>Disziplin3*:</small></small>
<select size="1" name="Disziplin">
<option>Springen E</option>
<option>Springen A</option>
<option>Springen L</option>
<option>Springen M</option>
</select>
<br>
<small style="font-weight: bold;"><small><span
style="font-family: Verdana;">Pferdlink1:</span></small></small> <small
style="font-weight: bold;"><small><span
style="font-family: Verdana;"> <input name="textfeld"
value="http://" type="text"></span></small></small><br>
<small style="font-weight: bold;"><small><span
style="font-family: Verdana;"></span></small></small><br>
<small style="font-weight: bold;"><small><span
style="font-family: Verdana;"></span></small></small></div>
<small style="font-weight: bold;"><small><span
style="font-family: Verdana;"></span></small></small></div>
<input value="Abschicken" type="submit"><input
value="Zurücksetzen" type="reset"></form>
</body>
</html> |
|
PHP TEIL
code: |
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>nennformular</title>
<!--
link zu einer externen CSS-Datei, in die Datei eingebundene CSS-Eigenschaften, etc.
-->
</head>
<body>
<?php
// Mit diesen Codes "holt" man sich jetzt die Angaben, die im Formular gemacht wurden:
$name = ($_POST['name']);
$hofadresse = ($_POST['hofadresse']);
$turnier = ($_POST['turnier']);
$disziplin1= ($_POST['disziplin1']);
$disziplin2= ($_POST['disziplin2']);
$disziplin3= ($_POST['disziplin3']);
$pferdelink1= ($_POST['pferdelink1']);
// Um zu überprüfen, ob auch wirklich alle Angaben gemacht wurden, folgt jetzt eine if-Abfrage:
if ( ($name == "") OR ($hofadresse == "") OR ($turnier == "") OR ($disziplin1 == "") OR ($disziplin2 == "") OR ($disziplin3 == "") OR ($pferdelink1 == "") )
{
echo "Irgendwas fehlt,am Besten du startest das Formular neu!";
}
// Das heißt: wenn (if) eine der Angaben nicht gemacht werden, erscheint der Text vom echo()-Befehl. Ansonsten (else) wird die e-Mail verschickt:
else
{
mail("ts_silberpfeil@yahoo.de",$betreff,$nachricht,"From: $name <$email>");
echo "Deine E-Mail wurde erfolgreich verschickt.";
}
?>
</body>
</html> |
|
Über eine Hilfe wäre ich wirklich sehr sehr dankbar !
Geschrieben von cll am 14.05.2009 um 16:31:
ersetze das:
if ( ($name == "") OR ($hofadresse == "") OR ($turnier == "") OR ($disziplin1 == "") OR ($disziplin2 == "") OR ($disziplin3 == "") OR ($pferdelink1 == "") )
{
echo "Irgendwas fehlt,am Besten du startest das Formular neu!";
}
durch hier das:
if ( ($name == "") OR ($hofadresse == "") OR ($turnier == "") OR ($disziplin1 == "") OR ($disziplin2 == "") OR ($disziplin3 == "") OR ($pferdelink1 == "") )
{
echo "Irgendwas fehlt,am Besten du startest das Formular neu!
<br>Name: $name
<br>$hofadresse
<br>$turnier
<br>$disziplin1
<br>$disziplin2
<br>$disziplin3
<br>$pferdelink1";
}
Dann weißt du an welchem es liegt. Ich tipp du hast nen Tppfehler im Namen oder so.
EDIT: Ach ja, MÜSSEN die 3 Disziplinen ausfüllen?!
Geschrieben von Juicey am 14.05.2009 um 19:19:
Nicht unbedingt aber ich dachte dass wäre erst der Fehler,danke auf jeden Fall schon mal ich werds ausprobieren
EDIT: Klappt immer noch nicht!
Geschrieben von Leila am 14.05.2009 um 19:30:
Im HTML-Code jeweils in Z. 47, Z. 56 und Z. 64 bei name="Disziplin" das "Disziplin" durch "disziplin1" "disziplin2" bzw. "disziplin3" ersetzen
Ebenso bei allen anderen feldern, das im HTML-Code in den "" hinter name= steht, muss auch im PHP Code beim folgenden fettgedruckten stehen
$name = ($_POST['name']);
keine Ausnahmen, keinerlei Unterschiede in Groß- und Kleinschreibung
Geschrieben von cll am 15.05.2009 um 09:24:
du hättest einfach nur in deiner Antwort sagen müssen, was er dir jetzt anzeigt! Dazu ist der Test ja! Dann kannst du schlussfolgern was falsch ist!
Geschrieben von Juicey am 15.05.2009 um 16:42:
Okay danke für die Hilfe,aber ich habe nun ein neues Problem,zwar sendet der das an unsere Mail,aber es steht nichts drinnen!
Geschrieben von cll am 16.05.2009 um 11:51:
wie denn auch? Dein inhalt ist $nachricht, und die Variable hast du nicht erzeugt
Geschrieben von Juicey am 16.05.2009 um 12:25:
Oh danke,dass werde ich dann direkt ändern

Mensch bin ich verpeilt <3
Forensoftware: Burning Board, entwickelt von WoltLab GmbH