From b96bc7586a5d69d408041a66d40a483f837e5e39 Mon Sep 17 00:00:00 2001 From: danix Date: Wed, 4 Jul 2018 17:44:08 +0200 Subject: initial commit --- danixland-contact-form.php | 302 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 302 insertions(+) create mode 100644 danixland-contact-form.php (limited to 'danixland-contact-form.php') diff --git a/danixland-contact-form.php b/danixland-contact-form.php new file mode 100644 index 0000000..8367d0d --- /dev/null +++ b/danixland-contact-form.php @@ -0,0 +1,302 @@ + +
+
+

$sitename

+
+

$sitemsg

+

$visitus

+
+ +DNX6655788EOT; +?> + + + + + array( + 'href' => array(), + 'title' => array() + ), + 'br' => array(), + 'em' => array(), + 'strong' => array(), + 'p' => array(), + 'pre' => array(), + 'code' => array() + ); + // security checks before submitting the form + if ( $_SERVER['REQUEST_URI'] == $_POST['_wp_http_referer'] && wp_verify_nonce( $_POST[ $dnxcf_form_name], $dnxcf_form_action ) ) { + + $dnxcf_posted = array(); + // let's gather some data about the user submitting the form + $dnxcf_ltd = trim(strip_tags(stripslashes(current_time("mysql")))); + $dnxcf_hst = trim(strip_tags(stripslashes(getenv("REMOTE_ADDR")))); + $dnxcf_ua = trim(strip_tags(stripslashes($_SERVER['HTTP_USER_AGENT']))); + // our posted options, arranged in one nice array + $dnxcf_posted['dnxcf_name'] = sanitize_text_field($_POST['dnxcf_name']); + $dnxcf_posted['dnxcf_email'] = sanitize_email($_POST['dnxcf_email']); + $dnxcf_posted['dnxcf_website'] = esc_url($_POST['dnxcf_website']); + $dnxcf_posted['dnxcf_subject'] = sanitize_text_field($_POST['dnxcf_subject']); + $dnxcf_posted['dnxcf_message'] = wp_kses($_POST['dnxcf_message'], $valid_html); + // let's begin with our email data, like receiver email, subject ecc. + $dnxcf_to = $dnxcf_options['dnxcf_recv_email']; + $dnxcf_headers = "Reply-To: " . $dnxcf_posted['dnxcf_email']; + $dnxcf_subject = __('Contact from "', 'dnxcf') . get_bloginfo('name') . '" - ' . $dnxcf_posted['dnxcf_subject']; + + // check for our content type and arrange our info accordingly + if ( 'text/html' == $dnxcf_email_output ) { + require( apply_filters( 'dnxcf_template_file', dirname( __FILE__ ) . '/include/dnxcf_mail_template_danixland.php') ); + $dnxcf_email_data = array( + 'ownname' => $dnxcf_options['dnxcf_recv_name'], + 'site' => get_bloginfo('name'), + 'time' => $dnxcf_ltd, + 'host' => $dnxcf_hst, + 'ua' => $dnxcf_ua, + ); + $dnxcf_message = dnxcf_email_content( $dnxcf_email_data, $dnxcf_posted ); + } else { // content_type is set to text/plain + $dnxcf_message = sprintf( + __("Hello \"%s\",\nyou are being contacted by %s on %s.\n%s has provided the following informations:\n\tEmail:\t\t%s\n\tWebsite:\t%s\n\tMessage:\n\n%s", 'dnxcf'), + $dnxcf_options['dnxcf_recv_name'], + $dnxcf_posted['dnxcf_name'], + get_bloginfo('name'), + $dnxcf_posted['dnxcf_name'], + $dnxcf_posted['dnxcf_email'], + $dnxcf_posted['dnxcf_website'], + $dnxcf_posted['dnxcf_message'] + ); + $dnxcf_message .= "\n\n##-----------#-----------#-----------##\n\n"; + $dnxcf_message .= sprintf( + __("We have also collected the following informations:\n\tBrowser:\t%s\n\tTime:\t\t%s\n\tIP Address:\t%s\n", 'dnxcf'), + $dnxcf_ua, + $dnxcf_ltd, + $dnxcf_hst + ); + } // end check for mail_content_type + $dnxcf_mailed = wp_mail( $dnxcf_to, $dnxcf_subject, $dnxcf_message, $dnxcf_headers ); + if ( $dnxcf_mailed ) { ?> +

+

+

+
+
+
+
+
+
+
+
+
+

+

+

+

+
+
+
+
+
+

+ +

administrator.', 'dnxcf'), get_bloginfo('admin_email') ); ?>

+ + + +

+ + +
+ +

+
+ +

*

+
+ +
+

+
+
+ +
+

+

+ + +

+

+ + +

+

+ + +

+
+
+

+

+ + +

+

+ + +

+
+
+ +
+
+
+ + \ No newline at end of file -- cgit v1.2.3