Submit Button?

  • Shadow Knight
  • Professor
  • Professor
  • User avatar
  • Posts: 948
  • Loc: Soy Cubano, no puedo ser diferent!!

Post 3+ Months Ago

hey everyone how are you all....?
well once again I have got another question.... :oops:
well you see Im putting a form in my page and so I want it to be that when someone hits the summit butom the info will go to my email....
can you tell me the coding for that?
thanks a lot you all, see ya


Shadow Knight 8)
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Scorpius
  • Proficient
  • Proficient
  • User avatar
  • Posts: 401
  • Loc: Scorpion Hole

Post 3+ Months Ago

Well first of all there is no way to do this in every browser. IE can send a form easily but it will make it hard to read by most people. Mozilla will start the submitter's default E-mail client open to send an E-mail, or if you have something like PHP or Perl installed on your server the server can do it all for you.
Please reply with what scripting languages your server supports, PHP, Perl, ASP, etc.
  • _Leo_
  • Proficient
  • Proficient
  • User avatar
  • Posts: 279
  • Loc: Buenos Aires, Argentina

Post 3+ Months Ago

Which script language are you going to use?
  • Shadow Knight
  • Professor
  • Professor
  • User avatar
  • Posts: 948
  • Loc: Soy Cubano, no puedo ser diferent!!

Post 3+ Months Ago

well I Dont know much about scripts languages, I just started to do pages in my own withou any clases, Im using Macromdia Dreamweaver MX 2004, I suppose its html coding... and my server supports some script languages such as PHP, Perl/CGI, and some more)
  • Scorpius
  • Proficient
  • Proficient
  • User avatar
  • Posts: 401
  • Loc: Scorpion Hole

Post 3+ Months Ago

Ok, well if your server is a Linux server, and has PHP you probably have sendmail already installed on it. PHP has the mail() function built into it.
You could use something like the following in a .php page that the form would Post the data to.

You would have to submit your form to processform.php
You could use something of the following:
Code: [ Select ]
<form method="POST" action="processform.php" name="Test Form">


Code: [ Select ]
// file processform.php
$recipient = "user@host.com"; // Where you want the form to send the mail to, usually your E-mail.
$subject = "Test"; // You could have this as the form name or just something to remind you of what the information is for.
$information = "$_POST[field1]<br>$_POST[field2]<br>etc"; // Here is where you have to include all the fields from the form. You would use $_POST[] to get the posted values. You can format this how you want and depending on your E-mail client it may show the actual HTML or it may format it correctly so its easy readable by you.
$header = "From: webmaster@yourhost.com" // This is who the E-mail would say it was from, unless they looked at the full header information.

if(!mail($recipient, $subject, $information, $header)) {
echo "Your form has had an error please resubmit.";
} else {
echo "You form has been successfully submitted, thank you.";
}
  1. // file processform.php
  2. $recipient = "user@host.com"; // Where you want the form to send the mail to, usually your E-mail.
  3. $subject = "Test"; // You could have this as the form name or just something to remind you of what the information is for.
  4. $information = "$_POST[field1]<br>$_POST[field2]<br>etc"; // Here is where you have to include all the fields from the form. You would use $_POST[] to get the posted values. You can format this how you want and depending on your E-mail client it may show the actual HTML or it may format it correctly so its easy readable by you.
  5. $header = "From: webmaster@yourhost.com" // This is who the E-mail would say it was from, unless they looked at the full header information.
  6. if(!mail($recipient, $subject, $information, $header)) {
  7. echo "Your form has had an error please resubmit.";
  8. } else {
  9. echo "You form has been successfully submitted, thank you.";
  10. }


Hope that will help you out some.
  • Tannu4u
  • Proficient
  • Proficient
  • User avatar
  • Posts: 480
  • Loc: India

Post 3+ Months Ago

<?

//After each header we have to give '/r/n' so that the format of the mail
//is maintained else the mail subject will be sent as an
//attachment to the reciepent.

$mail_subject=$subject;

$mail_from="amityadav@programmer.com";
$mail_bcc =$bcc;
$mail_cc =$cc;

$mail_to = $to;
$mail_reply_to ="asdf@yahoo.com";

$mail_headers = "Content-type: image/gif; charset=iso-8859-1\r\nFrom:$mail_from\r\nReply-to:$mail_reply_to\r\nBcc:$mail_bcc\r\nCc:$mail_cc";

//This function removes backslashes from the string passed to it.
$body=stripslashes($dataval);

$mail_body=$body;
echo "the value of the data is ".$body;

if(@mail($mail_to, $mail_subject, $mail_body, $mail_headers))
{
echo "The mail has been successfully send to".$to;
?><a href="">Send another mail</a>"<?
}
else
{
echo "Sorry unable to send mail";
}
?>
  • cipher
  • Graduate
  • Graduate
  • User avatar
  • Posts: 157

Post 3+ Months Ago

hey Tannu4u is it just coincidental that everyone in the east codes in php. cuz i have these friends in sri lanka and thats all they code in.

by the way Shadow Knight since your server supports php use it. people say its the easiest of the scripting language so that should motivate you, once you get the hang of it you will see how powerful it will make you as a web designer/developer.
  • Tannu4u
  • Proficient
  • Proficient
  • User avatar
  • Posts: 480
  • Loc: India

Post 3+ Months Ago

no cipher its true that i love coding in PHP but ur thinking is not correct i am currently working in ASP MYSQL platform and have completed two project.I am doing MCA (Master of computer science) and i am in my last sem doing training.Coding in PHP is very easy and the development time is less compared to other language.One more thing the popularity of open source make PHP more favourable to me.I am intrested in internet programming and want to learn a lot.Bye.....

Post Information

  • Total Posts in this topic: 8 posts
  • Users browsing this forum: ScottG and 96 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.