forsakenmemory Posted July 22, 2007 Share Posted July 22, 2007 this is a bit od not sure why its doing this the code below works pefectly. until i add another $var to the mail($youremail, $subject, $name, $msg, "From: $email\r\nReply-to: $email\r\n"); i can change the varibles to what ever i want but if i use more then 4 the form stops working does anyone know why? ive tried loads of stuff but cant figure out why the limit is 4 <?php $youremail = "admin@xxx.com"; $thankyou = "ok.htm"; if($email == ""){ ?> No email address added. Please go back.<br/> <?php ;}elseif($name == ""){ ?> No name added. Please go back.<br/> <?php ;}elseif($message == ""){ ?> No message added. Please go back.<br/> <?php ;}else{ $msg = ereg_replace("\\\'", "'", $message); $msg = ereg_replace('\\\"', "\"", $msg); $message1 = "from: $name\nemail: $email\nmessage:\n$msg1"; mail($youremail, $subject, $name, $msg, "From: $email\r\nReply-to: $email\r\n"); ?> <meta http-equiv="refresh" content="0; url=<?echo $thankyou;?>""> <?php } ?> Quote Link to comment https://forums.phpfreaks.com/topic/61300-contact-form-problem/ Share on other sites More sharing options...
sKunKbad Posted July 22, 2007 Share Posted July 22, 2007 because mail is one of php's built in functions, and not one that you can play with. See http://www.php.net/manual/en/ref.mail.php for more information. By the way, I use a wonderful free script called tectite that I have had great success with. Absolutely ZERO spam once configured. Search yahoo for it if interested. Quote Link to comment https://forums.phpfreaks.com/topic/61300-contact-form-problem/#findComment-305018 Share on other sites More sharing options...
AndyB Posted July 22, 2007 Share Posted July 22, 2007 First, I'd suggest reading the manual on the mail() function - http://ca.php.net/manual/en/ref.mail.php Your code needs a major overhaul. $email and $message are never defined (I assume you're coding as if register_globals is ON - poor choice, and unlikely in any recent php installation. Did this originally appear in some ancient book?). $message1 appears to serve no purpose. The construct :} is one I'm not familiar with, and I can't figure out how this code ever runs without issuing syntax error messages. Quote Link to comment https://forums.phpfreaks.com/topic/61300-contact-form-problem/#findComment-305019 Share on other sites More sharing options...
forsakenmemory Posted July 22, 2007 Author Share Posted July 22, 2007 thankyou for the info on that free script yeah ill just head with that! that page didnt really help explain about the limitations of the mail function. but thank you for the advice! problem solved i guess! lol Quote Link to comment https://forums.phpfreaks.com/topic/61300-contact-form-problem/#findComment-305021 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.