Jump to content

SteamID => Steam Community ID


dezkit

Recommended Posts

I have a script which can perfectly covert a SteamID to their Steam Community ID with this code:

<?php
function getFriendId($steamId)
{
    //Test input steamId for invalid format

    //Example SteamID: "STEAM_X:Y:ZZZZZZZZ"
    $gameType = 0; //This is X.  It's either 0 or 1 depending on which game you are playing (CSS, L4D, TF2, etc)
    $authServer = 0; //This is Y.  Some people have a 0, some people have a 1
    $clientId = ''; //This is ZZZZZZZZ.

    //Remove the "STEAM_"
    $steamId = str_replace('STEAM_', '' ,$steamId);

    //Split steamId into parts
    $parts = explode(':', $steamId);
    $gameType = $parts[0];
    $authServer = $parts[1];
    $clientId = $parts[2];

    //Calculate friendId
    $result = bcadd((bcadd('76561197960265728', $authServer)), (bcmul($clientId, '2')));
    return($result);
}
echo(getFriendId('STEAM_0:0:1'));
?>

 

But I can't seem to make a form with this script, can somebody help me out? Thank you.

Link to comment
https://forums.phpfreaks.com/topic/171377-steamid-steam-community-id/
Share on other sites

But I can't seem to make a form with this script

 

What does that mean exactly? Forms are made with html.

Well,

<?php
function getFriendId($steamId)
{
    //Test input steamId for invalid format

    //Example SteamID: "STEAM_X:Y:ZZZZZZZZ"
    $gameType = 0; //This is X.  It's either 0 or 1 depending on which game you are playing (CSS, L4D, TF2, etc)
    $authServer = 0; //This is Y.  Some people have a 0, some people have a 1
    $clientId = ''; //This is ZZZZZZZZ.

    //Remove the "STEAM_"
    $steamId = str_replace('STEAM_', '' ,$steamId);

    //Split steamId into parts
    $parts = explode(':', $steamId);
    $gameType = $parts[0];
    $authServer = $parts[1];
    $clientId = $parts[2];

    //Calculate friendId
    $result = bcadd((bcadd('76561197960265728', $authServer)), (bcmul($clientId, '2')));
    return($result);
}
echo(getFriendId('STEAM_0:0:1'));
?>

Gives me the correct page of that steamid, but if I do this...

 

<?php
function getFriendId($steamId)
{
    //Test input steamId for invalid format

    //Example SteamID: "STEAM_X:Y:ZZZZZZZZ"
    $gameType = 0; //This is X.  It's either 0 or 1 depending on which game you are playing (CSS, L4D, TF2, etc)
    $authServer = 0; //This is Y.  Some people have a 0, some people have a 1
    $clientId = ''; //This is ZZZZZZZZ.

    //Remove the "STEAM_"
    $steamId = str_replace('STEAM_', '' ,$steamId);

    //Split steamId into parts
    $parts = explode(':', $steamId);
    $gameType = $parts[0];
    $authServer = $parts[1];
    $clientId = $parts[2];

    //Calculate friendId
    $result = bcadd((bcadd('76561197960265728', $authServer)), (bcmul($clientId, '2')));
    return($result);
}
$id = $_GET["id"];
echo(getFriendId('$id'));
?>

 

It won't work.

Is there a way to remove the %3A in the url after searching? http://newzonemedia.com/steamid.php

 

<body bgcolor="red">
<center>
<form action="" method="get">
<input type="text" name="id" value="<?php echo $_GET['id'];?>">
<input type="submit">
<br>Script made by dezkit.
</center>
</form>
<?php
function getFriendId($steamId)
{
    //Test input steamId for invalid format

    //Example SteamID: "STEAM_X:Y:ZZZZZZZZ"
    $gameType = 0; //This is X.  It's either 0 or 1 depending on which game you are playing (CSS, L4D, TF2, etc)
    $authServer = 0; //This is Y.  Some people have a 0, some people have a 1
    $clientId = ''; //This is ZZZZZZZZ.

    //Remove the "STEAM_"
    $steamId = str_replace('STEAM_', '' ,$steamId);

    //Split steamId into parts
    $parts = explode(':', $steamId);
    $gameType = $parts[0];
    $authServer = $parts[1];
    $clientId = $parts[2];

    //Calculate friendId
    $result = bcadd((bcadd('76561197960265728', $authServer)), (bcmul($clientId, '2')));
    return $result;
}
$id = $_GET["id"];
echo "<iframe src='http://www.steamcommunity.com/profiles/".getFriendId($id)."' width='100%' height='100%'>";
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.