A powerful and flexible form builder system built with PHP 7.0.33 and MySQL. Create custom forms, collect submissions, and export data with ease. Features Google OAuth authentication and user identity management.
✅ User Authentication
- Google OAuth 2.0 login
- Secure session management
- User profile with identity information
- Each user has their own forms and data
- Profile customization (phone, company, website, bio, address)
✅ Form Builder Interface
- Create and edit forms with an intuitive interface
- Add unlimited custom fields
- Real-time form preview
✅ Field Types
- Text Input
- Number
- Textarea
- Dropdown Select
- Radio Buttons
- Checkboxes
- Date Picker
- Telephone
- URL
✅ Field Configuration
- Mark fields as required
- Set default values
- Custom validation patterns (regex)
- Placeholder text
- Help text for users
- Options for select/radio/checkbox fields
✅ Form Management
- Create multiple forms
- Edit existing forms
- Delete forms
- Activate/deactivate forms
- View submission statistics
✅ Data Collection
- Secure form submission handling
- Client and server-side validation
- IP address and user agent tracking
- Timestamp for all submissions
✅ Data Viewing & Export
- View all submissions in a table
- Export data to CSV format
- Export data to JSON format
- Delete individual submissions
- PHP 7.0.33 or higher
- MySQL 5.6 or higher
- Web server (Apache/Nginx)
- cURL extension enabled
- Google OAuth 2.0 credentials
-
Clone or download the repository
cd /var/www/html git clone <repository-url> formmaker
-
Create the database
mysql -u root -p < database.sql -
Configure database connection Edit
config.phpand update these settings:define('DB_HOST', 'localhost'); define('DB_NAME', 'formmaker'); define('DB_USER', 'your_username'); define('DB_PASS', 'your_password');
-
Set up Google OAuth Follow the detailed guide in GOOGLE_OAUTH_SETUP.md
Quick steps:
- Go to Google Cloud Console
- Create a new project
- Enable Google+ API
- Create OAuth 2.0 credentials
- Copy Client ID and Client Secret
- Update config.php with your credentials:
define('GOOGLE_CLIENT_ID', 'your_client_id_here'); define('GOOGLE_CLIENT_SECRET', 'your_client_secret_here'); define('GOOGLE_REDIRECT_URI', 'http://localhost/formmaker/oauth-callback.php'); define('BASE_URL', 'http://localhost/formmaker');
-
Set proper permissions
chmod 755 /var/www/html/formmaker chmod 644 /var/www/html/formmaker/*.php -
Access the application Open your browser and navigate to:
http://localhost/formmaker/You will be redirected to the login page to sign in with Google.
FormMaker/
├── config.php # Configuration file (database + OAuth)
├── index.php # Dashboard (main page)
├── login.php # Google OAuth login page
├── logout.php # Logout handler
├── oauth-callback.php # Google OAuth callback handler
├── profile.php # User profile/identity management
├── form-builder.php # Create/edit forms
├── form-display.php # Display forms to users
├── view-data.php # View submissions
├── export.php # Export data (CSV/JSON)
├── database.sql # Database schema with users
├── includes/
│ ├── Database.php # Database connection class
│ ├── Auth.php # Authentication helper
│ ├── User.php # User model
│ ├── Form.php # Form model
│ ├── FormField.php # FormField model
│ └── FormSubmission.php # FormSubmission model
├── assets/
│ └── style.css # Stylesheet
├── README.md # This file
└── GOOGLE_OAUTH_SETUP.md # Google OAuth setup guide
- Go to the dashboard (index.php)
- Click "Create New Form"
- Enter form name and description
- Click "Create Form"
- After creating a form, scroll to "Add New Field"
- Fill in field details:
- Field Name: Internal name (no spaces)
- Field Label: Display label for users
- Field Type: Choose from available types
- Required: Check if field is mandatory
- Options: For select/radio/checkbox (comma-separated)
- Placeholder: Hint text
- Default Value: Pre-filled value
- Validation Pattern: Regex pattern for validation
- Help Text: Additional guidance
- Click "Add Field"
- 10-digit phone:
^[0-9]{10}$ - Zip code:
^[0-9]{5}$ - Letters only:
^[a-zA-Z]+$ - Alphanumeric:
^[a-zA-Z0-9]+$
- From dashboard, click "View Data" on any form
- See all submissions in a table format
- Click "Export CSV" or "Export JSON" to download data
Share the form URL with users:
http://yourdomain.com/formmaker/form-display.php?form_id=1
forms
- Stores form definitions
- Fields: id, name, description, status, created_at, updated_at
form_fields
- Stores field configurations
- Fields: id, form_id, field_name, field_label, field_type, field_options, is_required, default_value, validation_pattern, placeholder, help_text, field_order
form_submissions
- Stores submission metadata
- Fields: id, form_id, submitted_at, ip_address, user_agent
submission_data
- Stores actual field values
- Fields: id, submission_id, field_id, field_value
getAllForms()- Get all formsgetFormById($id)- Get form by IDcreateForm($name, $description, $status)- Create new formupdateForm($id, $name, $description, $status)- Update formdeleteForm($id)- Delete formgetFormWithFields($id)- Get form with all fieldsgetSubmissionsCount($formId)- Get submission count
getFieldsByFormId($formId)- Get all fields for a formgetFieldById($id)- Get field by IDcreateField($data)- Create new fieldupdateField($id, $data)- Update fielddeleteField($id)- Delete fieldgetAvailableFieldTypes()- Get available field types
submitForm($formId, $fieldData)- Submit form datagetFormSubmissions($formId, $limit, $offset)- Get submissionsgetSubmissionById($id)- Get submission by IDgetFormSubmissionsWithData($formId)- Get submissions with datadeleteSubmission($id)- Delete submissionvalidateField($field, $value)- Validate field value
- PDO with prepared statements (SQL injection protection)
- Input validation and sanitization
- CSRF protection ready
- XSS protection with htmlspecialchars()
- Secure password handling ready
- IP address logging
- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
- Mobile browsers
- Check database credentials in config.php
- Verify MySQL service is running
- Ensure database exists
- Check that form status is "active"
- Verify form_id in URL is correct
- Check browser console for errors
- Verify all required fields are filled
- Check validation patterns
- Review PHP error logs
- User authentication and permissions
- Form templates
- Conditional logic (show/hide fields)
- File upload support
- Email notifications
- Form analytics and charts
- Multi-language support
- API endpoints for integration
This project is open source and available for use and modification.
For issues and questions, please check the documentation or contact the development team.
Version: 1.1.0 PHP Version: 7.0.33 Database: MySQL Last Updated: 2025