This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > Dreamweaver > August 2004 > Problem with a form
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Problem with a form
|
|
|
| Hi,
I made a form for my website but when I click on the submit button I don't
receive any mail at the address I stipulated in the code of the form ???
Any help, thanks :-)
P.S. By the way, I'm a beginner...
<td width="79%"><div class="style2" style=" padding-left:0px;
padding-right:20px; padding-top:0px; padding-bottom:6px">
<div align="justify" class="Style41">
<form name="form1" method="post"
ENCTYPE="plain/text" action="mailto:contact@atlantis.org">
<table width="358" border="0" cellspacing="0"
cellpadding="5">
<tr>
<td width="50" align="right"><div
align="right" class="Style68">
<div align="right">nom</div>
</div></td>
<td width="288"><input name="nom"
type="text" class="Style41" id="nom" size="30"></td>
</tr>
<tr>
<td align="right"><div align="right"><span
class="Style68">e-mail</span></div></td>
<td><input name="e-mail" type="text"
class="Style41" id="e-mail" size="30"></td>
</tr>
<tr>
<td align="right" valign="top"><div
align="right">
<p class="Style68">message</p>
</div></td>
<td><textarea name="message" cols="30"
rows="5" class="Style41" id="message"></textarea></td>
</tr>
<tr>
<td> </td>
<td><input type="image" name="imageField"
src="../_pics/_buttons/sendfrg.jpg" width="63" height="22" border="0"
onClick="MM_goToURL('parent','http://www.atlantis.org/home_fr.html');return
document.MM_returnValue">
</tr>
</table>
</form>
| |
| Murray *TMM* 2004-08-03, 7:15 pm |
| What happens when you submit it? What email client is configured on this
computer?
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
"DLock" <webforumsuser@macromedia.com> wrote in message
news:ceool8$63o$1@forums.macromedia.com...
> Hi,
> I made a form for my website but when I click on the submit button I
don't
> receive any mail at the address I stipulated in the code of the form ???
> Any help, thanks :-)
> P.S. By the way, I'm a beginner...
>
>
> <td width="79%"><div class="style2" style=" padding-left:0px;
> padding-right:20px; padding-top:0px; padding-bottom:6px">
> <div align="justify" class="Style41">
> <form name="form1" method="post"
> ENCTYPE="plain/text" action="mailto:contact@atlantis.org">
> <table width="358" border="0"
cellspacing="0"
> cellpadding="5">
> <tr>
> <td width="50" align="right"><div
> align="right" class="Style68">
> <div align="right">nom</div>
> </div></td>
> <td width="288"><input name="nom"
> type="text" class="Style41" id="nom" size="30"></td>
> </tr>
> <tr>
> <td align="right"><div
align="right"><span
> class="Style68">e-mail</span></div></td>
> <td><input name="e-mail" type="text"
> class="Style41" id="e-mail" size="30"></td>
> </tr>
> <tr>
> <td align="right" valign="top"><div
> align="right">
> <p class="Style68">message</p>
> </div></td>
> <td><textarea name="message"
cols="30"
> rows="5" class="Style41" id="message"></textarea></td>
> </tr>
> <tr>
> <td> </td>
> <td><input type="image"
name="imageField"
> src="../_pics/_buttons/sendfrg.jpg" width="63" height="22" border="0"
>
onClick="MM_goToURL('parent','http://www.atlantis.org/home_fr.html');return
> document.MM_returnValue">
> </tr>
> </table>
> </form>
>
| |
| Gary White 2004-08-03, 7:15 pm |
| "DLock" <webforumsuser@macromedia.com> wrote in message
news:ceool8$63o$1@forums.macromedia.com...
A couple of points to look at:
> <form name="form1" method="post"
> ENCTYPE="plain/text" action="mailto:contact@atlantis.org">
ENCTYPE should be "text/plain".
> src="../_pics/_buttons/sendfrg.jpg" width="63" height="22" border="0"
>
onClick="MM_goToURL('parent','http://www.atlantis.org/home_fr.html');return
> document.MM_returnValue">
Change document.MM_returnValue to true:
src="../_pics/_buttons/sendfrg.jpg" width="63" height="22" border="0"
onClick="MM_goToURL('parent','http://www.atlantis.org/home_fr.html');return
true">
Even if those changes appear to fix it, it will only fix it for some (maybe
most) users. Many others will not be able to use the form because of an
incompatible e-mail client or no e-mail client on the computer being used.
You would get much more reliable performance if you used a server side
script to process the form.
Gary
| |
|
| When I click on the submit button, I go back to the homepage (that's OK), but
the e-mail address I configured for receiving the form <contact@atlantis.org>
never receives the form...
Thanks for your help,
DL
| |
| Murray *TMM* 2004-08-03, 7:15 pm |
| What email client is configured on this computer?
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
"DLock" <webforumsuser@macromedia.com> wrote in message
news:cep17j$fk9$1@forums.macromedia.com...
> When I click on the submit button, I go back to the homepage (that's OK),
but
> the e-mail address I configured for receiving the form
<contact@atlantis.org>
> never receives the form...
> Thanks for your help,
> DL
>
| |
| DLock 2004-08-03, 11:14 pm |
| Sorry but I'm a very beginner : what means "What email client is configured on this computer?".
My website is hosted on iPowerWeb. Does it help?
Thanks,
DL
| |
| Murray *TMM* 2004-08-03, 11:14 pm |
| When you use this computer to send or receive email, what program do you
use?
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
"DLock" <webforumsuser@macromedia.com> wrote in message
news:cep2j3$h08$1@forums.macromedia.com...
> Sorry but I'm a very beginner : what means "What email client is
configured on this computer?".
> My website is hosted on iPowerWeb. Does it help?
> Thanks,
> DL
| |
| DLock 2004-08-03, 11:14 pm |
| I have a Mac, OS 10.3.4 and use Mail (Mac soft)
| |
| Murray *TMM* 2004-08-03, 11:14 pm |
| Then you are experiencing a failure of your email client to pick up on the
mailto: method that you are using. I have the same problem with Eudora on
the Mac.
This illustrates how unreliable the mailto: method actually is.
There are two basic ways to process form data -
1. Use mailto:name@domain.com as the action of the form
2. Use a server-side scripting method to a) harvest the form's data, b)
process it in some manner, e.g., enter it into a database, c) formulate and
send an email to one or more email recipients, and d) redirect the visitor
to some ending page
Method 1 is quite simple, and is also the least reliable. It depends both
on your visitor having an email client already installed on their computer -
this eliminates public computers - and on that email client responding to
the mailto call (Eudora on the Mac is a good example of one that does not).
Method 2 is the preferred method, since it eliminates the problems of method
1, but it means that you have to grapple with server-scripting somehow (ASP,
CF, PHP, perl, etc.).
So, it looks like you are doomed to use method 2. What scripting models are
supported by your site's host?
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
"DLock" <webforumsuser@macromedia.com> wrote in message
news:cep3sp$i58$1@forums.macromedia.com...
> I have a Mac, OS 10.3.4 and use Mail (Mac soft)
| |
| Murray *TMM* 2004-08-03, 11:14 pm |
| Ask them what they provide for form processing. This may be easy...
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
"DLock" <webforumsuser@macromedia.com> wrote in message
news:cepabb$nkk$1@forums.macromedia.com...
> Well, well, well ...
> Not always simple to be a Mac user... but so exciting !
> My web hoster supports PHP, ASP, SENDMAIL, PERL, but not CF.
> Does it exist a tutorial on how to create this form, according the fact
I'm a
> very beginner and that it is quite urgent ?
> Thanks for your lights Murray,
> DL
>
| |
| DLock 2004-08-03, 11:14 pm |
| Well, well, well ...
Not always simple to be a Mac user... but so exciting !
My web hoster supports PHP, ASP, SENDMAIL, PERL, but not CF.
Does it exist a tutorial on how to create this form, according the fact I'm a
very beginner and that it is quite urgent ?
Thanks for your lights Murray,
DL
| |
| Bonnie in Sacramento 2004-08-04, 7:15 pm |
| Murray *TMM* wrote:
> Ask them what they provide for form processing. This may be easy...
>
Ipowerweb.com is also my host, and it provides a version of Matt's
formmail (cgi/perl) that I have never been able to make work. I did
finally manage to get a form to sort of work yesterday using
http://apptools.com/phptools/forms/ -- though I haven't quite yet ironed
out how to get the form-filler-outer's choices conveyed to me in the
e-mail (still sorting that), I **WAS** able to get it to send me the
form, and I am a complete newbie to any kind of programming. It should
be easy if the OP only wants an e-mail, rather than a form, to get it
working using this tutorial.
--
Bonnie in Sacramento
kroko at
sbcglobal dot net
http://www.theanimalrescuesite.com/...ts/CTDSites.woa
| |
| Murray *TMM* 2004-08-04, 7:15 pm |
| Formmail works, Bonnie.
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
"Bonnie in Sacramento" <kroko@endofmyropesbcglobal.net> wrote in message
news:cer38u$sm3$1@forums.macromedia.com...
> Murray *TMM* wrote:
>
> Ipowerweb.com is also my host, and it provides a version of Matt's
> formmail (cgi/perl) that I have never been able to make work. I did
> finally manage to get a form to sort of work yesterday using
> http://apptools.com/phptools/forms/ -- though I haven't quite yet ironed
> out how to get the form-filler-outer's choices conveyed to me in the
> e-mail (still sorting that), I **WAS** able to get it to send me the
> form, and I am a complete newbie to any kind of programming. It should
> be easy if the OP only wants an e-mail, rather than a form, to get it
> working using this tutorial.
>
>
> --
> Bonnie in Sacramento
> kroko at
> sbcglobal dot net
> http://www.theanimalrescuesite.com/...ts/CTDSites.woa
| |
| Gary White 2004-08-04, 7:15 pm |
| Bonnie in Sacramento wrote:
>I haven't quite yet ironed
>out how to get the form-filler-outer's choices conveyed to me in the
>e-mail
What problem are you having?
Gary
| |
| Bonnie in Sacramento 2004-08-05, 4:14 am |
| Murray *TMM* wrote:
> Formmail works, Bonnie.
>
Maybe for you it does...I was just too stupid to figure it out, and I
think when I sent it to you you couldn't help 'cause of not doing perl,
n'est-ce pas? ;-) I could have probably gotten a tech at ipowerweb to
help me (tip to OP--call in the middle of the night, when they're not so
busy), but now that this PHP thing is on the verge of working, I think
I'll stick with it.
--
Bonnie in Sacramento
kroko at
sbcglobal dot net
http://www.theanimalrescuesite.com/...ts/CTDSites.woa
| |
| Bonnie in Sacramento 2004-08-05, 4:14 am |
| Gary White wrote:
> What problem are you having?
>
>
> Gary
I'll try to show you tomorrow, Gary, if you're interested. Since I
don't actually UNDERSTAND PHP, I'm having trouble converting the fields
in the code I copied to the fields in the form I actually need. I mean,
it's stupid to expect to be able to just copy and cut-and-paste when you
have only the vaguest idea of what the code is doing, but that's what
I'm trying to do. In the meantime, I DO have Beginning PHP4 (Choi,
Kent, Lea, Prasad, Ullman), but sometimes it's hard to take a couple of
hours to read a few chapters when you're hoping to get something UP; you
know? ;-)
--
Bonnie in Sacramento
kroko at
sbcglobal dot net
http://www.theanimalrescuesite.com/...ts/CTDSites.woa
| |
| Gary White 2004-08-05, 4:15 am |
| "Bonnie in Sacramento" <kroko@endofmyropesbcglobal.net> wrote in
message news:ces6h8$6v1$1@forums.macromedia.com...
>
> I'll try to show you tomorrow, Gary, if you're interested.
> Since I don't actually UNDERSTAND PHP, I'm having trouble
> converting the fields in the code I copied to the fields in
> the form I actually need.
Do post back. Once the light bulb blinks on, you'll see that it's
really easy.
Just a little something to get you started. Assume that your form is
using POST for the method. In the form, you have a text input named
clyde:
<input type="text" name="clyde">
In the PHP code that handles the form, you would get the value the
user entered in that input like this:
$x=$_POST['clyde'];
The variable $x now contains the value the user typed in the text
input.
To now put that value into the mail message body, just embed it in a
string:
$msgbody="The user entered $x in clyde."
When you e-mail that:
mail($toaddress,$subject, $msgbody);
Assume the user typed the word banana (for example) in the input, the
message body in the e-mail would be:
The user entered banana in clyde.
Gary
| |
| Bonnie in Sacramento 2004-08-05, 11:14 pm |
| Gary White wrote:
> Do post back. Once the light bulb blinks on, you'll see that it's
> really easy.
<snipping some useful stuff that I will try to analyze>
Thanks, Gary. I decided to try to run before I walked and went back to
lessons one and two. I tried to integrate the validation from lesson
two with the initial form in lesson one, but after I uploaded I got this
error message:
Parse error: parse error in
/mydomainename/public_html/Bonnie/phpmail.php on line 75
This is my code: line 75 is the very last line, <\html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title>Contact Form</title>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
if ($_SERVER['REQUEST_METHOD'] != 'POST'){
$me = $_SERVER['PHP_SELF'];
print <<<TOEND
<form name="form1" method="post"
action="$me">
<table border="0" cellspacing="0" cellpadding="2">
<tr>
<td>Name:</td>
<td><input type="text" name="Name"></td>
</tr>
<tr>
<td>Subject</td>
<td><input type="text" name="Subject"></td>
</tr>
<tr>
<td valign="top">Message:</td>
<td><textarea name="MsgBody"></textarea></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="Submit"
value="Send"></td>
</tr>
</table>
</form>
TOEND;
} else {
// initialize a variable to
//hold any errors we encounter
$errors = "";
// test to see if the form was actually
// posted from our form
$page = $_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
if (!ereg($page, $_SERVER['HTTP_REFERER']))
$errors .= "Invalid referer\n";
// check to see if a name was entered
if (!$_POST['Name'])
$errors .= "Name is required\n";
// check to see if a subject was entered
if (!$_POST['Subject'])
$errors .= "Subject is required\n";
// check to see if a message was entered
if (!$_POST['MsgBody'])
$errors .= "Message body is required\n";
// if there are any errors, display them
if ($errors)
echo $errors;
else {
// no errors, so we build our message
$recipient = 'kroko@mydomainname.net'; <=====this was correct
$subject = stripslashes($_POST['Subject']);
$from = stripslashes($_POST['Name']);
$msg = "Message from: $from\n\n".stripslashes($_POST['MsgBody']);
if (mail($recipient, $subject, $msg))
echo nl2br("<b>Message Sent:</b>
To: $recipient
Subject: $subject
Message:
$msg");
else
echo "Message failed to send";
}
?>
</body>
</html> <======= This is line 75.
Can you tell me where I went wrong? :-/
In the meantime I'll be pondering the banana example. Thanks a bunch!
--
Bonnie in Sacramento
kroko at
sbcglobal dot net
http://www.theanimalrescuesite.com/...ts/CTDSites.woa
| |
| Gary White 2004-08-05, 11:14 pm |
| Bonnie in Sacramento wrote:
>Thanks, Gary. I decided to try to run before I walked and went back to
>lessons one and two. I tried to integrate the validation from lesson
>two with the initial form in lesson one, but after I uploaded I got this
>error message:
>
>Parse error: parse error in
>/mydomainename/public_html/Bonnie/phpmail.php on line 75
>
>This is my code: line 75 is the very last line, <\html>
Normally, when you get an error pointing to the end of the file, it's an
indication that you have a mismatch in your {braces}. That's true in
this case. You need a closing brace here:
> echo "Message failed to send";
} // add this
>}
>?>
></body>
></html> <======= This is line 75.
Gary
| |
| Bonnie in Sacramento 2004-08-05, 11:14 pm |
| It worked great with that bracket fix: however, the sending is showing
up in my e-mail as "nobody." When I have analyzed the banana example,
will I know what to change so it take the input from the name the user
types in?
--
Bonnie in Sacramento
kroko at
sbcglobal dot net
http://www.theanimalrescuesite.com/...ts/CTDSites.woa
| |
| Bonnie in Sacramento 2004-08-05, 11:14 pm |
| Gary White wrote:
> Normally, when you get an error pointing to the end of the file, it's an
> indication that you have a mismatch in your {braces}. That's true in
> this case. You need a closing brace here:
>
>
>
>
> } // add this
>
>
>
>
>
>
> Gary
Thanks again, Gary! Damn, you're fast!! :-D I'll keep you posted.
--
Bonnie in Sacramento
kroko at
sbcglobal dot net
http://www.theanimalrescuesite.com/...ts/CTDSites.woa
| |
| Gary White 2004-08-05, 11:14 pm |
| "Bonnie in Sacramento" <kroko@endofmyropesbcglobal.net> wrote in
message news:ceuft4$rcs$1@forums.macromedia.com...
> It worked great with that bracket fix: however, the sending is
showing
> up in my e-mail as "nobody." When I have analyzed the banana
example,
> will I know what to change so it take the input from the name the
user
> types in?
No. The "from" name/address are done with a message header. Lesson 5
actually deals with sending attachments, but the first part of the
lesson shows adding a header that does what you want. See:
http://apptools.com/phptools/forms/forms5.php
That example has the "from" address hard coded. When you have analyzed
the banana example, you'll understand how to use that to place the
user entered information in the from name/address.
Gary
| |
| Bonnie in Sacramento 2004-08-05, 11:14 pm |
| So, Gary, I changed the form to have this line:
<td><input type="text" name="Name"></td>
where "Name" is like Clyde in your example. Then I added the $x thingie
here:
// no errors, so we build our message
$x=$_POST['Name'];
$recipient = 'kroko@sbcglobal.net';
and then put the string you said to embed here:
$msg = "Message from: $from\n\n".stripslashes($_POST['MsgBody']);
$msgbody="The user entered $x in Name."
if (mail($recipient, $subject, $msg))
echo nl2br("<b>Message Sent:</b>
Is that how it should work?
--
Bonnie in Sacramento
kroko at
sbcglobal dot net
http://www.theanimalrescuesite.com/...ts/CTDSites.woa
| |
| Gary White 2004-08-06, 4:15 am |
| "Bonnie in Sacramento" <kroko@endofmyropesbcglobal.net> wrote in
message news:ceukat$1ag$1@forums.macromedia.com...
You're mixing two different examples and not quite hooking them
together.
$x=$_POST['Name'];
$recipient = 'kroko@sbcglobal.net';
$msgbody="The user entered $x in Name."
$msgbody.="\n\n".$_POST['MsgBody'];
if (mail($recipient, $subject, $msgbody,"From: $x\r\n"))
echo "<b>Message Sent:</b>";
Gary
| |
|
| Hi,
I'd recommend that you take a look at FormBreeze
(http://www.formbreeze.com). We use this for all our forms and it is
the best solution I have seen with capabilities way beyond formmail
scrips.
Bonnie in Sacramento <kroko@endofmyropesbcglobal.net> wrote in message news:<ces5r5$658$1@forums.macromedia.com>...
> Murray *TMM* wrote:
> Maybe for you it does...I was just too stupid to figure it out, and I
> think when I sent it to you you couldn't help 'cause of not doing perl,
> n'est-ce pas? ;-) I could have probably gotten a tech at ipowerweb to
> help me (tip to OP--call in the middle of the night, when they're not so
> busy), but now that this PHP thing is on the verge of working, I think
> I'll stick with it.
| |
| .: Nadia :.TMM :. 2004-08-08, 12:14 pm |
| After reading a handful of exactly the same response from you to any form
question on the forum, this definitely sounds like an advert of some kind.
................
--
Nadia
Team Macromedia Volunteer for Dreamweaver
---------------
http://www.DreamweaverResources.com
Free Templates | Free Nav Bar Sets
Dropdown Menu Designs | CSS Layouts
Ecommerce - YVStore | SEO Articles
Table Tutorials | Background image Tutorials
------------------------------------------------
MM Dreamweaver Tutorials
http://macromedia.com/devnet/mx/dreamweaver/
-----------------
"MF" <seeker79@yahoo.com> wrote in message
news:92ea3c9a.0408071413.63f8a5ad@posting.google.com...
> Hi,
>
> I'd recommend that you take a look at FormBreeze
> (http://www.formbreeze.com). We use this for all our forms and it is
> the best solution I have seen with capabilities way beyond formmail
> scrips.
>
>
> Bonnie in Sacramento <kroko@endofmyropesbcglobal.net> wrote in message
news:<ces5r5$658$1@forums.macromedia.com>...[color=darkred]
|
|
|
| | Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |
|