Hello.

Part of a site i am making requires me to get information from an XML feed. I have a function that checks to make sure it can access the feed then get data from a tag in that feed. However, when i call the function using the code below i get:

Fatal error: Exception thrown without a stack frame in Unknown on line 0

Function Code:

//Get users steam name if possible//
function GetSteamName($GetSteamName_Steam64) {
	if((@simplexml_load_file("http://steamcommunity.com/profiles/".$GetSteamName_Steam64."/?xml=1")) && (IsValidSteam64($GetSteamName_Steam64))) {
		$SteamProfileXML = simplexml_load_file("http://steamcommunity.com/profiles/".$GetSteamName_Steam64."/?xml=1");
		$GetSteamName_SteamName = $SteamProfileXML->steamID;
		return $GetSteamName_SteamName;
	} else {
	return false;
	}
}

code that calls it:

$GetSteamUserName = GetSteamName($Steam64);
	if($GetSteamUserName) {
		$_SESSION['SteamName'] = $GetSteamUserName;
		$SteamUserName = " <b>".$GetSteamUserName."</b>!";
	}

also, IsValidSteam64 is just a simple function which shouldn't be effecting anything.

//Do some basic validation on a Steam64 ID//
function IsValidSteam64($IsValidSteam64_Steam64) {
	if(($IsValidSteam64_Steam64 != "") && (IsNum($IsValidSteam64_Steam64)) && ($IsValidSteam64_Steam64 > 9999999999999999)) {
		return true;
	} else {
		return false;
	}
}

//Check If Input Is Numeric//
function IsNum($IsNum_Number) {
	if (!is_array($IsNum_Number)) {
		return (preg_match("/^[0-9]+$/", $IsNum_Number));
	} else {
		return false;
	}
}

Any help would be much appreciated because its been annoying me for hours.

Okay, it seems to only happen when i set the $_SESSION in the IF statement.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.