-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproto.php
89 lines (69 loc) · 1.75 KB
/
proto.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?php
/**
* Blu Contact Form Proto Controller
*
*
*/
?>
<?php
/**
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/
/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define('WP_USE_THEMES', false);
/** Loads the WordPress Environment and Template */
require( $_SERVER['DOCUMENT_ROOT'] . '/wp-blog-header.php' );
/**
* Initialize Vars
*/
error_reporting(E_ALL & ~E_NOTICE);
global $bluContact;
$bluContact->setDebug(true);
$results = null;
/**
* Tests
*/
echo "Proto Tests<br />".PHP_EOL;
/**
* Insert Contact Record
*/
$r = rand(1111, 9999);
$contact_name = 'Foo Bar'.$r;
$contact_firstName = 'Foo'.$r;
$contact_lastName = 'Bar'.$r;
$contact_email = 'foo.bar.'.$r.'@this.com';
$contact_url = 'this.com';
$contact_phone = '555-555-1212';
$contact_country = 'United States';
$contact_age = '99';
$contact_note = 'This is a test '.$r.'.';
$contact_remoteAddress = $_SERVER['REMOTE_ADDR'];
$contact_requestUri = $_SERVER['REQUEST_URI'];
$fieldValues = array(
'contact_post_ID' => 0,
'contact_name' => $contact_name,
'contact_firstName' => $contact_firstName,
'contact_lastName' => $contact_lastName,
'contact_email' => $contact_email,
'contact_url' => $contact_url,
'contact_phone' => $contact_phone,
'contact_country' => $contact_country,
'contact_age' => $contact_age,
'contact_note' => $contact_note,
'contact_remoteAddress' => $contact_remoteAddress,
'contact_requestUri' => $contact_requestUri,
'contact_foo' => 'bar',
);
if ( $bluContact->insertContact($fieldValues) )
{
$results++;
}
echo "results: ".$results."<br />".PHP_EOL;
?>