Jump to content

Leaf

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Everything posted by Leaf

  1. Hi jcbones Very nice, thanks. Works perfectly. Only one question left on something I am not sure. The strip_tags thing at the start. Is this only for the $headers thing or should I add it for all the variables in the $message array (hope that's the correct term .. didn't want to use "thing" everytime ..) too? It works without them too but just to be on the save side. greetings
  2. Hi My PHP knowledge is very very small. This code was written for me by a friend but everytime I ask him for help I end up being more confused then I was anyways . It was working perfectly until I changed my webspace to another provider. <?php if ($email == "") { require_once ("xyz1.html"); } else { $pos = strrpos($email, "@"); if ($pos != false) { $to = "email@address.com"; $headers = "From: \"".$name."\"<".$email.">\n"; $message = " \n Name: $name , ..."; $sent = mail ($to, mailheadersubject, $message, $headers); require_once ("send.html"); } else { require_once ("xyz2.html"); } } ?> ... and the HTML part: <form action="send.php" method="GET"> Apart from that it's just a normal HTML contact form. As I said nothing has changed exepct the provider, so my only guess would be that the problem is that part of this code doesn't work as it used to on a newer version of PHP. What it did was - as you probably see in the code anyway - checking if there was something written in the contact form where you put in your email, else show xyz1.html , then checking if there is a "@" in the email address and if there is send the email, if not posting the xyz2.html. Now it always shows the xyz1.html, no matter what is written in the email part of the contact form. I hope there is a small simple solution to the problem, but I'm grateful for any help I can get greetings
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.