Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #7221 > unrolled thread
| Started by | Jack of Hearts <jack@comics.it.invalid> |
|---|---|
| First post | 2012-10-02 10:58 +0200 |
| Last post | 2012-10-02 21:25 +0000 |
| Articles | 6 — 5 participants |
Back to article view | Back to comp.lang.php
button to send an email Jack of Hearts <jack@comics.it.invalid> - 2012-10-02 10:58 +0200
Re: button to send an email Markus Sonnenberg <lassmichinruhe@rz-amper.de> - 2012-10-02 11:07 +0200
Re: button to send an email Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-02 23:01 +0200
Re: button to send an email "Beauregard T. Shagnasty" <a.nony.mous@example.invalid> - 2012-10-02 11:52 +0000
Re: button to send an email houghi <houghi@houghi.org.invalid> - 2012-10-02 21:23 +0200
Re: button to send an email "Beauregard T. Shagnasty" <a.nony.mous@example.invalid> - 2012-10-02 21:25 +0000
| From | Jack of Hearts <jack@comics.it.invalid> |
|---|---|
| Date | 2012-10-02 10:58 +0200 |
| Subject | button to send an email |
| Message-ID | <alpine.LFD.2.00.1210021051570.10492@surtur.dico.unimi.it> |
Dear all, I'm completely new to PHP but I think this is the right language to solve my problem and I hope you can help me. I want to add a form to my webpage to ask for an email address and the submit button should send to such an address a preformed email. I can write the form as <form method="POST" enctype="text/plain"> e-mail: <input type="text" name="to"> <input type="submit" value="Get Result"> </form> but I'm not able to get the data written in the form and prepare the message using such data as the To: field of the message and of course I can't send the message as well. I imagine I've to write a PHP script to put on a server but I can't write it and especially I don't know how to pass the data from the webpage to such script. Could you help me? Thank you Jack --
[toc] | [next] | [standalone]
| From | Markus Sonnenberg <lassmichinruhe@rz-amper.de> |
|---|---|
| Date | 2012-10-02 11:07 +0200 |
| Message-ID | <k4eat8$vkd$1@dont-email.me> |
| In reply to | #7221 |
On 10/2/2012 10:58 AM, Jack of Hearts wrote: > Dear all, > I'm completely new to PHP but I think this is the right language to > solve my problem and I hope you can help me. > > I want to add a form to my webpage to ask for an email address and the > submit button should send to such an address a preformed email. > > I can write the form as > > <form method="POST" enctype="text/plain"> > e-mail: <input type="text" name="to"> > <input type="submit" value="Get Result"> > </form> > > but I'm not able to get the data written in the form and prepare the > message using such data as the To: field of the message and of course I > can't send the message as well. > > I imagine I've to write a PHP script to put on a server but I can't > write it and especially I don't know how to pass the data from the > webpage to such script. > > Could you help me? > > Thank you > > Jack > this could help you. http://www.w3schools.com/php/php_mail.asp regards markus ct, -- Das Abspringen einer Begrenzungsmauer dient nicht dem direkten Zurücklegen des Arbeitsweges. http://www.rz-amper.de
[toc] | [prev] | [next] | [standalone]
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Date | 2012-10-02 23:01 +0200 |
| Message-ID | <2109088.Mq5jBlycR5@PointedEars.de> |
| In reply to | #7222 |
Markus Sonnenberg wrote: > this could help you. > http://www.w3schools.com/php/php_mail.asp W3Schools.com in its current state is the cause for massive unlearning later, and there is no indication that this could change. BTW, it has nothing to do with the W3C. Avoid it if possible. PointedEars -- Anyone who slaps a 'this page is best viewed with Browser X' label on a Web page appears to be yearning for the bad old days, before the Web, when you had very little chance of reading a document written on another computer, another word processor, or another network. -- Tim Berners-Lee
[toc] | [prev] | [next] | [standalone]
| From | "Beauregard T. Shagnasty" <a.nony.mous@example.invalid> |
|---|---|
| Date | 2012-10-02 11:52 +0000 |
| Message-ID | <k4ekh7$gi4$1@dont-email.me> |
| In reply to | #7221 |
Jack of Hearts wrote: > Dear all, > I'm completely new to PHP but I think this is the right language to > solve my problem and I hope you can help me. > > I want to add a form to my webpage to ask for an email address and the > submit button should send to such an address a preformed email. > > I can write the form as > > <form method="POST" enctype="text/plain"> e-mail: <input type="text" > name="to"> <input type="submit" value="Get Result"> </form> > > but I'm not able to get the data written in the form and prepare the > message using such data as the To: field of the message and of course I > can't send the message as well. I've always liked this example. <http://safalra.com/programming/php/contact-feedback-form/> Do be aware that your form could be used by malcontents, who could enter someone else's email address for spamming and annoyance purposes. In my email forms, I always have the form just send mail to me, then I reply manually to the visitor. This may or may not fit your needs. -- -bts -This space for rent, but the price is high
[toc] | [prev] | [next] | [standalone]
| From | houghi <houghi@houghi.org.invalid> |
|---|---|
| Date | 2012-10-02 21:23 +0200 |
| Message-ID | <slrnk6mfpu.3gs.houghi@penne.houghi> |
| In reply to | #7223 |
Beauregard T. Shagnasty wrote: > Do be aware that your form could be used by malcontents, who could enter > someone else's email address for spamming and annoyance purposes. In my > email forms, I always have the form just send mail to me, then I reply > manually to the visitor. This may or may not fit your needs. I also look at it from the users point of view and then decide what might be the best solution. At work we use several forms between departments. The advantage is that it is easy to fill out, people get the information in the same layout and this impoves effeciency. Also it avoids information being forgotten, e.g. account numbers or other information. As an Internet user, I want to have what I send in my send items. Forms does not offer me this ability. So a 'mailto' link is a better solution. It can sill fill out the subject, so it is easy to filter. You can even add your standard body. Obviously with php these can be generated and can include e.g. cookie information, so you have some way of knowing who the mail came from if that is of importance. It is also a LOT easier to do. If you do decide on forms, rather use two different forms then one that can handle two issues. See that there is as little information as possible that needs to be filled out. e.g. if people must be logged in, you do not need to ask their username or email as you mhave that already. Ask only information that is relevant and try not to have any 'free entry' text fields. The complexer they become, the more people will use it wrongly and the more counter productive they will become. http://www.alistapart.com/articles/inline-validation-in-web-forms/ is interesting as well. houghi -- How do you ask a man to be the last man to die in Iraq? How do you ask a man to be the last man to die for a mistake?
[toc] | [prev] | [next] | [standalone]
| From | "Beauregard T. Shagnasty" <a.nony.mous@example.invalid> |
|---|---|
| Date | 2012-10-02 21:25 +0000 |
| Message-ID | <k4fm3u$n4d$1@dont-email.me> |
| In reply to | #7232 |
houghi wrote: > As an Internet user, I want to have what I send in my send items. Forms > does not offer me this ability. So a 'mailto' link is a better solution. > It can sill fill out the subject, so it is easy to filter. You can even > add your standard body. Mailto: perhaps in *addition to* a form. Never *instead of* a form. (for normal public websites). Remember, with the proliferation of hotmail/gmail/ whoohoo only users, many people no longer even have a mail client for a mailto to work. -- -bts -This space for rent, but the price is high
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.php
csiph-web