Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#49 2009-01-18 18:07:02

oliverker
Plugin Author
From: Huddersfield
Registered: 2008-07-14
Posts: 90
Website

Re: mem_form - Generic HTTP form processing

johnstephens wrote:

I think the plugin you need is sed_afu.

What will this do?

Offline

#50 2009-01-18 18:10:38

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: mem_form - Generic HTTP form processing

Sorry, I should have linked to the descriptive forum thread of this plugin rather than the request page. sed_afu allows guests to upload files to your server through a form. AFU = Anonymous File Upload.

+EDIT: I realize that the link above isn’t the support thread for sed_afu, but I can’t find it

Last edited by johnstephens (2009-01-18 18:15:16)

Offline

#51 2009-01-18 18:23:39

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,436
Website GitHub

Re: mem_form - Generic HTTP form processing

johnstephens wrote:

I realize that the link above isn’t the support thread for sed_afu, but I can’t find it

Because there isn’t one :-)

It’s a semi-unofficial, semi-unsupported plugin due to its potential to be misused and blow things up on your server.

oliverker

You can request a copy of the plugin by dropping net-carver an e-mail, mentioning what you are trying to do.

Last edited by Bloke (2009-01-18 18:24:05)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#52 2009-01-18 18:58:57

oliverker
Plugin Author
From: Huddersfield
Registered: 2008-07-14
Posts: 90
Website

Re: mem_form - Generic HTTP form processing

This seems all a bit complicated to just attach a file to a form that will sent in an email me.
There are plenty of PHP scripts out there that I think can do this, I was after one that has been designed for TXP.

Should I attempt a PHP script like this instead?

Oli

Offline

#53 2009-01-18 19:27:00

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,436
Website GitHub

Re: mem_form - Generic HTTP form processing

oliverker wrote:

This seems all a bit complicated to just attach a file to a form that will sent in an email me.

Ummm, complicated how? Use zem_contact_reborn to set up your contact form as normal, then within that form add either <txp:mem_form_file /> or request a copy of sed_afu and call that from within your form instead. The result is that any time anyone pulls up your contact form they can attach a file to send to you as well (up to the size limit imposed by you/PHP).

Of course, it’s your job to make sure the file is not some evil script!

EDIT: by all means roll your own script like the one you mentioned, but you could save yourself some hassle since the already debugged/tested TXP plugins mentioned above help do it for you.

Last edited by Bloke (2009-01-18 19:32:13)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#54 2009-01-18 19:45:19

oliverker
Plugin Author
From: Huddersfield
Registered: 2008-07-14
Posts: 90
Website

Re: mem_form - Generic HTTP form processing

Bloke.. (Stef)

This is my current for with zem_contact and I want to add the attach file at the end?

<txp:zem_contact to=“email@hidden.com” label=”“ >
<txp:zem_contact_text label=“Name” break=”“ size=“30” required=“1”/>
<txp:zem_contact_text label=“Telephone” break=”“ size=“30” required=“1”/>
<txp:zem_contact_email break=”“ size=“30” required=“0”/>
<txp:zem_contact_text label=“Website” break=”“ size=“30” required=“0”/>
<txp:zem_contact_textarea cols=“30” rows=“10” label=“Message” break=”“required=“1” />
<txp:zem_contact_submit label=“Send” />
</txp:zem_contact>

Would that look like this?

<txp:zem_contact to=“email@hidden.com” label=”“ >
<txp:zem_contact_text label=“Name” break=”“ size=“30” required=“1”/>
<txp:zem_contact_text label=“Telephone” break=”“ size=“30” required=“1”/>
<txp:zem_contact_email break=”“ size=“30” required=“0”/>
<txp:zem_contact_text label=“Website” break=”“ size=“30” required=“0”/>
<txp:zem_contact_textarea cols=“30” rows=“10” label=“Message” break=”“required=“1” />

<txp:mem_form_file enctype=“multipart/form-data” label=“File” />

<txp:zem_contact_submit label=“Send” />
</txp:zem_contact>

If it is then I need help as it isn’t working. Can you tell I draw pictures rather than code : )

Many Thanks for any help

Last edited by oliverker (2009-01-18 19:52:57)

Offline

#55 2009-01-18 20:08:42

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,436
Website GitHub

Re: mem_form - Generic HTTP form processing

oliverker

Aha, erm, well that’s how I’d have thought to use it(ish) but apparently I was telling porkies and it might actually be a bit more involved than I thought. Sorry, should have actually tried it first.

I’m not quite sure how to get zem_contact_reborn and mem_form to play together since they both generate HTML <form> tags. From what I understand of the docs, the enctype="multipart/form-data" goes in mem_form:

<txp:mem_form enctype="multipart/form-data">
  <txp:mem_form_file label="File" name="myfile" />
</txp:mem_form>

That generates an HTML <form> and associated file upload doohicky. Now in ZCR:

<txp:zem_contact to="email@hidden.com" label="">
... blah blah
</txp:zem_contact>

also generates an HTML <form>. So if you wrap one plugin call up inside the other you’ll have two forms nested and it’s (probably) browser dependent on which one (or both) gets sent :-\

If ZCR had a way of injecting some arbitrary info into the HTML <form> you could just add the enctype to that (I think) but I’m not sure if any of the existing attributes can be (ab)used for this task, or if you can specify the enctype yourself in the form. Perhaps I’m totally out of my league and should just shut up and let someone who has actually tried this to step in and guide you. Sorry for the potentially bogus information.

note to self: think before posting

Last edited by Bloke (2009-01-18 20:10:50)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#56 2009-01-18 20:14:28

oliverker
Plugin Author
From: Huddersfield
Registered: 2008-07-14
Posts: 90
Website

Re: mem_form - Generic HTTP form processing

mmmm,

Do you know how I would get my existing form in zem to be the same in mem_form with the attach file.

I have tried and it says it is a success but I don’t receive any email or anything, and I’m completely confused. I would be happy with using mem_form instead of Zem for the file attach, but can’t seem to get it to work?

Oliver

Offline

#57 2009-01-29 03:43:21

Manfre
Plugin Author
From: North Carolina
Registered: 2004-05-22
Posts: 588
Website

Re: mem_form - Generic HTTP form processing

mem_form only provides form processing and the form submission logic must be provided by another plugin. This plugin was created to reduce the work of other plugin developers.

I originally did not provide an email form handling plugin because ZCR exists.

Offline

#58 2009-02-18 00:10:38

Manfre
Plugin Author
From: North Carolina
Registered: 2004-05-22
Posts: 588
Website

Re: mem_form - Generic HTTP form processing

New version released. This fixes a few minor bugs related to mem_form_hidden and adds support for changing the content-type of sent emails.

Offline

#59 2009-02-18 22:37:10

cpk
Member
Registered: 2005-08-07
Posts: 62

Re: mem_form - Generic HTTP form processing

Michael,

Just attempted to install your mem_form v0.5.4 plugin into a TxP 4.0.7 install and am getting a “Badly formed or empty plugin code.” error on the admin plugins page.

cpk

Offline

#60 2009-02-18 23:05:09

cpk
Member
Registered: 2005-08-07
Posts: 62

Re: mem_form - Generic HTTP form processing

quick follow up:

the file with the problem is with: mem_form.txt.

mem_form.gz.txt works fine.

cpk

Offline

Board footer

Powered by FluxBB