登录 | 注册 | FAQ
Anonymous

need alternative to mailto

+ 发表回复

6 篇帖子 分页: 1 / 1


need alternative to mailto

revnice » 周日 9月 14, 2014 1:28 am

I want users to select the products they want from a table using checkboxes and 'Submit' their selections such that I get an email containing their order. The problem is the html mailto instruction wants to invoke the default email client and a lot of people don't use an email client anymore.

I'm told this can be solved with php but I have no idea how. Can anyone explain or point me to an example?

Thanks - rev
头像

revnice

  • 帖子: 4
  • 注册: 周日 9月 14, 2014 1:21 am

Re: need alternative to mailto

nanoverso » 周日 9月 14, 2014 5:44 pm

In PHP this is done through the mail function, as explained in this tutorial:
http://www.w3schools.com/php/php_mail.asp
NOTICE that is not that easy, as it requires correct mail server and script configuration to avoid security problems.
头像

nanoverso

  • 帖子: 253
  • 注册: 周六 5月 10, 2014 12:08 am
  • 地址: Brazil
--
Free VST Plugins Download.

Re: need alternative to mailto

revnice » 周日 9月 14, 2014 8:40 pm

Nano:

Thanks! The example has From, Subject and Message fields, which is cool, I need all that - but the product table contains 2,300 rows and users will definitely make multiple selections via checkboxes, will the example 'understand' that, assuming I've defined the entire table as an input form?

Does the checkbox have to be next to the product name (in the same cell) or can it be in a new column on its own?

When a user makes a selection, do I get the whole row in the email by default?
头像

revnice

  • 帖子: 4
  • 注册: 周日 9月 14, 2014 1:21 am

Re: need alternative to mailto

revnice » 周日 9月 14, 2014 8:55 pm

How about a totally different approach:

Can I get users selections sent to a text file on their own machine when they press a button?

Then they could simply send me the file.
头像

revnice

  • 帖子: 4
  • 注册: 周日 9月 14, 2014 1:21 am

Re: need alternative to mailto

nanoverso » 周一 9月 15, 2014 12:43 am

About the information to process, the HTML form will send to the server the defined variable name and the values of all checked boxes. As far as I know pure HTML can´t save this info to a text file on the user machine, maybe with Javascript and user permission this is possible.
In your case I think a well designed PHP script is the best solution.
头像

nanoverso

  • 帖子: 253
  • 注册: 周六 5月 10, 2014 12:08 am
  • 地址: Brazil
--
Free VST Plugins Download.

Re: need alternative to mailto

revnice » 周三 10月 01, 2014 2:52 pm

>In your case I think a well designed PHP script is the best solution.

I'm not up to the job, can you be bribed?
头像

revnice

  • 帖子: 4
  • 注册: 周日 9月 14, 2014 1:21 am


+ 发表回复

分页: 1 / 1