我目前正在创建一个使用我的Fortnite统计数据作为数据的bootstrap网站,并最终将其发布在我的抽搐Feed上.但是,当我在本地计算机上运行时,我设法让它完美地运行,但当我将它上传到我的hostgator目录时,网站加载很好,它只是没有数据.我得到的错误我相信我的JSON文件,但我假设发生此错误的唯一原因是因为没有数据,因为它在我本地机器以外的任何其他设备上运行时不能使用Fortnite API .以前有没有其他人经历过这样的事情?
错误:
源映射错误:SyntaxError:JSON.parse:JSON数据的第2行第1列的意外字符
源映射URL:bootstrap.min.css.map
这是我的代码我认为发布它没有多大意义,好像它在我的本地机器上运行逻辑说它没关系,对吧?
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.fortnitetracker.com/v1/profile/psn/myusername");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'TRN-Api-Key: mykey'
));
$response = curl_exec($ch);
curl_close($ch);
$fp = fopen("stats.json", "w");
fwrite($fp, $response);
fclose($fp);
$data = json_decode(file_get_contents("stats.json"));
$solo = $data->stats->p2;//solos data
$duos = $data->stats->p10;//duos data
$squads = $data->stats->p9;//squads data
$solo_wins = $solo->top1->valueInt;
$duos_wins = $duos->top1->valueInt;
$squads_wins = $squads->top1->valueInt;
$solo_matches = $solo->matches->valueInt;
$duos_matches = $duos->matches->valueInt;
$squads_matches = $squads->matches->valueInt;
$solo_kd = $solo->kd->valueDec;
$duos_kd = $duos->kd->valueDec;
$squads_kd …Run Code Online (Sandbox Code Playgroud) 因此,我在这里要做的就是向我的网站添加一个简单的页脚,该页脚在台式机上打开时可以正常运行,但是在平板电脑或移动设备上,只要打开键盘(例如登录),页脚就会向上移动到键盘上方。有解决这个问题的方法吗?
的CSS
#footer {
width: 100%;
background-color: #4c66a4;
color: #fff;
position: absolute;
left: 0px;
bottom: 0px;
text-align: center;
}Run Code Online (Sandbox Code Playgroud)
<div id="footer">
<p>© 2018 SulmaxCP. All Rights Reserved.</p>
</div>Run Code Online (Sandbox Code Playgroud)
我在这里要做的就是让我的 B16 单元格与顶部对齐。我已经为此编写了一些代码,但是出于某种原因,当我在 Excel 中打开它时,它与底部对齐仍然有人知道这是为什么吗?我在我的//Set Up区域设置了这个。
//Excel Transfer
$myFile=fopen("DATA/BI_spo.txt","r") or exit("Can't open file!");
$spo = fgets($myFile);
fclose($myFile);
$myFile=fopen("DATA/BI_cont.txt","r") or exit("Can't open file!");
$cont = fgets($myFile);
fclose($myFile);
$myFile=fopen("DATA/BI_site.txt","r") or exit("Can't open file!");
$site = fgets($myFile);
fclose($myFile);
$myFile=fopen("DATA/BI_job.txt","r") or exit("Can't open file!");
$job = fgets($myFile);
fclose($myFile);
$myFile=fopen("DATA/Ob_des.txt","r") or exit("Can't open file!");
$des1 = fgets($myFile);
fclose($myFile);
$myFile=fopen("DATA/Ob_act.txt","r") or exit("Can't open file!");
$act1 = fgets($myFile);
fclose($myFile);
$myFile=fopen("DATA/Ob_date.txt","r") or exit("Can't open file!");
$date1 = fgets($myFile);
fclose($myFile);
$myFile=fopen("DATA/GP_des.txt","r") or exit("Can't open file!");
$des2 = …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用文本文档创建用户帐户系统.但是我对我的代码的问题是它只是覆盖文档而不是测试它是否存在然后如果它不创建文档.任何想法为什么会这样?
<?php
if (isset($_GET['NewUsername'])){
if (isset($_GET['NewPassword'])){
$NewPassword = $_GET['NewPassword'];
$NewUsername = $_GET['NewUsername'];
if (file_exists("USERS/".$NewUsername)) {
echo 'Error: User Already Exists!';
}
else{
$myFile=fopen("USERS/".$NewUsername.".txt","w") or exit("Can’t open file!");
fwrite($myFile, $NewPassword);
fclose($myFile);
echo 'Account Created!';
}
}
}
?>
Run Code Online (Sandbox Code Playgroud)