-1

I have a script running and working, however the insert into members part don't work:

function register_member($username,$name,$email,$password) {
$time = time();
$ip = get_ip();
db()->query("INSERT INTO members (full_name,username,email,password,ip_address,last_active,date_created,banned,active)VALUES(?,?,?,?,?,?,?,?,?)",
    $name,$username,$email,$password, $ip, $time, $time,0,1);
//login user

login_user($username, $pass, false);

if (config('auto-follow', '')) {
    $users = explode(',', config('auto-follow'));
    foreach($users as $user){
        $user = get_user($user);
        if ($user) {
            follow($user['id']);
        }
    }
}
return true;

}

It seems for me that it can't read the db()->query ("INSERT INTO part. When I remove that query, the signup script can complete reading the function, but if I leave it in, it returns a 500 internal error. Any ideas?

Tipstr
  • 3
  • 3
  • Please turn on the error reporting first then paste the error you are getting. You can check this question to know how to turn on error reporting. https://stackoverflow.com/questions/845021/how-to-get-useful-error-messages-in-php – Krishnadas PC Jan 28 '18 at 12:26
  • jus a suggestion seems you have no space between the `)VALUES(` try add as:. `) VALUES (` – ScaisEdge Jan 28 '18 at 12:38
  • Tried adding the space in values, but still no go. Will gather an error report asap.. – Tipstr Jan 28 '18 at 13:29
  • Tried adding the htaccess error reporting, but it gives me a 500 internal server error then.. I am on Bitnami and google cloud, running lamp stack. So I can't edit the php.ini.. – Tipstr Jan 28 '18 at 13:55
  • Finally got the php.ini to change, and it is in the js script the error is happening. – Tipstr Jan 28 '18 at 14:01

1 Answers1

0

Finally got the php.ini to change, and it is in the js script the error is happening. On this line here: var json = jQuery.parseJSON(result);

$(document).on("submit", "#signup-form", function() {
    $(".loader-container").fadeIn();
    $(this).ajaxSubmit({
        url : baseUrl + 'signup',
        success : function(result) {
            var json = jQuery.parseJSON(result);
            if (json.status == 1) {
                //we can redirect to the next destination
                window.location.href = json.url;
                notify(json.message, 'success');
            } else {
                notify(json.message, 'error');
                $(".loader-container").fadeOut();
            }
        }
    })
    return false;
});    
Tipstr
  • 3
  • 3