Integration with the site

  1. 7 years ago

    How can I integrate my forum with site (login-signup)?

    I write this code:

    $url = '/talks/user/login';
    
    $ch = curl_init();
    
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    		
    preg_match('/name=\'token\' value=\'(.*?)\'/', curl_exec($ch), $m);
    $token = $m[1];
    
    $data = array(
    	'username'	=> USER_NAME,
    	'password'	=> USER_PASSWORD,
    );
    
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
    
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    
    $resp = curl_exec($ch);
    
    curl_close($ch);

    but nothing happens. I think this is in case of token...

  2. Deleted 7 years ago by Toby
  3. @Johnny How can I integrate my forum with site (login-signup)?

    I write this code:

    $url = '/talks/user/login';
    
    $ch = curl_init();
    
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    		
    preg_match('/name=\'token\' value=\'(.*?)\'/', curl_exec($ch), $m);
    $token = $m[1];
    
    $data = array(
    	'username'	=> USER_NAME,
    	'password'	=> USER_PASSWORD,
    );
    
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
    
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    
    $resp = curl_exec($ch);
    
    curl_close($ch);

    but nothing happens. I think this is in case of token...

    you can use this http://github.com/jasny/SSO/archives/master

  4. [deleted]

    14 Oct 2012
    Deleted 7 years ago by Toby
  5. [deleted]

    14 Oct 2012
    Deleted 7 years ago by Toby
 

or Sign Up to reply!