Help with Puds donation system

So I’m trying to setup the puds donation system on my website but when I try to sign in through steam through the website it gives me just the word “error” under Yes,sign in again.
I keep clicking yes,sign in again but the word “error” is still there.I believe the errors below might be causing me not to log in steam through the website.

[21-Feb-2015 22:56:31 UTC] PHP Warning: Invalid argument supplied for foreach() in /home/…/public_html/donate/index.php on line 57
[21-Feb-2015 22:56:31 UTC] PHP Warning: strpos(): Offset not contained in string in /home/…/public_html/donate/openid.php on line 84

Here is the script:

////////PUDS Config Installer////////////
//Steam API Key//////////////////////////
$_STEAMAPI = "...................";
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
<html xmlns="" dir="ltr" lang="en-US">
<link rel="stylesheet" type="text/css" href="style.css">
    <title>PUDS Donation System</title>
	<div id="header">
		<h1>PayPay-ULX Donation System Config Installer</h1>
function curDomain() {
	$pageURL = 'http';
	if ($_SERVER["HTTPS"] == "on") {
		$pageURL .= "s";
		$pageURL .= "://";
	if ($_SERVER["SERVER_PORT"] != "80") {
	} else {
		$pageURL .= $_SERVER["SERVER_NAME"];
	return $pageURL;
//Gets the current Directory
function curDirectory() {
	$current_dir_url = 'http';
	if ($_SERVER["HTTPS"] == "on") {
		$pageURL .= "s";
		$current_dir_url .= "://";
	if ($_SERVER["SERVER_PORT"] != "80") {
		$current_dir_url .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"];
	} else {
		$current_dir_url .= $_SERVER["SERVER_NAME"];
	$current_dir_url .= dirname($_SERVER['PHP_SELF']);
	return $current_dir_url;
function GetSteamNorm($Steam64){
	$authserver = bcsub( $Steam64, '76561197960265728' ) & 1;
	//Get the third number of the steamid	
	$authid = ( bcsub( $Steam64, '76561197960265728' ) - $authserver ) / 2;
	//Concatenate the STEAM_ prefix and the first number, which is always 0, as well as colons with the other two numbers	
	$steamid = "STEAM_0:$authserver:$authid";
	return $steamid;
$curdirectory = curDirectory();
$curdomain = curDomain();

if(empty($_STEAMAPI)) {
	echo "<h1>You have not configured PUDS installer correctly! Please edit login.php and put your Steam API Key in the top of the file and try again!</h1>";
} else {
	if (!isset($_SESSION['id'])){
		echo "
				<p>Please login to configure Wullys PayPal-ULX Donation System</p>
				<form action='?login' method='post'>
				<input type='image' src=''>
			<h2>Instructions for use:</h2>
			<p>Sign in through steam. If you are the first user it will make you admin.</p>
			<p>You will be told your not admin, Log out then Log in again to be authenticated as admin.</p>";
		try {
			$openid = new LightOpenID($curdomain);
				if(isset($_GET['login'])) {
					$openid->identity = '';
					// This is forcing english because it has a weird habit of selecting a random language otherwise
					header('Location: ' . $openid->authUrl());
			} elseif($openid->mode == 'cancel') {
				echo 'User has canceled authentication!';
			} else {
				if($openid->validate()) {
					$id = $openid->identity;
					// identity is something like:
					// we only care about the unique account ID at the end of the URL.
					$ptn = "/^http:\/\/steamcommunity\.com\/openid\/id\/(7[0-9]{15,25}+)$/";
					preg_match($ptn, $id, $matches);
					echo "User is logged in (steamID: $matches[1])
					$url = "$_STEAMAPI&steamids=$matches[1]";
					$json_object= file_get_contents($url);
					$json_decoded = json_decode($json_object);
					foreach ($json_decoded->response->players as $player){
						/*echo "						
						<br/>Player ID: $player->steamid
						<br/>Player Name: $player->personaname
						<br/>Profile URL: $player->profileurl
						<br/>SmallAvatar: <img src='$player->avatar'/>
						<br/>MediumAvatar: <img src='$player->avatarmedium'/>
						<br/>LargeAvatar: <img src='$player->avatarfull'/>";
						echo "<br/>SmallAvatar: <img src='$player->avatar'/>";
						$steam64 = $player->steamid;
						$steamID = GetSteamNorm($steam64);

						//Get players ingame name
						$_SESSION['id'] = $steam64;
						$_SESSION['sid'] = $steamID;
						$_SESSION['name'] = $player->personaname;
						$_SESSION['mAvatar'] = $player->avatarmedium;
						$_SESSION['steamAPI'] = $_STEAMAPI;
							$str = "<?php \$admin = '$steam64';?>";
							$fp = FOPEN("admin.php", "w");
							FWRITE($fp, $str);
							echo "<p> Successfully made $friendlyName an admin!</p>";
							header("Location: $curdirectory/logout.php");							
						if($steam64 == $admin){
							$_SESSION['admin'] = True;
						} else {
							$_SESSION['admin'] = False;
					header("Location: $curdirectory/install.php");
		} catch(ErrorException $e) {
			echo $e->getMessage();
	} else {

Contact the developer. This subforum is for problems PLAYING the game, not modding it.