Need help with MD5 hash working with 2 scripts


#1

Hi there,
I am not too familiar with php but learning, and am not used to MD5 at all. I have a game I have put onto my site and in order to put my members name into the game everything is sent back to the other sites server with MD5. I think I can figure this out with only one site member but I can not seem to figure this out for numerous members.

I use joomla for my site and am able to pull up the logged in member by using the following script.

<?php

define( '_JEXEC', 1 );
define('JPATH_BASE', dirname(__FILE__));
define( 'DS', DIRECTORY_SEPARATOR );
require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );

/* Create the Application */
$mainframe =& JFactory::getApplication('site');


echo JFactory::getUser()->username;

// $db     =& JFactory::getDBO();

// $query      = 'SELECT COUNT(session_id) FROM #__session AS s WHERE s.userid = guest = 0 AND client_id = 0';
// $db->setQuery($query);
// $online_num = (int) $db->loadResult();
// if($online_num){
    
	// echo $online_num;
// }
?>



The script that calls the game up is the following with the game parameters below it.


<script src="//game.site.com/games/game.js"></script>
<ins class="site.game"
	data-game-short-name="game"
	data-language="en"
    data-width="75%"
    data-height="90%"
    data-member-id="my member id
    data-time-limit-scale="30"
></ins>

data-player-id

If your website has a membership system, then you can use this parameter to tell the game the ID of the logged in player. If you have set this parameter, then you must also set the data-player-hash parameter.

data-player-name

If your website has a membership system, then you can use this parameter to tell the game the name of the logged in player. If you have set this parameter, then you must also set the data-player-hash parameter.

data-player-picture-url

If your website has a membership system, then you can use this parameter to tell the game the url of the picture of the logged in player. If you have set this parameter, then you must also set the data-player-hash parameter.

data-player-hash

This parameter is used to validate, data-player-id, data-player-name, and data-player-picture-url parameters. If you have set any of these parameters, then you must also set this parameter. To calculate the value of this parameter, first join the values of the data-player-id, data-player-name, data-player-picture-url parameters, and the Secret Key displayed in the Games section of your Games Account Members Area, and then calculate the MD5 hash of the resultant string. For example if data-player-id is set to “1234” (without quotes), data-player-name is “John Smith”, data-player-picture-url is “http://www.website.com/picture.png”, and your Secret Key is “asdfqwer”, then the value of data-player-hash should be set to the MD5 hash of the string"1234John Smithhttp://www.website.com/picture.pngasdfqwer", which is “01217526eca0ed4a68ee2bb0b380ad97”

Your help would be greatly appreciated.


#2

And what exactly do you need help with? It gives an example of what they are doing.