forms?
Started by Detail, Aug 13 2004 08:38 PM
14 replies to this topic
#2
Posted 14 August 2004 - 04:15 AM
I can do it fairly easily, I'll just need to look up the info. I'll look into it on Sunday or Monday if no one else does.
Too cute! | Server Status: If you can read this, it's up |Well, when it comes to writing an expository essay about counter-insurgent tactics, I'm of the old school. First you tell them how you're going to kill them. Then you kill them. Then you tell them how you just killed them.
#3
Posted 14 August 2004 - 04:58 PM
well it does depend on what language you are doing it in, if php then use
mail(<address to send to>, <subject>, <message>, "From: $useremail")
#7
Posted 17 August 2004 - 11:40 PM
Can't you alter what fen would give you to your own needing? by adding new fields and such... like with most things
he'll be supplying the most needed code, then you can tweak
he'll be supplying the most needed code, then you can tweak
#12
Posted 25 August 2004 - 04:18 AM
If Fen can't do it for you, Detail, I can.
#14
Posted 25 August 2004 - 03:31 PM
I have one i use to use on the guild. I'll try find it out for you.
#15
Posted 25 August 2004 - 07:18 PM
<?php $your_email = "you@example.com"; $subject = "Message via your screenname submission form"; $empty_fields_message = "<p>Please go back and complete all the fields in the form.</p>"; $thankyou_message = "<p>Thank you. Your message has been sent.</p>"; if ($_GET['action'] == "send") { $name = stripslashes($_POST['screenName']); $email = stripslashes($_POST['emailAddress']); if (empty($name) || empty($email)) { echo $empty_fields_message; } else { function valid_email($adr) { /* function by: Kravvitz 2004-07-21 This function contains a list of all currently valid top level domains Someone should probably check that this list is accurate every once in a while by looking at <http://www.iana.org/>. */ $adr = trim($adr); if(!preg_match("#^[_a-z0-9!\#$%&\'*+\/=?^`{}|~-]+(\.[_a-z0-9!\#\$\%\&\'\*\+\/\=\?\^`{}|~-]+)*@(([a-z0-9-]+\.)+(aero|biz|com|coop|info|museum|name|net|org|pro|gov|mil|edu|int|ac|ad|ae|af|a g|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br| b s|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cv|cx|cy|cz|de|dj|dk| d m|do|dz|ec|ee|eg|eh|er|es|et|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn| g p|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo| j p|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|mc|mg| m h|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr| n u|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se| s g|sh|si|sj|sk|sl|sm|sn|so|sr|st|sv|sy|sz|tc|td|tf|tg|th|tk|tl|tm|tn|to|tp|tr|tt| t v|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))$#i", $adr )) return 0; else { $array = explode("@",$adr); if(!preg_match("/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/", $array[1])) { if( $array[1] !== gethostbyname($array[1])) return 1; else return 0; } else return 1; } } // end function validate_email if(!valid_email($email)) { echo "<p>Please use a valid e-mail address.</p>"; } else { $message = "$name <$email>"; $mimeOut = "From: $name <$email> To: $your_email Date: ".date("D, d M Y H:i:s") . " UT Reply-To: $email Subject: $subject X-Mailer: PHP/".phpversion()." MIME-Version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 8bit X-Priority: 3 X-MSMail-Priority: NormalX-Mailer: PHP"; mail($your_email, $subject, $message, $mimeOut); echo $thankyou_message; } } } else { ?> <form method="post" action="<?php echo $_SERVER['REQUEST_URI']."?action=send"; ?>"> <p><label for="screenName">Your Screen Name:</label><br /> <input type="text" title="Enter your name" name="screenName"></p> <p><label for="emailAddress">Your E-mail Address:</label><br /> <input type="text" title="Enter your email address" name="emailAddress"></p> <p><label title="Send your message"> <input type="submit" value="Send"></label></p> </form> <?php } ?>
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users