Machform – PHP Form Builder


I started using Machform for my static HTML websites back in 2010. Then, as it is today, Machform is a simple, self-hosted form solution that JUST works and has an affordable one-time license fee. Over a decade later, I still have a few clients happily chugging along using the Machform PHP form platform!

Once in a while, a client will contact me to see if I can recover an inadvertently deleted record. Sometimes, the record is an individual registration, sometimes a form.

Here are some tricks I’ve learned and still use to help recover “lost” content quickly.

The Status Field

In Machform, the visibility of a record or a form is determined by a field called Status. A zero (0) in the status field hides the record or form in the Machform Control Panel (where editors work and access the data). A one (1) in the status field makes the record or form visible. The status field is only accessible to developers via phpMyAdmin; it is not accessible from the Machform Control Panel.

To return a deleted record, I (as a developer) can log in to the hosting provider and use phpMyAdmin from cPanel to edit the tables.

How to bring back a form entry

In phpMyAdmin, navigate to the form you want to bring back an entry for. Hint: if you log in to your Machform CMS and click to manage entries for the selected form, you can look at the URL bar in your browser to find the form’s ID number. In the example URL below, the form’s id number is 24699, so that’s the table ID number I’ll look for in phpMyAdmin.

Once I’ve selected the correct form, I can change a single entry by clicking Edit, scrolling until I find the Status field, and changing the 0 to a 1. Don’t forget to keep scrolling, click GO to submit, and make the changes live.

Once I've selected the correct form, I can change a single entry by clicking Edit, scrolling until I find the Status field, and changing the 0 to a 1. Don't forget to keep scrolling, click GO to submit, and make the changes live.

This is the same process as updating a Form’s status. For Machform forms, I go to the AP-Forms table and change the status from 0 to 1 to make a form active/visible again in Machform.

Run SQL query

Today, a client asked for all the entries in a form to be turned back on. There were 29 entries that I knew needed the status changed. Instead of editing each entry one by one, I ran a single SQL query to change the status of each entry in the form to 1.

I used the following query. I simulated the query first to confirm it was working as expected; then I clicked Go. Almost instantly, all the advertently deleted entries are restored and accessible by the site editors in their Machform Control Panel. (Note: in the code below it is tildas, not quotes.)

UPDATE  `ap_form_24699` SET `status` = 1

I hope this is helpful to another Machform user or perhaps to someone using a similar PHP form product. I also often work in WordPress (PHP) and my favorite website CMS, Statamic, built on Laravel, widely regarded as the most secure and well-maintained PHP framework today.

Another tip: If you ever run into a 500 error, especially if the entry gets saved to your database but perhaps the Success page, final redirect page, or email notifications aren’t sent, go to your File Manager and find the error_log file. The errors are detailed and will likely help you fix the issue yourself.

How to bring back a deleted form

If your client or editor deletes a form from the Machform CMS, you can bring it back from phpMyAdmin. First, you’ll navigate to the database called ap_forms. This database lists all your forms, including archived and deleted forms. Each form entry has a field called form_active. An active form has a 1, and deleted forms have a 9 in this field. Change the number to 1, and your form will immediately become visible in the MachformCMS again.

Spam Protection in Machform

Amazingly, in 13 years, I’ve only had one form attacked by spammers! To prevent future spam entries, it took less than 30 seconds to implement the built-in Captcha. Here are the docs for Machform Spam protection.

My Background

I came to web design and programming from Graphic Design (I have a BFA and MFA in Graphic Design). SQL queries and back-end programming were not part of my formal training. I’ve learned as I’ve gone, and during COVID, I took a coding BootCamp – and I can’t recommend this type of route ENOUGH for any designer working in web design or front-end development. My confidence in programming grew exponentially during my BootCamp, and the course was FUN!

Happy Programming!

About the author

Kelly Barkhurst

Designer to Fullstack is my place to geek out and share tech solutions from my day-to-day as a graphic designer, programmer, and business owner (portfolio). I also write on Arts and Bricks, a parenting blog and decal shop that embraces my family’s love of Art and LEGO bricks!

Add comment

By Kelly Barkhurst

Recent Posts