Adding form data to CMSB

8 posts by 2 authors in: Forums > CMS Builder
Last Post: October 7, 2008   (RSS)

By aev - October 1, 2008

Found a script in this post:
http://www.interactivetools.com/forum/gforum.cgi?post=64265#64265
..for adding form data to CMSB.

The script is pretty understandable, but it left me wonder how it can add data to my database without authenticating?

-aev-

Re: [aev] Adding form data to CMSB

By Dave - October 1, 2008

Hi aev,

Your MySQL login details are stored in /data/settings.dat.php and the line that loads /lib/init.php runs some code to automatically login.

So /lib/init.php is authenticating for you.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Adding form data to CMSB

By aev - October 2, 2008

Hi Dave,

ok, thanks for explaining this.

Will this code work in PHP 4.3.0+ and MySQL 4.1.7+, like the rest of CMSB?

-aev-

Re: [aev] Adding form data to CMSB

By Dave - October 2, 2008

Yes, it should. As it's the code we use ourselves to base forms on when we build them for custom jobs.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Adding form data to CMSB

By aev - October 6, 2008

Hi Dave,

I would like to add an image upload to this form, how can we do that?

-aev-

Re: [aev] Adding form data to CMSB

By Dave - October 6, 2008

We don't have an automated way to do that yet, unfortunately.
Dave Edis - Senior Developer
interactivetools.com

Re: [aev] Adding form data to CMSB

By Dave - October 7, 2008

Long term yes, short term no. We want to automate how those fields work so we don't need to rewrite that functionality for each form (I've had to do that a few times myself already).

If you're writing a custom php script basically you can just save the upload to the upload dir and then insert information about it into the upload table.

If you want to re-size the images as well you can take a look at the saveResampledImageAs() function.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com