to generate an api code simply use the following function
<?php
function api_code($salt) {
return sha1($salt.time().substr($salt,-floor(strlen($salt)/2)));
}
echo api_code('my_secret_salt');
Then store your api codes in a database to refer to so that you can check if an api code is valid or not.
cwarn23
Occupation: Genius
3,033 posts since Sep 2007
Reputation Points: 413
Solved Threads: 260
Skill Endorsements: 13