Advertisement
Guest User

Untitled

a guest
Sep 25th, 2013
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.39 KB | None | 0 0
  1. function getLastIndex(){
  2.     // query+get the last index value
  3.     return lastIndex;
  4. }
  5. function updateLastIndex($id){
  6.     //query+save $id
  7. }
  8. function indexFormula($id){
  9.     return ($id*2)+5 //you can use a more complicated formula or whatever
  10. }
  11. function getNewLink(){
  12.     $id = getLastIndex();
  13.     $id = indexFormula($id);
  14.     updateLastIndex($id);
  15.     //you can use base64 or whatever here
  16.     return $id;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement