Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by wishbone

  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 !
  14. Hi flydev, thank you so much for your very, very kind and elaborated answer! I feel much better now ? of course, I've read all that, and more about the honeypot technique outside pw. But again, I still have the problem to implement. what is this? can't open Edit: found your very helpful remarks only recently, in the hidden content which I couldn't open at frist Does it mean, I can't just extend the form by duplicating the structure of the input fields, sanitizing them and put them in the mail call? Anyway, I will try Ryan's solution and come back to your kind help offer if I have problems. Thank you again so much for the time you have taken on this! I really really want to learn more processwire, that's why I'm trying to do it myself. Also, I prefer raw code over modules, because they give me the freedom. Maybe once I know more about how the code works, modules can make it faster. But for now, I want to learn ?.
  15. Hi Jürgen, thank you for your help offer! Though I don't know how to send mail via wiremail or other... that's exactly my problem.
  16. I was thinking of this, of course, but Formbuilder is so overloaded! and for a small project expensive. I'm not doing too many pw-sites. Anyway, through doing it myself I try to learn, php, and processwire, and all. That's how we non-coders manage to build processwire-sites ?
  17. Hi Klenkes, thx for your idea! I even can't install it. Maybe it is not compliant with php8. And not maintained any more. And for me very difficult to understand how to modify the thml markup. (I wrote that already, but where has the post gone ? ? )
  18. Hi Gideon if the mailer takes more than the given four fields, it should not be complicated to duplicate the structure and insert the custom fields. mail($emailTo, "Contact Form", $message, "From: $form[email]"); Can I just add more custom fields? Same with wiremail
  19. nobody is talking about copy/paste 13 times. But the structure is the same if 2 or 20 fields. believe me, I've studied all these modules/ suggestions. Hours and hours and days and days. Formbuilder is overloaded for my project. Coders just can't understand non-coders, obviously. Now that's what I needed to hear, finally! It's about security concerns also. Though, Ryan uses php mail - I don't know if php mail can take more than the given fields? mail($emailTo, "Contact Form", $message, "From: $form[email]"); besides Ryan's I found just ONE more, which is told to have security issues. thx again for insinuating that I'm not searching and reading and trying to understand enough. Again, coders don't understand non-coders. They think we are just lazy ?
  20. Thank you for your sympathy ? far too complicated! I just need a simple form full code
  21. as a non-coder designer, this is what frustrates me always with processwire. If I wouldn't like it so much for it's "fluffyness" and flexibility I'd have long given up. Navigation is full code in the sample profile. But there is no contact from. A simple contact form with custom markup just to insert into a template - I can't find, except the one of Ryan which is 12 years old ? All the modules are either without custom markup, or not maintained any more, or still have issues, or are so complicated, that it's too time consuming to learn. Maybe somebody could write the code for me for money?
  22. thx but 1. "Sending emails is not part of this module" 2. seems to still have issues
  23. Was searching and searching for a complete code for a simple form - found this one from 2011 by Ryan, which is exactly what I need: So ist that still State of the Art and usable? What I need is a simple form with about 13 elements of the form: <div> <label> <span>Name</span> <input type="text" placeholder="Name" name="name" size="50" maxlength="20"> </label> </div> also a radio button with 3 values. The data of the form is to be sent to two email addresses, a confirmation that the mail has been sent - and a honeypot would be great. Since I'm a php-dunce, I need the full code... thx for advice!
  • Create New...