PHP Classes

PHP Contact Form with Database Connection to SQLite: Process contact forms storing details using SQLite

Recommend this page to a friend!

  Author Author  
Picture of JImmy Bo
Name: JImmy Bo <contact>
Classes: 11 packages by
Country: United States United States
Innovation award
Innovation award
Nominee: 6x


  Detailed description   Download Download .zip .tar.gz  
This package can process contact forms storing details using SQLite.

It provides a class that implements functions to execute SQL queries to manage information of user contacts in an SQLite database.

Currently, it can:

- Create the database tables to store user messages and banned user IP addresses

- Add, update, and delete user messages

- Check, ban, and unban user computer IP addresses

- Search user messages by keyword

- Get submitted messages by the date

- Get the count of the total number of messages

Instructions:

class php_sqlite3_contact_form extends SQLite3
Functions:
- create_tables() // creates the tables if they don't exist
- get_sanitized_input($input) // sanitize input
- check_banned($ip) // check if an IP is banned
- ban_ip($ip) // add an IP to the banned table
- unban_ip($ip) // remove an IP from the banned table
- get_banned_ips() // get a list of banned IPs
- add_message($email, $subject, $message, $ip) // add a message
- update_message($id, $email, $subject, $message, $ip) // update a message
- delete_message($id) // delete a message
- get_messages() // get all messages
- get_message($id) // get a message by ID
- search_messages($keyword) // search messages by keyword
- get_messages_by_date_range($start_date, $end_date) // get messages in a date range
- count_messages() // count the total number of messages

Create:
//See an example for more detailed usage... but the basics are:
$cform = new php_sqlite3_contact_form('contact_form.db');
$cform->create_tables();

function show_messages_list($messages)
{
$the_str = "";
// as divs
while($row = $messages->fetchArray(SQLITE3_ASSOC))
$the_str .= show_message_row($row);
return $the_str;
} // end show_messages_list

echo show_messages_list($cform->get_messages());

  Classes of JImmy Bo  >  PHP Contact Form with Database Connection to SQLite  >  Download Download .zip .tar.gz  >  Support forum Support forum  >  Blog Blog  >  RSS 1.0 feed RSS 2.0 feed Latest changes  
Name: PHP Contact Form with Database Connection to SQLite
Base name: sqlite3contactform
Description: Process contact forms storing details using SQLite
Version: -
PHP version: 7
License: BSD License
 
  Groups   Applications   Files Files  

  Groups  
Group folder image Databases Database management, accessing and searching View top rated classes
Group folder image User Management User records, authentication and session handling View top rated classes
Group folder image Chat Chating and instant messaging View top rated classes
Group folder image AJAX Interact with the Web server without page reloading View top rated classes
Group folder image PHP 7 Classes using PHP 7 specific features View top rated classes
Group folder image Applications Full applications that perform useful tasks View top rated classes


  Applications that use this package  
No pages of applications that use this class were specified.

Add link image If you know an application of this package, send a message to the author to add a link here.

  Files folder image Files  
File Role Description
Plain text file class.php_sqlite3_contact_form.php Class PHP SQLite3 Contact Form Manager
Accessible without login Plain text file example.php_sqlite3_contact_form.php Example PHP SQLite3 Contact Form Manager Example

Download Download all files: sqlite3contactform.tar.gz sqlite3contactform.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.
  Files folder image Files  
File Role Description
Plain text file class.php_sqlite3_contact_form.php Class PHP SQLite3 Contact Form Manager
Accessible without login Plain text file example.php_sqlite3_contact_form.php Example PHP SQLite3 Contact Form Manager Example

Download Download all files: sqlite3contactform.tar.gz sqlite3contactform.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.