gpt4 book ai didi

php - 通知 : Undefined index: buttonstyle in

转载 作者:行者123 更新时间:2023-11-27 23:31:53 25 4
gpt4 key购买 nike

我正在运行一个 PHP 脚本,当我在我的 VPS 上而不是在 web-server 上托管文件时出现此错误.

这里是错误:

Notice: Undefined index: buttonstyle in C:\xampp\htdocs\steamauth\steamauth.php on line 19

这是脚本 (C:\xampp\htdocs\steamauth\steamauth.php)

<?php
ob_start();
session_start();
require ('openid.php');

function logoutbutton() {
echo "<form action=\"steamauth/logout.php\" method=\"post\"><input value=\"Logout\" type=\"submit\" /></form>"; //logout button
}

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

$button['small'] = "small";
$button['large_no'] = "large_noborder";
$button['large'] = "large_border";
$button = $button[$steamauth['buttonstyle']];

if(!$openid->mode) {
if(isset($_GET['login'])) {
$openid->identity = 'http://steamcommunity.com/openid';
header('Location: ' . $openid->authUrl());
}
//echo "<form action=\"?login\" method=\"post\"> <input type=\"image\" src=\"http://cdn.steamcommunity.com/public/images/signinthroughsteam/sits_".$button.".png\"></form>";
}

elseif($openid->mode == 'cancel') {
echo 'User has canceled authentication!';
} else {
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];
include_once("set.php");
$query = mysql_query("SELECT * FROM users WHERE steamid='".$_SESSION['steamid']."'");
if (mysql_num_rows($query) == 0) {
mysql_query("INSERT INTO users (steamid) VALUES ('".$_SESSION['steamid']."')") or die("MySQL ERROR: ".mysql_error());
}
if (isset($steamauth['loginpage'])) {
header('Location: '.$steamauth['loginpage']);
}
} else {
echo "User is not logged in.\n";
}

}
} catch(ErrorException $e) {
echo $e->getMessage();
}
}

?>

或(为了更好看的版本):http://pastebin.com/gEQT0SUW

这里是steamauth/settings.php的代码

<?php
$steamauth['apikey'] = "CANT SAHRE IT. PRIVATE"; // Your Steam WebAPI-Key found at http://steamcommunity.com/dev/apikey
$steamauth['domainname'] = "CANT SAHRE IT. PRIVATE"; // The main URL of your website displayed in the login page
$steamauth['logoutpage'] = ""; // Page to redirect to after a successfull logout (from the directory the SteamAuth-folder is located in) - NO slash at the beginning!
$steamauth['loginpage'] = "/"; // Page to redirect to after a successfull login (from the directory the SteamAuth-folder is located in) - NO slash at the beginning!
?>

最佳答案

在您的 setting.Php 文件中,$steamauth['buttonstyle'] 没有可用的索引。

解决方案:

您需要在 setting.php 文件中定义 $steamauth['buttonstyle'] 您所需的值:

$steamauth['apikey'] = "CANT SAHRE IT. PRIVATE";

$steamauth['domainname'] = "CANT SAHRE IT. PRIVATE";

$steamauth['logoutpage'] = "";

$steamauth['loginpage'] = "/";

$steamauth['buttonstyle'] = "value that you need"; // add this index

为这个 URL 设置你需要的 buttonstyle index 的值:

http://cdn.steamcommunity.com/public/images/signinthroughsteam/sits_".$button.".png

关于php - 通知 : Undefined index: buttonstyle in,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35375962/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com