It seems a few people are interested in my code, it is also apparent that some people are not familiar with PHP.
I’ve thrown together a simple script to demonstrate how it should work.

With regards to PHP, it’s a server side language and so you need to be running a web server that can interpret the language. I run my code on a shared hosting package you can see it in action at http://fifasearch.com, for those who just want to play I’d advise installing XAMP on your local machine and playing with the code on there.

Once you’ve set-up your testing environment (that can read php files) head over to my GitHub page and download the latest files. Put them in the root directory of you’re webserver (for XAMP that is “\xampp\htdocs”) then create a new file called search.php and copy the following code into it:


<?PHP
 //we let PHP know what other files
 //we will be using in this script
 require_once('connector.php');
 require_once('tradeor.php');
 require_once('eahashor.php');
 require_once('searchor.php');

 //enter your username, password, secret answer in the variables below
 //should look something like
 //$user = "ea@ea.com";
 //$password = "password";
 //$secret = "secretquestion";
 $user = "";
 $password = "";
 $secret = "";

//we call the eaEncode function from the EAHashor file
 $e = new EAHashor();
 $hash = $e->eaEncode($secret);
 //display the hash on the screen
 echo "Your Hash: " . $hash . "<br />";

 $c = new Connector($user, $password, $hash);
 $info = $c->connect();

 //display the connection info on the screen
 echo "<br />Your Connection Details:<br />";
 echo $info['EASW_KEY'] . "<br />";
 echo $info['EASF_SESS'] . "<br />";
 echo $info['PHISHKEY'] . "<br />";
 echo $info['XSID'] . "<br />";

 //we call the playersearch function from the Searchor file
 $s = new Searchor($info['EASW_KEY'], $info['EASF_SESS'], $info['PHISHKEY'], $info['XSID']);
 //we pass $s->playersearch a lot of variables
 //1. what number to start searching at
 //2. how many results do I want to get back (max 15)
 //3. what level is the player
 //4. what formation am I looking for
 //5. what position do they play
 //6. what nationality are they
 //7. what league do they play in
 //8. what team do they play for
 //9. minimum bid (this is not your offer)
 //10. maximum bid (this is not your offer)
 //11. minimum Buy It Now (this is not your offer)
 //12. maximum Buy It Now (this is not your offer)
 $search = $s->playersearch(0,1,'gold','f442','attacker','9','13','144','','','','');
 //display the search results on the screen
 echo "<br />A Single Search Result: <br />" ;
 var_dump($search);

 //we call the trade function from the Tradeor file
 //we pass $t-trade() a trade id to lookup
 $t = new Tradeor($info['EASW_KEY'], $info['EASF_SESS'], $info['PHISHKEY'], $info['XSID']);
 $trade = $t->trade(18629464);
//to bid 200 on the trade above you would use $t->bid(18629464, 200); 
 //display the trade details on the screen
 echo "<br /><br />A Single Trade Detail: <br />" ;
 var_dump($trade);
?>

Once you’ve done that, open your browser and point it at the search.php page and you should now see some output.

The searched for player is Berbatov, so you can work out the variables from that piece of information.