Jump to content


Photo

forms?


  • Please log in to reply
14 replies to this topic

#1 Detail

Detail

    King Detail

  • Hosted
  • 7,767 posts
  • Location:Dayonic
  • Projects:Dayvi.com
  •  Blu Spy

Posted 13 August 2004 - 08:38 PM

I need a form which sends me an e-mail.

Something like:

Online Name: [______________]
Your E-mail Address: [________]
[Submit]

When thay click submit it sends that info to my e-mail address.

Does anyone know how to make these?

#2 Mastermind

Mastermind

    Server Technician

  • Undead
  • 7,014 posts
  • Location:Cambridge, MA
  • Projects:MasterNews 3
  •  The Man Behind the Curtain

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.
:laugh:
Posted Image

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.

Too cute! | Server Status: If you can read this, it's up |

#3 poedguy

poedguy
  • Members
  • 200 posts
  • Location:Perth, Western Australia
  •  One of CNC Guild's founders

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")


#4 Detail

Detail

    King Detail

  • Hosted
  • 7,767 posts
  • Location:Dayonic
  • Projects:Dayvi.com
  •  Blu Spy

Posted 14 August 2004 - 05:03 PM

If only i could use that in a practical way...

How do i get the 10 fields in the form to the <message>?

#5 Beowulf

Beowulf

    Anime Girl

  • Advisors
  • 7,217 posts
  • Projects:Red Alert X, YR: TG Redux, AR

Posted 17 August 2004 - 10:36 PM

WHat do you need? I'll make one for ya. Won't take me long. :ninja:

NZ.org | BBPCG
Discord: The Astronomer#1314
Steam


#6 Detail

Detail

    King Detail

  • Hosted
  • 7,767 posts
  • Location:Dayonic
  • Projects:Dayvi.com
  •  Blu Spy

Posted 17 August 2004 - 11:11 PM

I'm hopeing someone would give enough code that i could make my own.
That way i could add extra fields as needed.

#7 DarkDuel

DarkDuel
  • New Members
  • 59 posts
  • Location:United Kingdom

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 :ninja:
Posted Image

#8 Detail

Detail

    King Detail

  • Hosted
  • 7,767 posts
  • Location:Dayonic
  • Projects:Dayvi.com
  •  Blu Spy

Posted 18 August 2004 - 12:09 AM

:ninja: and you plan on editing that post and including the code right?
Not just saying you will supply the code and then not :)

#9 Beowulf

Beowulf

    Anime Girl

  • Advisors
  • 7,217 posts
  • Projects:Red Alert X, YR: TG Redux, AR

Posted 18 August 2004 - 04:52 AM

Well how many fields do you need? I'll write it for that and you can add and delete as necessary.

NZ.org | BBPCG
Discord: The Astronomer#1314
Steam


#10 Detail

Detail

    King Detail

  • Hosted
  • 7,767 posts
  • Location:Dayonic
  • Projects:Dayvi.com
  •  Blu Spy

Posted 18 August 2004 - 01:53 PM

I suppose if you make 1 with a text field, a tick box and a set of 3 radio buttons. Then i can recycle the code as needed.

#11 Beowulf

Beowulf

    Anime Girl

  • Advisors
  • 7,217 posts
  • Projects:Red Alert X, YR: TG Redux, AR

Posted 18 August 2004 - 02:47 PM

Okay, I'll see what I can do. You and your checkboxes will make it harder. :ninja:

But I'll work on it. :)

NZ.org | BBPCG
Discord: The Astronomer#1314
Steam


#12 Kravvitz

Kravvitz

    [X]HTML, CSS, & JS/DOM Adept

  • Members
  • 443 posts
  • Location:USA

Posted 25 August 2004 - 04:18 AM

If Fen can't do it for you, Detail, I can.

#13 Detail

Detail

    King Detail

  • Hosted
  • 7,767 posts
  • Location:Dayonic
  • Projects:Dayvi.com
  •  Blu Spy

Posted 25 August 2004 - 12:10 PM

Its been a week and he has not posted anything. Kravvitz, Please do.

If he comes back and says that he's still doing it, ignore him, as i hate people who don't do stuff untill it's going to make them look bad if thay don't do it.

#14 Tom

Tom

    title available

  • Undead
  • 8,475 posts
  • Location:UK
  • Projects:Life
  •  Co-Founder of Revora

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 Kravvitz

Kravvitz

    [X]HTML, CSS, & JS/DOM Adept

  • Members
  • 443 posts
  • Location:USA

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