"form" works but want a bit more to happen

L

Leif K-Brooks

....D. said:
I made a table with form entries in it. I used the "mailto" code to send
the results to. It works fine, for what it does.

Generally a bad idea on the Web. Even when your user has a
properly-configured email client -- not a safe bet -- you still have to
worry about Web browsers which don't know how to handle mailto: form
actions, which is a lot of them.
2nd - Is there a way to have HTML code automatically send a specific email
back to the submitter's email address after a successful submission? If
not HTML - then what?

You'll want to use a server-side script to handle the form instead of a
mailto: action. Your host will have to support this first; look for PHP,
CGI, or (ick!) ASP in the feature list. Two relevant links:

http://php.net/mail
http://www.phpfreaks.com/quickcode/code/151.php


If it is any help at all, here is the HTML table code used in the form.
Maybe you can fill in what I need if it is possible with HTML:

<snip large code>

In the future, please try to provide a link instead of including lengthy
code snippets in email.
 
D

...D.

I made a table with form entries in it. I used the "mailto" code to send
the results to. It works fine, for what it does.

But how do I take this a step further? I'd like it to do two additional
things.

(OK, I'll add this right here now. A request - if all you are going to
do is to refer me to a vast web page somewhere, and you're basically
telling me to look it up for myself, well, thanks for the effort, but
please don't reply with such, unless it is very specific and real easy to
find my answer on.)

1st - I only know it works in my Outlook Express, and here's how: after
I click the "submit" button, a little window comes up and says something
like it is going to send the "email to:" (it is empty here, that's ok) and
the "from:" is working. And I click to send, and it sends. quickly it
sends - I know it has sent, even seeing a little bar or graph thingy (I
think) but it happens so fast, and I am sitting there at the same form
page. Or I can look in OE and into it's "sent" folder, and see that it
was sent successfully (and to who). But I'd like more to happen: It would
be great if it would say something like "Thank you. Your submission has
been sent" after it was sent of course, or, somehow maybe automatically
redirects the submitter to the website's home page after the email
submission was sent. How would I do this - possible with HTML? Or do I
need to do something else.

2nd - Is there a way to have HTML code automatically send a specific email
back to the submitter's email address after a successful submission? If
not HTML - then what?

In your experiences, do all different email programs, or if no email
program, then how, through a email web page? - well do they all work with
a standard "form", or are some people left out when trying to submit to a
"mailto"?

If it is any help at all, here is the HTML table code used in the form.
Maybe you can fill in what I need if it is possible with HTML:

<table width="400" border="0" cellspacing="0" cellpadding="1"
align="center">
<tr><td colspan="2">&nbsp;
</td></tr>
<tr>
<form enctype="text/plain" action="mailto:[email protected]"
method="post">
<td class="body"><b>Subject:</b></td>
<td>
<SELECT NAME="subline">
<OPTION VALUE="More Information">More Information
<OPTION VALUE="Schedule a Site Inspection">Schedule a Site
Inspection
</SELECT>
</td></tr>
<tr><td class="body"><b>First Name:</b></td>
<td><INPUT NAME="first" TYPE=TEXT SIZE=30> <b>*</b>
</td></tr>
<tr><td class="body"><b>Last Name:</b></td>
<td><INPUT NAME="last" TYPE=TEXT SIZE=30> <b>*</b>
</td></tr>
<tr><td class="body"><b>E-mail Address:</b></td>
<td><INPUT NAME="email" TYPE=TEXT SIZE=30> <b>*</b>
</td></tr>
<tr><td height="20" class="body"><b>Phone:</b></td>
<td height="20"><INPUT NAME="phone" TYPE=TEXT SIZE=30> <b>*</b>
</td></tr>
<tr><td class="body"><b>Fax:</b></td>
<td><INPUT NAME="fax" TYPE=TEXT SIZE=30>
</td></tr>
<tr><td class="body"><b>Company:</b></td>
<td><INPUT NAME="company" TYPE=TEXT SIZE=30>
</td></tr>
<tr><td class="body"><b>Street:</b></td>
<td><INPUT NAME="street" TYPE=TEXT SIZE=30>
</td></tr>
<tr><td class="body"><b>City:</b></td>
<td><INPUT NAME="city" TYPE=TEXT SIZE=30>
</td></tr>
<tr><td class="body"><b>State:</b></td>
<td><INPUT NAME="state" TYPE=TEXT SIZE=30>
</td></tr>
<tr><td class="body"><b>Zip:</b></td>
<td><INPUT NAME="zip" TYPE=TEXT SIZE=30>
</td></tr>
<tr><td valign="top" class="body"><b>Comments:</b></td>
<td><TEXTAREA NAME="comments" TYPE=TEXT ROWS="7" COLS="34"></TEXTAREA>
</td></tr>
<tr><td><INPUT TYPE=SUBMIT VALUE="Submit"></td>
<td>&nbsp;</td>
</form></tr>
<tr><td>&nbsp;</td><td class="body">(Note: "<b>*</b>" above denotes
a required field)
</td></tr>
<tr><td colspan="2">&nbsp;
</td></tr></table>

---end

...D.
 
H

Hywel Jenkins

I made a table with form entries in it. I used the "mailto" code to send
the results to. It works fine, for what it does.

Wrong, wrong wrong. mailto: as a form action doesn't work. Google for
the reasons why.
 
B

Bernhard Sturm

Hywel said:
Wrong, wrong wrong. mailto: as a form action doesn't work. Google for
the reasons why.

Unfortunately it does. If you specify in the action attribute something
else than a URL then this is not defined (as stated by the W3C). So it's
up to the clients UA to fill in a non-defined behaviour, and IE does
allow explicitly to add a mailto: in the action attribute (see m$
knowledge base for more info about this behaviour). I know: not very
cool, but IE was designed to allow this (and it's not in breach with
W3C, as it's simply not defined by W3C.. so some sort of a greyish
specification). And please don't flame me for stating this... :)

bernhard
 
H

hyweljenkins

Bernhard said:
Unfortunately it does. If you specify in the action attribute something
else than a URL then this is not defined (as stated by the W3C). So it's
up to the clients UA to fill in a non-defined behaviour, and IE does
allow explicitly to add a mailto: in the action attribute (see m$
knowledge base for more info about this behaviour). I know: not very
cool, but IE was designed to allow this (and it's not in breach with
W3C, as it's simply not defined by W3C.. so some sort of a greyish
specification). And please don't flame me for stating this... :)

To me, "work" means that the form will submit regardless of the user's
system configuration with reasonably predictable results, whether they
have a mail client or not.
 
B

Bernhard Sturm

To me, "work" means that the form will submit regardless of the user's
system configuration with reasonably predictable results, whether they
have a mail client or not.

Hmm that's okay for you, but there are a lot of cases where you would
talk of a 'working' action attribute, but in reality it simply fails.
E.g. I know of some sites where you have to submit your login details,
and then the page redirects you to a page responding only on port 2082
(CP panel for instance) or whatever... this does not 'work' here, as I
sit behind a firewall (and I don't have the permission to open any ports
on the firewall). I don't even get an error message from the page. It's
just a pain, and an ordinary user would never find out what the problem
actually is. He would claim: 'The site is 'poorly' programmed, and they
know shit about the users needs and usability' (and he would be right).
But the action attribute is perfectly 'legal' and according to the
specs... So your definiton of 'working' is always different for someone
else. In the just quoted example I wouldn't even call the original W3C
definiton as 'working' :)
BTW: we don't know what the OP really wants (if s/he is working on a
intranet solution this might just do the trick for his/her purposes).
However, I wouldn't use the mailto: for anything on a website.
 
H

Hywel Jenkins

Hmm that's okay for you, but there are a lot of cases where you would
talk of a 'working' action attribute, but in reality it simply fails.
E.g. I know of some sites where you have to submit your login details,
and then the page redirects you to a page responding only on port 2082
(CP panel for instance) or whatever... this does not 'work' here, as I
sit behind a firewall (and I don't have the permission to open any ports
on the firewall).

That's a completely different issue, and there are probably reasons why
you shouldn't be trying to access CPanel in that example.
 
B

Bernhard Sturm

Hywel said:
That's a completely different issue, and there are probably reasons why
you shouldn't be trying to access CPanel in that example.

LOL. I am the owner of the website hosted by a host using CPanel. I pay
for the usage of it. Now you tell me, that's a good reason not to use
it... (see this happens, if you have no clue about your users settings
and environment. I am not going to explain to you why we don't let
anybody tamper with the firewall settings, just assume, that we have our
reasons).
Why is this a different issue? Obviously my clients environment is set
up in such a way that I don't get the response from certain ports (and
there are good reasons for this). No my point is this: as a webdesigner
you never know in what environment your users are. You can design
according to the specs and you will still run into a problem. Be it: you
are using mailto: and your users don't have set up a mail client, be
it you use a port which is blocked by a firewall. Now I suggest: tell
the users what will happen. In both cases. If you have good reasons to
use the mailto: in your action attribute, then inform the user before
they will hit the send button what will happen. The same goes for the
port URL: tell your audiance that in some circumstances it will not
work... IMHO both cases are similar.
 
H

Hywel Jenkins

LOL. I am the owner of the website hosted by a host using CPanel.

Me too. Several, in fact.
I pay for the usage of it. Now you tell me, that's a good reason not to use
it... (see this happens, if you have no clue about your users settings
and environment. I am not going to explain to you why we don't let
anybody tamper with the firewall settings, just assume, that we have our
reasons).

Why do your firewall settings affect your users? If you're running the
firewall on which the CPanel stuff is located on, and your users can't
access that because it's behind *your* firewall that's blocking port
XXXX, then your users need to find another host. OTOH, if the CPanel
stuff is hosted elsewhere, by another company, and the SysAdmin at your
location is blocking the CPanel ports, then perhaps *he* has good reason
to block those ports. For example, at home I can access CPanel no
problem; at work, I can't because the SysAdmins there allow HTTP over a
few ports only, and CPanel isn't running on the ports I can connect
through.

Why is this a different issue?

What's the "mailto:" issue? The fact is, regardless of whatever
settings you or your user has, the browser attempts to submit the form
data. That it can't connect to the server because of port blocking is
not the point. With mailto, that's not a given.
 
B

Bernhard Sturm

Hywel said:
For example, at home I can access CPanel no
problem; at work, I can't because the SysAdmins there allow HTTP over a
few ports only, and CPanel isn't running on the ports I can connect
through.

so you gave yourself the answer.. it's as easy as this. we have a very
paranoid firewall setting here and lived quite undisturbed, and we would
like to keep it this way. (there are other ways to bypass a firewall,
but I am not going to reveal them here, OT).
What's the "mailto:" issue? The fact is, regardless of whatever
settings you or your user has, the browser attempts to submit the form
data. That it can't connect to the server because of port blocking is
not the point. With mailto, that's not a given.

don't forget that UAs are built by companies like M$. If they decide to
implement the mailto: feature in their UA, then the UA will not try to
connect ot a server, but instantly fire up the registered mail client.
see:

http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/action.asp
and
http://support.microsoft.com/?kbid=279460
 
T

Toby Inkster

Bernhard said:
LOL. I am the owner of the website hosted by a host using CPanel. I pay
for the usage of it.

If you're behind a firewall without permission to open ports, then you are
almost certainly at work/school, and operating that website via their
network may be against their policies.

If you are running the website *for* the company/school, then the internal
IT bod ought to be able to open port 2002 to just that one IP address with
virtually no security problems.

If you are running the website privately, in your lunch hour, and this is
not against your company's/school's policies, then buy your internal IT
bod a beer at Friday lunch time, and he'll open the port for you.
 
B

Bernhard Sturm

Toby said:
If you are running the website privately, in your lunch hour, and this is
not against your company's/school's policies, then buy your internal IT
bod a beer at Friday lunch time, and he'll open the port for you.

okay.. I am going to reveal here our companies policies... my god. Stop
guessing things if you don't know the circumstances. But once and for all:
We have work in a multicompany environment. There are 4 different
offices sharing the same infrastructures and working in a networked
environement (human resources as well as other resources):
(http://www.daszeichen.ch / http://www.lernetz.ch /
http://www.adrianos.ch / http://www.optimedium.ch) We have the policy
that our firewall is set up with the following default rules: all ports
closed besides the standard http/ftp/mail ports. This is important as we
have a lot of freelancers working from time to time in our offices. So
it's a very open environment here. If I am going to use a port which is
not opened by the firewall I have a physically isolated machine which is
allowed to bypass the firewall.

So now I hope the guessing will stop and you see that not everything in
the world is not only set up according to scheme A.

bernhard
 
T

Toby Inkster

Bernhard said:
okay.. I am going to reveal here our companies policies... my god. Stop
guessing things if you don't know the circumstances.

I'm pretty sure the beer thing will still work.
 
B

Bernhard Sturm

Toby said:
I'm pretty sure the beer thing will still work.

I am the boss of the company ;-) The guy from the IT department does his
job without being bribed with beer ;-)
But we are drifting OT here (as we always do) cheers mate!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top