Author Topic: Problem mit Formular: Checkbox auswerten  (Read 4067 times)

0 Members and 1 Guest are viewing this topic.

Offline Habi86

  • Newbie
  • *
  • Posts: 46
    • View Profile
Problem mit Formular: Checkbox auswerten
« on: March 14, 2010, 06:20:27 PM »
EDIT: Hat sich erledigt trotzdem Danke


Hi all!
Ich hoffe hier die Erlösung zu finden... schaffs einfach nicht *heul*  :cry:

Mein Formular soll Checkboxen haben, einmal für die Anrede und einmal um ein Produkt auszuwählen:

Html:

Anrede:
Code: [Select]
<label for="anrede" class="float"><strong>Anrede:</strong></label><br />
<input type="Radio" name="anrede" value="Herr"> Herr <input type="Radio" name="Anrede" value="Frau"> Frau

Angebot:
Code: [Select]
<label for="option1"><input class="choose" name="option[]" id="option1" type="checkbox" value="1" /> &nbsp; Angebot 1</label><br />
<label for="option2"><input class="choose" name="option[]" id="option2" type="checkbox" value="2" /> &nbsp; Angebot 2</label><br />
<label for="option3"><input class="choose" name="option[]" id="option3" type="checkbox" value="3" /> &nbsp; Angebot 3</label><br />

PHP Auswertung:

Code: [Select]
$checkbox = Trim(stripslashes($_GET['checkbox']));
$anrede = Trim(stripslashes($_GET['anrede']));
$titel = Trim(stripslashes($_POST['titel']));
$vorname = Trim(stripslashes($_POST['vorname']));
$name = Trim(stripslashes($_POST['name']));
usw.

Für E-mail:

Code: [Select]
$Body = "";
$Body .= "Angebot: ";
$Body .= $checkbox;
$Body .= "\n";
$Body .= "Anrede: ";
$Body .= $anrede;
$Body .= "\n";
$Body .= "Titel: ";
$Body .= $titel;
$Body .= "\n";
$Body .= "Vorname: ";
$Body .= $vorname;
$Body .= "\n";
$Body .= "Name: ";
$Body .= $name;

Bitte entschuldigt diese Noobie-Frage. Ich weiß das DAS für viele hier lächerlich und einfach ist.

Liebe Grüße,
Stefanie
« Last Edit: March 15, 2010, 08:04:03 PM by Habi86 »