Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#37 2008-09-16 12:47:38
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: mem_form - Generic HTTP form processing
Sheru
My requirement: Actually our client need send bigger files using FTP. What I thought is, It would be better for the client(in terms of their convenience) to upload the stuff by going through the website. For this, I would first use ign_password_protect plugin to authenticate the user. If authentication is successful, then user will be shown upload form.
I’m assuming all these users are known clients right? Or will they be creating their own logins via mem_self_register too?
Upload file would be going to public_html/files folder. It’s not necessary to insert into the Txp’s files table. Is this possbile using the mem_form plugin and what about the security risk if yes?
Manfre’s plugin uploads the file to the $tempdir
directory (/textpattern/tmp by default IIRC) with a random filename. If you want it moved and renamed — and that’s a pretty good idea — then you’ll need some code to do it. Manfre’s examples are the place to start but they only illustrate deletion of the uploaded file rather than moving it to another directory. At the very least you’d want to notify whoever’s going to download them of the location and name of the uploaded file.
If you don’t insert them into the DB you can’t use txp’s categories or other meta-info in your pages and forms to list them on your site so you’d have to rely on your webserver’s automatic indexing of the /files folder. This might not be a good idea if there is any confidential data in those documents.
— Steve
Offline
#38 2008-09-17 04:17:43
- Sheru
- Member
- From: Kathmandu, Nepal
- Registered: 2007-05-09
- Posts: 96
Re: mem_form - Generic HTTP form processing
Dear Steve,
Greetings!
Thank you so much for your valuable time for my post.
I’m assuming all these users are known clients right? Or will they be creating their own logins via mem_self_register too?
Yes these are known clients. They won’t create their own logins. We will create and give them login details.
If you don’t insert them into the DB you can’t use txp’s categories or other meta-info in your pages and forms to list them on your site so you’d have to rely on your webserver’s automatic indexing of the /files folder. This might not be a good idea if there is any confidential data in those documents.
I am open to insert into database as long as my requirement fulfills. Hope to be in touch.
Thank you so much for your time and kind help
Sheru
Last edited by Sheru (2008-09-17 04:18:01)
Offline
Re: mem_form - Generic HTTP form processing
Sheru, since you mentioned large file uploads, make sure that PHP, textpattern and mem_form are configured to allow files of the size you desire. The current restriction is 2 MB.
Jonathan, now that I have file upload support in mem_form, I am in the process of updating mem_moderation_image to support mem_form. This will have the functionality that you wanted when we last spoke about the tennis site.
Offline
Re: mem_form - Generic HTTP form processing
I’m using mem_form
in conjunction with mem_simple_form
to pass user-submitted articles directly into my textpattern
table— Woohoo! Works great! There are a few things I’m trying to tweak for a better user experience:
mem_form_checkbox
parses into the database as “Yes” or “No” based on whether or not it’s checked. The custom field I have assigned to this field usesglz_custom_fields
to pass a string ofmy own text
to the database only if it’s checked. This way I can use atxp:if_custom_field
conditional to output the string when there’s data, and ignore it when there’s not. I think I could re-jigger my conditional statement to do it based on “Yes” or “No”, but I’d rather keep it consistent with the admin-side. Does that make sense?- I need a category input field, and
mem_form_select_category
works great— but I have thousands of categories. Is there a way I could use display an input field and allow users to select a category that matches their input as they type? I see this behavior in a lot of web forms, notably Facebook’s note/photo tagging field, which allows you to begin entering a name, showing you selectable matches in a dropdown display as you type.mem_form_select_category
is the only way I can get the form to parse a category1 string— text input doesn’t work (and unrestricted text input could have very bad results). Not sure what do do.
Any suggestions? Once again, the mem_form
and mem_simple_form
is a super-hero dynamic duo for the project I’m working on, and I can’t wait to get paid again so that I can donate!
Offline
Re: mem_form - Generic HTTP form processing
1. You could use mem_form_select if you want specifc values. Otherwise, test for “yes” or “no”. (it’s called simple_form for a reason)
Offline
Re: mem_form - Generic HTTP form processing
Greetings Guys,
I’m still a newbie to TXP, as such pardon me if I sound rather ‘lost’. I’ve just added mem_form, and mem_self_register to my TXP install, with which I’m trying to implement the following:
- Member log-on form [basically a User-Name and Password combo] on default page [home page] of my TXP install, with a ‘register now’ link [which re-directs to the actual ‘new member registration’ form] for new member registrations, and a ‘recover password’ link [which could redirect to a form] for password resets.
Will greatly appreciate some pointers, or advise on how to get this done….I’m lost [my brain’s seizing up
Que,
Que-Multimedia
Offline
Re: mem_form - Generic HTTP form processing
Hi, Que—
You also need ign_password_protect.
Then you can add this to your default page:
<h2>Login</h2>
<txp:ign_show_login form="your-login-form" remember="1" />
Set up a section for your registration page and use something like this:
<h2>Sign Up</h2>
<txp:mem_self_register_form form="your-self-register-form" />
You can hard code your link to that section or use Textpattern’s <txp:section_list
tag with a sections="your-sigup-section"
attribute.
Hope this helps!
As for recovering your password, I’m not sure. Anybody else?
Offline
Re: mem_form - Generic HTTP form processing
To create a password reset form – use the super secret <txp:mem_self_password_reset_form>
Example:
<txp:mem_self_password_reset_form confirm_url="/password-reset" >
<h6>Reset Your Password</h6>
<p>Enter your username and email below and we'll send you a new password.</p>
<dl id="reset">
<dt>Username:</dt><dd><txp:mem_form_text name="name" label="" break="" /></dd>
<dt>Email:</dt><dd><txp:mem_form_email name="email" label="" break="" /></dd>
<dt> </dt><dd><txp:mem_form_submit name="submit" label="Submit" /></dd>
</dl>
</txp:mem_self_password_reset_form>
On submit this outputs a generic email – the user follows that link in that email and can then reset their password.
You can use the attribute “form_mail” to customize your form – although, I haven’t done this.
Disclaimer: I’m still experimenting with this myself – I may have neglected to explain a required step
Also, this is not a “password recovery” – it is a “password reset”.
Hope this helps. I’ll report back as I become more familiar.
—
T
Last edited by renobird (2009-01-07 16:37:40)
Offline
Re: mem_form - Generic HTTP form processing
Thanks, Tom!
Offline
Re: mem_form - Generic HTTP form processing
Thanks Johnstephens,
Have tried this out….seems to be holding the fort….probably I’ll tinker around a little bit.
Que,
Que-Multimedia
Offline
Re: mem_form - Generic HTTP form processing
Hi,
I have come across this pluggin as I’m looking for a contact form that supports file attachment.
BUT am not sure how it works, I have previously been using Zem Contact, but can’t seem to get this work.
Please can you help.
Thanks
Oliver
Offline
Re: mem_form - Generic HTTP form processing
I think the plugin you need is sed_afu.
Offline