Welcome to WebmasterWorld Guest from 107.21.175.43

Forum Moderators: brotherhood of lan & mack

Message Too Old, No Replies

using to actions in a form

     

infernofiasco

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

10+ Year Member



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]

broniusm

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

10+ Year Member



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
response.write(confirmation)
End
%>

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

universalis

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

10+ Year Member



<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!

infernofiasco

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

10+ Year Member



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

le_gber

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

WebmasterWorld Senior Member 10+ Year Member



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?

Leo

infernofiasco

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

10+ Year Member



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

le_gber

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

WebmasterWorld Senior Member 10+ Year Member



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:
[webmasterworld.com...]

Leo

infernofiasco

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

10+ Year Member



Do i need matts script to use that method?

le_gber

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

WebmasterWorld Senior Member 10+ Year Member



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.

Leo

infernofiasco

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

10+ Year Member



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

infernofiasco

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

10+ Year Member



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

waldemar

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

10+ Year Member



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.

universalis:

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?

infernofiasco

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

10+ Year Member



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

waldemar

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

10+ Year Member



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.

infernofiasco

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

10+ Year Member



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

infernofiasco

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

10+ Year Member



<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?

waldemar

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

10+ Year Member



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

infernofiasco

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

10+ Year Member



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

waldemar

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

10+ Year Member



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.

infernofiasco

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

10+ Year Member



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

le_gber

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

WebmasterWorld Senior Member 10+ Year Member



See ain't WebmasterWorld a perfect place ;)

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

Leo

waldemar

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

10+ Year Member



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.

Regards

infernofiasco

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

10+ Year Member



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>

 

Featured Threads

Hot Threads This Week

Hot Threads This Month