File: Example_simple.php

Recommend this page to a friend!
  Classes of Edoardo  >  PHP Form To DB  >  Example_simple.php  >  Download  
File: Example_simple.php
Role: Example script
Content type: text/plain
Description: Example1
Class: PHP Form To DB
Validate form submission and save to MySQL records
Author: By
Last change:
Date: 8 years ago
Size: 589 bytes



Class file image Download


/* Example: without validating */


//Incoming five vars: $_POST['name'], $_POST['email'], $_POST['message'], $_POST['checkbox_name'], $_POST['submit_req']

if( isset($_POST['submit_req']) )
$object = new FormToDb(_DB_HOST_, _DB_USER_, _DB_PASSWORD_, _DB_NAME_, 'my_table_name');
//...ignore these post variables
$object->toIgnore = array('submit_req', 'checkbox_name');

//...then cycle and save
$object->getErrors() == FALSE);


For more information send a message to info at phpclasses dot org.