Jump to content

Form / Email


Recommended Posts

Hi guys,I am currently running a website and i have made a Profile page for people to submit their profiles. When i click submit it will display a confirm box asking if they would like to submit. If 'ok' is clicked then i want to form to auto email to the webmaster email. I am stuck at the point where when they click submit it will only get it to open up outlook so they person has to send the email manually.here is my code for the <form> tag (Still havernt changed alert box to confim box).<form onsubmit="alert('Thank-You for Submitting you Profile!')" action="mailto:webmaster@ogkrc.com.au" method="post" enctype="text/plain">so my question... how can i get the form to auto-email? im pretty sure i am missing something in the action tag but i cant find out what it is.Thanks guys.Paul.

Link to post
Share on other sites

You may have to include a php script to do this work.. here is a php example which is very easy....Just change your form.html to form.php and then put this code in between your head tag

<?php if(isset($_POST['ok'])) { mail($_POST['mailTo'],$_POST['subject'],$_POST['message']); } ?>

And make your form like this:

<form method="POST">Reciepent's Email:<input type="text" name="mailTo" size="30"><br>Subject:<input type="text" name="subject" size=50><br>Message:<textarea rows="10" cols="30" name="message"></textarea><br><input type="submit" name="ok" value="Send"></form>

you can put an alert inside the form tag.

Link to post
Share on other sites

As far as I know, you need a server-side script to automatically e-mail the information to the webmaster (or whomever). The script can be pearl, cgi, php, java, etc.Setting action="mailto:webmaster@ogkrc.com.au" will always open the user's default e-mail program. For many, it will be outlook.Some web hosting companies provide you with a server-side form processing script. You may also be able to find one on the web.lugos

Link to post
Share on other sites

This has been discussed in great detail:HERECan you read through that and have any further conversation there. It will help consolidate topics.Thanks.

Link to post
Share on other sites
Guest
This topic is now closed to further replies.
×
×
  • Create New...