Form that writes to a CMS table

11 posts by 5 authors in: Forums > CMS Builder
Last Post: May 21, 2011   (RSS)

By zip222 - February 22, 2011

Is it complicated to setup a form that writes to a CMS table? I would like to collect information from visitors via a form and then display it on the site.

Re: [zip222] Form that writes to a CMS table

By JeffC - February 22, 2011 - edited: February 22, 2011

I think the file 'addForm.php' should do what you need. I have attached it for you
Jeff
Attachments:

addform_010.php 3K

Re: [Jeffncou] Form that writes to a CMS table

By zip222 - February 22, 2011

Thanks, that is what what I am looking for. Though... it works fine if I leave the code exactly as is. But if I try to add another field I am getting an "undefined index" error for each field that i try to add. it seems fairly straightforward what i need to update, but it is not working. any thoughts?

Re: [zip222] Form that writes to a CMS table

By JeffC - February 22, 2011

Have you added the field in the section editor. It sounds like perhaps the form is calling a field in the db that doesn't exist
Jeff

Re: [Jeffncou] Form that writes to a CMS table

By zip222 - February 22, 2011

Yes, it is definitely in the database with the exact same name.

Re: [zip222] Form that writes to a CMS table

By zip222 - February 22, 2011

Figured it out. I overlooked that I also needed to update the "name" values in the form inputs. I didn't know this add-on existed. It's pretty useful, and easy to implement.

Re: [zip222] Form that writes to a CMS table

By zip222 - May 19, 2011

Any thoughts on how I could some basic spam protection to this? I have read about using a hidden input field for this purpose, but I am not sure how to implement this.

Re: [zip222] Form that writes to a CMS table

You might also want to install a captcha

http://www.google.com/recaptcha/captcha
--
northernpenguin
Northern Penguin Technologies

"Any sufficiently advanced technology
is indistinguishable from magic."
........Arthur C. Clarke

Re: [northernpenguin] Form that writes to a CMS table

By zip222 - May 21, 2011

I am trying to use a system that doesn't require the user to enter anything. I read about methods that a field that is hidden to the user, but is "visible" to bots, and therefore tricks the bot into entering a value. The error checking looks at this field and then rejects the entry if anything is entered into the field.