Author Topic: code problem  (Read 8941 times)

0 Members and 1 Guest are viewing this topic.

Offline osnapicture

  • Full Member
  • ***
  • Posts: 152
    • View Profile
code problem
« on: June 06, 2009, 11:48:50 PM »
i need a contact formular.
this is the code I have

Code: [Select]
nger = "mail@mydomain.de";

if($_REQUEST['Send'])
{
    if(empty($_REQUEST['Name']) || empty($_REQUEST['Email']) || empty($_REQUEST['Nachricht']))
    {
        echo"Bitte geh <a href=\"javascript:history.back();\">zurück</a> und füll alle Felder aus!";
    }
    else
    {
        $Mailbetreff = "Kontakt: ";
        $Mailbetreff .= $_REQUEST['Betreff'];

        $Trenner = md5(uniqid(time()));

        $Header = "From: ".$_REQUEST['Email'];
        $Header .= "\n";
        $Header .= "MIME-Version: 1.0";
        $Header .= "\n";
        $Header .= "Content-Type: multipart/mixed; boundary=$Trenner";
        $Header .= "\n\n";
        $Header .= "This is a multi-part message in MIME format";
        $Header .= "\n";
        $Header .= "--$Trenner";
        $Header .= "\n";
        $Header .= "Content-Type: text/plain";
        $Header .= "\n";
        $Header .= "Content-Transfer-Encoding: 8bit";
        $Header .= "\n\n";
        $Header .= "Sie haben folgende Nachricht erhalten: \n\n";

        while(list($Formularfeld, $Wert) = each($_REQUEST))
        {
            if($Formularfeld != "Send" && $Formularfeld != "Anhang")
            {
                $Header .= $Formularfeld.": ".$Wert."\n";
            }
        }

        $Header .= "\nDatum/Zeit: ";
        $Header .= date("d.m.Y H:i:s");
        $Header .= "\n";
        $Header .= "--$Trenner";
        $Header .= "\n";
        $Header .= "Content-Type: ";
        $Header .= $_FILES['Anhang']['type'];
        $Header .= "; name=";
        $Header .= $_FILES['Anhang']['name'];
        $Header .= "\n";
        $Header .= "Content-Transfer-Encoding: base64";
        $Header .= "\n";
        $Header .= "Content-Disposition: attachment; filename=";
        $Header .= $_FILES['Anhang']['name'];
        $Header .= "\n\n";
        $Dateiinhalt = fread(fopen($_FILES['Anhang']['tmp_name'], "r"), $_FILES['Anhang']['size']);
        $Header .= chunk_split(base64_encode($Dateiinhalt));
        $Header .= "\n";
        $Header .= "--$Trenner--";

        mail($Empfaenger, $Mailbetreff, "", $Header);
        echo"Vielen Dank für Deine Bewerbung! Ich werde mich in Kürze bei Dir melden";
   
}
else
{
?>
<table border="0" cellpadding="1" cellspacing="2">
<form action="<?php echo$_SERVER['PHP_SELF']; ?>" enctype="multipart/form-data" method="post">
 <tr>
  <td align="right">Vorname:</td>
  <td colspan="2"><input name="Name" size="26" type="text"></td>
 </tr>
 <tr>
  <td align="right">Nachname:</td>
  <td colspan="2"><input name="Nachname" size="26" type="text"></td>
 </tr>
 <tr>
  <td align="right">Geburtsdatum:</td>
  <td colspan="2"><input name="Geburtsdatum" size="26" type="text"></td>
 </tr>
 <tr>
  <td align="right">Wohnort:</td>
  <td colspan="2"><input name="Wohnort" size="26" type="text"></td>
 </tr>
 <tr>
  <td align="right">Telefon:</td>
  <td colspan="2"><input name="Telefon" size="26" type="text"></td>
 </tr>
 <tr>
  <td align="right">Email:</td>
  <td colspan="2"><input name="Email" size="26" type="text"></td>
 </tr>
 <tr>
  <td align="right">Größe:</td>
  <td colspan="2"><input name="Groesse" size="26" type="text"></td>
 </tr>
 <tr>
  <td align="right">Gewicht:</td>
  <td colspan="2"><input name="Gewicht" size="26" type="text"></td>
 </tr>
 <tr>
  <td align="right">Erfahrungsstand:</td>
  <td colspan="2"><select name="Erfahrung" size="1"><option>keine Erfahrung als Model</option><option>mittelere Erfahrung</option><option>Profimodel</option></select></td>
 </tr>
 <tr>
  <td align="right">&nbsp;</td>
  <td colspan="2">&nbsp;</td>
 </tr>
 <tr>
  <td align="right">mögliche Einsatzbereiche:</td>
  <td><input type="checkbox" name="Portrait" value="ON"> Portrait</td>
  <td><input type="checkbox" name="Fashion" value="ON"> Fashion</td>
 </tr>
 <tr>
  <td align="right">&nbsp;</td>
  <td><input type="checkbox" name="Dessous" value="ON"> Dessous</td>
  <td><input type="checkbox" name="Bademoden" value="ON"> Bademoden</td>
 </tr>
 <tr>
  <td align="right">&nbsp;</td>
  <td><input type="checkbox" name="Teilakt" value="ON"> Teilakt</td>
  <td><input type="checkbox" name="Akt" value="ON"> Akt</td>
 </tr>
 <tr>
  <td align="right">&nbsp;</td>
  <td colspan="2"><input type="checkbox" name="Fetisch" value="ON"> Fetisch</td>
 </tr>
 <tr>
  <td align="right">&nbsp;</td>
  <td colspan="2">&nbsp;</td>
 </tr>
 <tr>
  <td align="right" colspan="3">
<p align="left">Bist Du mit einer Veröffentlichung der Fotos in den Medien
einverstanden?</td>
 </tr>
 <tr>
  <td align="right">&nbsp;</td>
  <td colspan="2"><input type="radio" value="V1" checked name="R1"> ja&nbsp;&nbsp;
<input type="radio" name="R1" value="V2"> nein</td>
 </tr>
 <tr>
  <td align="right" colspan="3">&nbsp;</td>
 </tr>
 <tr>
  <td align="right">Anmerkungen, Fragen <br>
und Wünsche:<br>
&nbsp;</td>
  <td colspan="2"><textarea cols="21" name="Nachricht" rows="7"></textarea></td>
 </tr>
 <tr>
  <td align="right">&nbsp;</td>
  <td colspan="2">&nbsp;</td>
 </tr>
 <tr>
  <td align="right">Foto:</td>
  <td colspan="2"><input name="Anhang" size="10" type="file"></td>
 </tr>
 <tr>
  <td align="center" colspan="3">&nbsp;</td>
 </tr>
 <tr>
  <td align="center" colspan="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; <input name="Send" type="submit" value="Abschicken">    <input name="Reset" type="reset" value="Löschen"></td>
 </tr>
</form>
</table>
<?php
}

?>

</body>
</html>

But the mailer doesnt work. can someone tell me what is wrong?

Offline mawenzi

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: code problem
« Reply #1 on: June 07, 2009, 12:22:01 AM »
... wir haben ein funktionierendes Kontaktformular ...
... [MOD] Contact Form : http://www.4homepages.de/forum/index.php?topic=8987.0 ...
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline osnapicture

  • Full Member
  • ***
  • Posts: 152
    • View Profile
Re: code problem
« Reply #2 on: June 07, 2009, 12:25:02 AM »
ja ich weiß, aber ich brauche das oben von mir gepostete, weil ich da einige extra felder drin habe. das lief auch sonst immer. das kann nur einen kleinen fehler haben, den ich eben versehentlich irgendwo reingetippt habe, aber ich finde ihn leider nicht. wäre super wenn mir jemand helfen könnte

Offline mawenzi

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: code problem
« Reply #3 on: June 07, 2009, 12:51:50 AM »
... noch ein Vorschlag ...
... wie wäre es damit, dein Backup erneut hochzuladen ... ?
... btw. wer soll sich jetzt dein Snippet installieren und dann auf Fehlersuche gehen ... ? ... good luck ...
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline osnapicture

  • Full Member
  • ***
  • Posts: 152
    • View Profile
Re: code problem
« Reply #4 on: June 07, 2009, 01:12:56 AM »
wenn ich ein backup von der datei hätte, würde ich das ja machen. leider habe ich davon aber keins

Rembrandt

  • Guest
Re: code problem
« Reply #5 on: June 07, 2009, 05:34:56 AM »
Hi!
i...But the mailer doesnt work. can someone tell me what is wrong?
in der ersten zeile vielleicht:
Code: [Select]
nger = "mail@mydomain.de";
dort sollte doch:
Code: [Select]
<?php
empfaenger 
"mail@mydomain.de";
drinnen stehn, oder?

mfg Andi

Offline osnapicture

  • Full Member
  • ***
  • Posts: 152
    • View Profile
Re: code problem
« Reply #6 on: June 07, 2009, 11:45:06 AM »
Habe ich gerade probiert. Dann kommt folgende Fehlermeldung:
Parse error: syntax error, unexpected '=' in /var/www/web346/html/test3.php on line 2

Offline nobby

  • 4images Guru
  • *******
  • Posts: 2.873
    • View Profile
Re: code problem
« Reply #7 on: June 07, 2009, 12:19:06 PM »
was ist das?

Code: [Select]
</form>
</table>
<?php
}

?>

</body>
</html>

Rembrandt

  • Guest
Re: code problem
« Reply #8 on: June 07, 2009, 12:46:05 PM »
Habe ich gerade probiert. Dann kommt folgende Fehlermeldung:
Parse error: syntax error, unexpected '=' in /var/www/web346/html/test3.php on line 2
upsi, so gehoerts

$Empfaenger = "mail@mydomain.de";


sorry, aber wenn du nicht einmal das erkennst, dann solltest du wirklich die finger von sowas lassen  :D

mfg Andi