用steam登录返回白页?

On my website I have a login with steam feature, upon signing in on the steam end of this process, people are redirected to a white page, rather than the home page, also, the sign in data is never sent to the server, I've tried reading through my code but I can't seem to find why this problem is occurring.

openid.php

http://pasted.co/7824d0f0

settings.php

    <?php
$fileLoc = $_SERVER['DOCUMENT_ROOT'] . '/../passwords.txt';
if (file_exists($fileLoc)) {
    $fh = fopen($fileLoc, 'r');
    $jsonStr = fgets($fh);
    $arr = json_decode($jsonStr, true);
    $apiKey = $arr['steamAPIKey'];
    fclose($fh);
} else {
    die('no file found');
}

$steamauth['apikey'] = $7456B63D1E2C9CAFC06ACF35D97E1D9C; // Your Steam WebAPI-Key found at http://steamcommunity.com/dev/apikey
$steamauth['domainname'] = "http://www.csgoexcite.com/"; // The main URL of your website displayed in the login page
$steamauth['buttonstyle'] = "large"; // Style of the login button [small|large_no|large]
$steamauth['logoutpage'] = "index.php"; // Page to redirect to after a successfull logout (from the directory the SteamAuth-folder is located in) - NO slash at the beginning!
$steamauth['loginpage'] = "index.php"; // Page to redirect to after a successfull login (from the directory the SteamAuth-folder is located in) - NO slash at the beginning!

// System stuff
if (empty($steamauth['apikey'])) {die("<div style='display: block; width: 100%; background-color: red; text-align: center;'>SteamAuth:<br>Please supply an API-Key!</div>");}
if (empty($steamauth['domainname'])) {$steamauth['domainname'] = "localhost";}
if ($steamauth['buttonstyle'] != "small" and $steamauth['buttonstyle'] != "large") {$steamauth['buttonstyle'] = "large_no";}
?>

steam-login-handle.php

<?php
# Copyright (c) 2015 Jordan Turley, CSGO Win Big. All Rights Reserved.

session_start();
require('SteamAuthentication/steamauth/openid.php');

try {
    require('SteamAuthentication/steamauth/settings.php');
    $openid = new LightOpenID($steamauth['domainname']);


    if($openid->validate()) { 
        $id = $openid->identity;
        $ptn = "/^http:\/\/steamcommunity\.com\/openid\/id\/(7[0-9]{15,25}+)$/";
        preg_match($ptn, $id, $matches);

        $_SESSION['steamid'] = $matches[1];

        header('Location: /index.html');

        //Determine the return to page. We substract "login&"" to remove the login var from the URL.
        //"file.php?login&foo=bar" would become "file.php?foo=bar"
        # $returnTo = str_replace('login&', '', $_GET['openid_return_to']);
        //If it didn't change anything, it means that there's no additionals vars, so remove the login var so that we don't get redirected to Steam over and over.
        # if($returnTo === $_GET['openid_return_to']) $returnTo = str_replace('?login', '', $_GET['openid_return_to']);
        # header('Location: '.$returnTo);
    } else {
        echo "User is not logged in.
";
    }
} catch(ErrorException $e) {
    echo $e->getMessage();
}
?>
php
dqrnsg6439
dqrnsg6439 试过它,仍然遇到麻烦,仍然是完全相同的结果。@AhmedKhan
4 年多之前 回复
douqiang5933
douqiang5933 尝试在索引标题之前从标题中删除“/”('Location:index.html');
4 年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问