homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / WebmasterWorld / New To Web Development
Forum Library, Charter, Moderators: brotherhood of lan & mack

New To Web Development Forum

using to actions in a form

 3:26 pm on Jul 15, 2003 (gmt 0)

Iam trying to send an email and move to a confirm page:

<form name="form1" method="post" action="mailto:someone@example.com"&"confirm.htm">

Is this possible? If not what can I do to get this to work

[edited by: Woz at 9:56 am (utc) on July 21, 2003]
[edit reason] examplified form [/edit]



 3:52 pm on Jul 15, 2003 (gmt 0)

creative, but I've never heard of it..

best bet, from my experience, is to set up a serverside emailer (PHP or ASP both have free ones avail), and in that email script, redirect to the confirmation.

Better yet, do this:

' Pseudo code:
If request.querystring("action").value="email" Then

<form method="post" action="">
<input type="hidden" name="action" value="email">
...email form...


 5:20 pm on Jul 15, 2003 (gmt 0)

<form name="form1" method="post" action="mailto:(snip)"

This kind of form using only a mailto: link won't work in newer browsers, including IE6, so you will need to use a formmail-type script (written in perl, php, ASP, or whatever) to send the information. There are loads of prewritten scripts available, and most of them allow you to define the confirmation page in a hidden field.

Oh yes, and welcome to WebmasterWorld infernofiasco! You should consider editing your post to remove your email address, as it is against the terms of service and, whats more, leaving it there would be a sure-fire way of getting an mailbox full of spam!


 8:11 am on Jul 16, 2003 (gmt 0)

Basically the host iam using doesnt support php or asp, this is why i have had to use this approach! thanks though :)


 8:17 am on Jul 16, 2003 (gmt 0)

infernofiasco what about cgi-bin/perl? Most forms handlers are written in this and most ISP's can provide you with either a working CGI bin folder OR one of their own script to handle forms. Have you asked them?



 8:28 am on Jul 16, 2003 (gmt 0)

To be honest i have never used cgi/perl, so i wouldnt know where to start :(


 8:38 am on Jul 16, 2003 (gmt 0)

There is script already written for you all you have to do is add fields in the form to tell the form handler were to send you the form, were to send the visitor once the form has been sent, if there was mandatory fileds, not to send the form before they were filled in ... it's really easy

have a look here:



 8:59 am on Jul 16, 2003 (gmt 0)

Do i need matts script to use that method?


 9:14 am on Jul 16, 2003 (gmt 0)

yes but it's free and already configured.

Have a look for nms scripts on google and select a form handling one. The nms scripts seems to be more secure against spam.



 9:23 am on Jul 16, 2003 (gmt 0)

Thanks for your help, but its went straight over my head! iam going to try and find something in vbscript or javascript so it client side :)


 11:09 am on Jul 16, 2003 (gmt 0)

right iam gonna attempt to use a script, do i place the script in a cgi-bin directory beside my index file?


 11:20 am on Jul 16, 2003 (gmt 0)

do i place the script in a cgi-bin directory beside my index file

Usually yes.
It also might be neccessary to edit the "attributes" of the script executeables. The command is called "chmod" is available in most ftp-programs (check the context menu when you right click a file on the server). You need to get a chmod number of --> 755 <-- to not receive a server error when you call the page.

if with "index file" you mean your starting page like index.htm... -> that one should not go in a cgi-bin folder, but in the root or elsewhere.

This kind of form using only a mailto: link won't work in newer browsers, including IE6

...Using only a mailto: link won't work in..... whaat?


 11:26 am on Jul 16, 2003 (gmt 0)

I changed my chmod to 755, created a directory called cgi-bin on my ftp, just starting to edit script to work! (hopefully)


 11:30 am on Jul 16, 2003 (gmt 0)

created a directory called cgi-bin on my ftp

Unless you are working in your own server environment (there is some more configuration neccessary to make that folder work) you should check your Web Hoster for an already existing cgi-bin directory. Usually hosters allow execution only in those predefined folders.


 11:33 am on Jul 16, 2003 (gmt 0)

there wasnt one, i cant seem to get hold of my host to find out! so iam going to try anyway


 11:39 am on Jul 16, 2003 (gmt 0)

<form name="form1" method="post" action="">

<input type="hidden" name="subject" value="enquiry from MCC Website">
<input type="hidden" name="recipient" value="scarr@mcclimited.co.uk">
<input type="hidden" name="required" value="form1">
<input type="hidden" name="redirect" value="../confirm.htm">

i have typed this in my index.htm, do i need to declare the script anywhere in the html?


 11:40 am on Jul 16, 2003 (gmt 0)

Just check them online technical documents (look for cgi or perl, etc.).
If this is a lower-budget hosting though, there might be the chance you can not upload your custom scripts.

Other possibility could be using php which - again usually - is not restricted to run in a certain directory.

<form name="form1" method="post" action="">

Yes, the scripts (path and) name is the *action*, like action="/cgi-bin/mailerscript.pl".


 11:54 am on Jul 16, 2003 (gmt 0)

is there a java/vb script that allows the "mailto:" command?


 12:01 pm on Jul 16, 2003 (gmt 0)

Well, I don't know what universalis meant... but you could try something like:

<a href="mailto:EMAILADDRESS" onclick="window.location= 'NEWWEBPAGE.HTML'">The Link</a>

Won't work for forms though.


 1:20 pm on Jul 16, 2003 (gmt 0)

I switched it around and got it to work perfectly! thank you :)


 1:36 pm on Jul 16, 2003 (gmt 0)

See ain't WebmasterWorld a perfect place ;)

I am, as probably every other people here, glad I could be of help



 2:08 pm on Jul 16, 2003 (gmt 0)

Of course, you're mostly welcome.

Still, consider experimenting with that cgi/perl/php stuff - you won't believe what you can achieve with this so called "server-side-scripting". And it's rather easy too; check out some scripts, try to get them work, manipulate them to your desires...
A JavaScript solution has some drawbacks: (1) What if somebody has JavaScript deactivated? (2) So called Email-Harvester check websites for valid email-addresses (like in the mailto:) to add them into their spam-lists.



 3:36 pm on Jul 16, 2003 (gmt 0)

Ive just started using .asp, so iam a bit rough on all fronts (html included) so hopefully with help from the likes of this community i should be well on my way to discovering all the cool stuff to achieve! :) thanks again

Oh it ended up as:

<a href="confirm.htm" onclick="javascript:form1.submit()">Send</a>

Global Options:
 top home search open messages active posts  

Home / Forums Index / WebmasterWorld / New To Web Development
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved