Jump to content

wishbone

Members
  • Posts

    183
  • Joined

  • Last visited

Contact Methods

  • Website URL
    http://www.wishbone-design.de

Profile Information

  • Gender
    Not Telling
  • Location
    Mannheim, Germany

Recent Profile Visitors

3,729 profile views

wishbone's Achievements

Sr. Member

Sr. Member (5/6)

37

Reputation

1

Community Answers

  1. Thx Gideon! that does the trick. ? so happy now
  2. "Fatal Error: Uncaught Error: Undefined constant "email" in \site\templates\fuehrungen.php:86" ?
  3. thx, DV-JF, for looking into this! Now Reply-To is empty... From: info@selfdomain.com Reply-To: X-Mailer: PHP/8.1.5
  4. problem how to set headers "from" correctly Important change due to DMARC-policies: If the user's email contains e.g. yahoo or hotmail, it will be rejected. -> "From" - never set user's email To be able to reply to the user's email nevertheless, set headers. $headers = 'From: info@selfdomain.com' . "\r\n" . 'Reply-To: $email' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); throws: "Reply-to: $email" (everything else is correct) tried: 'Reply-To: $form[email]' . "\r\n" . also only gives the string "$form[email]", doesn't run the code. $email is: $form = array( ... 'email' => $sanitizer->email($input->post->email), ... ); Where is my syntax error? thx again!
  5. error output works without class='error' ! Why? need that format also, your correction only works without single quotes : $input->post->email something wrong with those single quotes?
  6. thankyou thank you for looking into this! no, it's the first lines. this is Ryan's code (with more fields), error message doesn't show: $sent = false; $error = ''; $emailTo = 'abc@gmx.de'; // or pull from PW page field // sanitize form values or create empty $form = array( 'vorname' => $sanitizer->text($input->post->vorname), 'name' => $sanitizer->text($input->post->name), 'orga' => $sanitizer->text($input->post->orga), 'funktion' => $sanitizer->text($input->post->funktion), 'gruppe' => $sanitizer->text($input->post->gruppe), 'anzahl' => $sanitizer->text($input->post->anzahl), 'termin1' => $sanitizer->date($input->post->termin1, null, ['returnFormat' => 'd.m.Y']), 'termin2' => $sanitizer->date($input->post->termin2, null, ['returnFormat' => 'd.m.Y']), 'zeit' => $sanitizer->text($input->post->zeit), 'telefon' => $sanitizer->text($input->post->telefon), 'mobil' => $sanitizer->text($input->post->mobil), 'email' => $sanitizer->email($input->post->email), 'comments' => $sanitizer->textarea($input->post->comments), ); // check if the form was submitted if($input->post->submit) { // determine if any fields were ommitted or didn't validate - Ryan, alle Felder müssen ausgefüllt werden /*foreach($form as $key => $value) { if(empty($value)) $error = "<p class='error'>Please check that you have completed all fields.</p>"; }*/ // nur bestimmte required/ DSGVO if (empty($input->post->email)) $error = "<p class='error'>Bitte eine E-Mail-Adresse angeben</p>"; // if no errors, email the form results if(!$error) { $msg = "Vorname: $form[vorname]\n" . "Name: $form[name]\n" . "Organisation: $form[orga]\n" . "Funktion: $form[funktion]\n" . "Für wen: $form[gruppe]\n" . "Anzahl Personen: $form[anzahl]\n" . "Wunschtermin: $form[termin1]\n" . "Alternativtermin: $form[termin2]\n" . "Wunschzeit: $form[zeit]\n" . "Telefon: $form[telefon]\n" . "Telefon mobil: $form[mobil]\n" . "E-Mail: $form[email]\n" . "Zusätzliche Angaben: $form[comments]"; // "Kontaktart: $form[kontaktart]"; mail($emailTo, "Neue Anfrage von $form[vorname] $form[name], $form[orga]", $msg, "From: $form[email]"); // populate body with success message, or pull it from another PW field echo $page->section_text = "<h2>Vielen Dank, Ihre Anfrage wurde gesendet.</h2>"; $sent = true; } } if(!$sent) { // sanitize values for placement in markup foreach($form as $key => $value) { $form[$key] = htmlentities($value, ENT_QUOTES, "UTF-8"); } // append form if($page->section_title) { echo "<h3>{$page->section_title}</h3>"; } if($page->section_text) { echo "{$page->section_text}"; } echo <<< _OUT $error <form action="./" method="post"> <div> <label> <span>Vorname</span> <input type="text" id="vorname" name="vorname" value="$form[vorname]"> </label> </div> ... ... Ryan also checks with this method for input that doesn't validate. I also need that, don't I ?
  7. this works: if (empty($input->post->email)) $error = "<p class='error'>Bitte eine E-Mail-Adresse angeben</p>"; The form starts with: $sent = false; $error = ''; error is called here: echo <<< _OUT $error <form action="./" method="post">
  8. After thinking about the DSGVO, I need to not make all fields mandatory, only as few as possible, to mark with *required. The current code is: // sanitize values for placement in markup foreach($form as $key => $value) { $form[$key] = htmlentities($value, ENT_QUOTES, "UTF-8"); } I rtfm and this is what I came up with: $bool = $inputfield->isEmpty(); but don't know how to use it ?
  9. Thank you! like snippets in modX, where I came from? Again, I read the f** docs, but they don't help much because I'm not a coder.
  10. hurraahhh! that works! thx thx thx project saved. ? How could I have possibly found that out by myself ^^
  11. thank you so much for looking into this, Jan, but I get a syntax error ^^ form output: ?
  12. Finally, I have to give up on processwire. It's not for designers. THe community is very vivid, helpful, friendly and brave, but it seems that my problems aren't what is expected. For my current project, I'm hopeless.?
  13. Hi, php mailer mail($emailTo, "subject", $msg, "From: $form[email]"); how can I format the date output? the input field: <input type="date" id="termin1" name="termin1" value="$form[termin1]" placeholder="Wunschtermin"> the sanitizer: 'termin1' => $sanitizer->date($input->post->termin1), the php mail message call: "Wunschtermin: $form[termin1]\n" . With no format defined, unix timestamp is being outputted. If format defined in the sanitizer, always "20.10.2007" is outputted, no matter which date was picked: 'termin1' => $sanitizer->date($input->post->termin1, "d.m.Y"), if input field is formated, unix timestamps is being outputted <input type="date" id="termin1" name="termin1" value="$form[termin1]" placeholder="Wunschtermin" format="d.m.Y."> How do I do this? Thx !
×
×
  • Create New...