MyBB Community Forums

Full Version: Login via PHP
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
<?php
$postdata = http_build_query(
    array(

	'username' => 'user',
	'password' => 'name',
	'action' => 'do_login',
	'remember' => 'yes',
	'submit' => 'Anmelden',
	'url' => ''

	
	
    )
);

$opts = array('http' =>
    array(
        'method'  => 'POST',
        'header'  => 'Content-type: application/x-www-form-urlencoded',
        'content' => $postdata
    )
);

$context  = stream_context_create($opts);

$result = file_get_contents('http://domain/member.php?action=do_login', false, $context);

echo $result;

Allways returns badlogin, username or password false. But the logindatas are correct.
What do you mean?
Does this happen for every user?
yes
every login try fails
Hi, can you provide a Test account + Password?
User:APITest
Pass:123456
Domain: k-cheat.de
well, the username password combination you gave me, logs in perfectly Confused
but not with php^^
curl/file_get_contents
What do you mean by "not with php" ?
You are talking about the login in your mybb forum right?
na i want to check the logindatas remotely (see script at first post)
So what are you attempting to do overall? Grab the last login dates for certain users? Or log a user in and return their login date?
Pages: 1 2