• Hey there,

    I keep getting this error Fatal error: Call to a member function on a non-object in /homepages/40/d128893498/htdocs/blog/wp-content/themes/bka/test.php on line 21

    Can anyone see what I did wrong with the code? Please help, last part of this theme and I am done…

    <?php

    if ($_POST[“name”] == “” or $_POST[“email”]){
    echo ‘Invalid Name or Email’;
    }
    else {

    echo ‘Thank You!’;

    $name = $_POST[“name”];
    $email = $_POST[“email”];

    function activate() {
    global $wpdb;

    $wpdb->get_results($wpdb->prepare(“INSERT INTO wp_subscribe2 (name, email, active, date, ip) VALUES (%s, %d, NOW(), %s)”, $name, $email, 1, $current_user->user_login));
    }
    activate ();
    }

    ?>

  • The topic ‘Fatal error: Call to a member function’ is closed to new replies.