-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.php
33 lines (28 loc) · 971 Bytes
/
example.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
include("forms_process.class.php");
$_POST["fn"] = "jonathan";
$_POST["ln"] = "de montalembert";
$_POST["mphone"] = "+8618600014793";
$_POST["mail"] = "leunetre@hotmail.com";
$_POST["country"] = "france";
$_POST["city"] = "paris";
$_POST['lang'] = 'en';
$_POST['fullname'] = $_POST["fn"].' '.$_POST["ln"];
$form = new Form($_POST);
// if($form->setConnection('localhost', 'root', '', 'fuel_dev'))
// echo 'connected';
// else
// echo 'not connected';
// $form->received();
// $form->getStructure("callback");
// $form->setConnection('localhost', 'root', '', 'fuel_dev');
$form->setValues("city fn mphone mail country lang")->setColumns("city name phone email country language")->setTable("form");
date_default_timezone_set('Asia/Shanghai');
$form->add(array("fromURL"=> "google", "website" => "cn"));
$form->addIP("user_ip");
$form->check("mail")->exist()->isEmail();
$form->check("mphone")->isPhone();
if($form->save())
echo 'success';
else
echo 'not saved';