Doch ich habe mehrere Probleme:
form.php:
PHP-Quellcode
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <title>Unbenanntes Dokument</title>
- <?php session_start();
- ?>
- </head>
- <body>
- <form id="form1" name="form1" method="post" action="pruefen.php">
- <p>
- <label>E-Mail
- <input type="text" name="email" id="email" />
- </label>
- </p>
- <p>
- <label>
- <input type="submit" name="button" id="button" value="Pruefen" />
- </label>
- </p>
- </form>
- </body>
- </html>
Problem:
Quellcode
- Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /Applications/XAMPP/xamppfiles/htdocs/emailpruefen/form.php:6) in /Applications/XAMPP/xamppfiles/htdocs/emailpruefen/form.php on line 6
- Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /Applications/XAMPP/xamppfiles/htdocs/emailpruefen/form.php:6) in /Applications/XAMPP/xamppfiles/htdocs/emailpruefen/form.php on line 6
pruefen.php:
PHP-Quellcode
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <title>Unbenanntes Dokument</title>
- <?PHP
- //session_start();
- $wert=rand(1, 1000000);
- $_SESSION['wertesession'] = $wert;
- $_SESSION['mail']=$_POST[email];
- echo $wert;
- if ($_POST[email]) {
- // hier steht der mail-Befehl zum Versenden
- mail($_POST[email],"",$wert);
- echo "Erfolgreich verschickt";
- } else {
- echo "Bitte geben Sie etwas ein";
- }
- ?>
- </head>
- <body>
- <form id="form1" name="form1" method="post" action="testen.php">
- <p>
- <label>Code:
- <input type="text" name="code" id="textfield" />
- </label>
- </p>
- <p>
- <label>Text:
- <textarea name="nachricht" id="textarea" cols="45" rows="5"></textarea>
- </label>
- </p>
- <p>
- <label>
- <input type="submit" name="button" id="button" value="Weiter" />
- </label>
- </p>
- </form>
- </body>
- </html>
KEIN Problem
testen.php:
PHP-Quellcode
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <title>Unbenanntes Dokument</title>
- <?PHP
- // hier steht der mail-Befehl zum Versenden
- if($_SESSION['wertesession']==$_POST[text] && $_POST[nachricht]){
- mail("email@test.de","Nachricht von $_SESSION['mail']",$_POST[nachricht]);
- echo "Erfolgreich verschickt";
- }
- session_destroy();
- ?>
- </head>
- <body>
- </body>
- </html>
Problem:
danke schonmal
xnuıl feel free
ǝlddɐ feel different
sʍopuıʍ feel bad
ǝlddɐ feel different
sʍopuıʍ feel bad